| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 
 |  
int[] rouge = new int[256];
int[] vert = new int[256];
int[] bleu = new int[256];
Raster trame = image.getRaster();
Raster trame2 = image2.getRaster();
int[] rgb = new int[3];
int[] rgb2 = new int[3];
int dif=0;
for (int y=0; y<2; y++) {
  for (int x=0; x<2; x++) {
    trame.getPixel(x, y, rgb);
    rouge[rgb[0]]++;
    vert[rgb[1]]++;
    bleu[rgb[2]]++;
    System.out.println("" +rgb[0]);
  }
}
System.out.println("");
for (int y=0; y<2; y++) {
  for (int x=0; x<2; x++) {
    trame2.getPixel(x, y, rgb2);
    rouge[rgb2[0]]++;
    vert[rgb2[1]]++;
    bleu[rgb2[2]]++;
    System.out.println("" +rgb2[0]);
  }
}
System.out.println("");
if (rgb[0]>rgb2[0]) {
  dif=(rgb[0]-rgb2[0]);
}
if (rgb[0]<rgb2[0]){
  dif=(rgb2[0]-rgb[0]);
}
System.out.println("" +dif); | 
Partager