class mm
{
int width = gtest.greenImage.getWidth();
int height = gtest.greenImage.getHeight();
WritableRaster raster = gtest.greenImage.getRaster();
for (int xx = 0; xx < width; xx++) {
for (int yy = 0; yy < height; yy++) {
Color c = new Color(gtest.greenImage.getRGB(xx, yy));
int[] pixels = raster.getPixel(xx, yy, (int[]) null);
pixels[0] = c.getGreen() ;
l1.add(c.getGreen());
raster.setPixel(xx, yy, pixels); }}
int width1 = gtest.blueImage.getWidth();
int height1 = gtest.blueImage.getHeight();
WritableRaster raster1 = gtest.blueImage.getRaster();
for (int xx = 0; xx < width1; xx++) {
for (int yy = 0; yy < height1; yy++) {
Color c = new Color(gtest.blueImage.getRGB(xx, yy));
int[] pixels = raster.getPixel(xx, yy, (int[]) null);
pixels[1] = c.getBlue() ;
l2.add(c.getBlue());
raster1.setPixel(xx, yy, pixels);
}}
int width2 = gtest.redImage.getWidth();
int height2 = gtest.redImage.getHeight();
WritableRaster raster2 = gtest.redImage.getRaster();
for (int xx = 0; xx < width2; xx++) {
for (int yy = 0; yy < height2; yy++) {
Color c = new Color(gtest.redImage.getRGB(xx, yy));
int[] pixels = raster.getPixel(xx, yy, (int[]) null);
pixels[2] = c.getRed() ;
l3.add(c.getRed());
raster2.setPixel(xx, yy, pixels);}
}
}
}
in above code i am giving three different plane (red plane,green plane,blue plane)that each plane reading pixel by pixel .i am storing each pixel in array list according to that image color . i want retrieve original image by using three different plane .is it possible and in above code if i add three array list in one image is it found original image please help me how form by using three different plane into one image