i'm trying to write a code that masks red and blue channel from the image inputted.I have retrieved r,g,b values but however stuck up in proceeding further.I'm just a beginner.Can anyone help me in this please?
public class Green
{
public static void main(String args[]) throws IOException
{
BufferedImage bi= ImageIO.read(new File( "image.jpg" );
for (int x=0; x <= bi.getWidth(); x++){
for (int y = 0; y <= bi.getHeight(); y++){
int pixelCol=bi.getRGB(x,y);
int r= (pixelCol>>16) & 0xff;
int b = pixelCol & 0xff;
int g = (pixelCol>>8) & 0xff;
int px=0;
px=(px|(g<<8);
bi.setRGB(x,y,px);
}}}}