I have used the following code to extract pixel values of an image.
int[][] pixels = new int[w][h];
for( int i = 0; i < w; i++ )
for( int j = 0; j < h; j++ )
pixels[i][j] = imgBuffer.getRGB( i, j );
Now I modified the pixel values and drew the new figure by
BufferedImage image=new BufferedImage(w,h,BufferedImage.TYPE_INT_RGB);
for( int i = 0; i < w; i++ )
for( int j = 0; j < h; j++ )
image.setRGB( i, j,pixels[i][j] );
Now when i try to get the values by
int[][] pixels1 = new int[w1][h1];
for( int i = 0; i < w1; i++ )
for( int j = 0; j < h1; j++ )
pixels1[i][j] = imgBuffer1.getRGB( i, j );
This is giving me completely new values