private static void printData(StringBuffer output, String fn, BufferedImage img, int mode, boolean rle) {
	    	printHeader(output, fn, "data", img.getWidth()/8, img.getHeight()/8);
	    int bytesCount=1;
        int prec_i1 = 0;
        int prec_i2 = 0;
        int repetitions_counter = 0;
	    for (int y = 0; y < img.getHeight(); y=y+8*mode) {
	        for (int x = 0; x < img.getWidth(); x=x+8) {
	          BufferedImage s = img.getSubimage(x, y, 8, 8*mode);
	          int i1 = 0;
	          int i2 = 0;
	          for (int y1=0;y1<8*mode;y1++) {
		        	  i1=0;
		        	  i2=0;
		        	  for (int x1=0;x1<8;x1++) {
	                  if (s.getRGB(x1, y1)==0xffb0b0b0) i1+= 0x01<<(7-x1);
	                  if (s.getRGB(x1, y1)==0xff808080) i2+=0x01<<(7-x1);
	                  if (s.getRGB(x1, y1)==0xff000000) {i1+=0x01<<(7-x1);i2+=0x01<<(7-x1); }
	           	  }
		          if (rle) {
			        	  	if (i1 == prec_i1 && i2 == prec_i2)
			        	  	{
				          	repetitions_counter++;
				        	  	if (repetitions_counter > 1) {
				        	  		if (repetitions_counter < 255) {
				        	  			continue;
				        	  		} else {
					        	  		appendValue(output, repetitions_counter, bytesCount);
					        	  		bytesCount++;
				        	  			repetitions_counter = 0;
				        	  		}
				        	  	}
			        	  	}
			        	  	else if (repetitions_counter > 0)
			        	  	{
			        	  		  appendValue(output, repetitions_counter+1, bytesCount);
				              bytesCount++;
				              repetitions_counter = 0;
			        	  	}
					    prec_i1 = i1;
					    prec_i2 = i2;
		        	  }
		          appendValue(output, i1, bytesCount);
		          
	              bytesCount++;
		          appendValue(output, i2, bytesCount);
		          bytesCount++;
	          }
	        }
	    }
	    if (repetitions_counter > 0) {
	  		  appendValue(output, repetitions_counter+1, bytesCount);
	  		  bytesCount++;
	    }
        if ((bytesCount%16) == 1) {
	    	    output.delete(output.length()-5, output.length()-1);
		    	output.trimToSize();
        } else {
	    	    output.deleteCharAt(output.length()-1);
		    	output.trimToSize();
        }
	    	output.append("\n\n");
	}