Getting Greyscale pixel value from RGB colourspace in Java using BufferedImage
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 = (pixel) & 0xff;

and then average red,green,blue.

But i feel like for such a simple operation I must be missing something...
Getting Greyscale pixel value from RGB colourspace in Java using BufferedImage
===

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 = (pixel) & 0xff;

and then average red,green,blue.

But i feel like for such a simple operation I must be missing something...