Getting Greyscale pixel value from RGB colourspace in Java using BufferedImage
- by Andrew Bolster
Anyone know of a simple way of converting the RGBint value returned from <BufferedImage> getRGB(i,j) into a greyscale value?
I was going to simply average the RGB values by breaking them up using this;
int alpha = (pixel >> 24) & 0xff;
int red = (pixel >> 16) & 0xff;
int green = (pixel >> 8) & 0xff;
int blue =…