Could someone show me here how to access all the pixels of an image in order to be able to build a histogram of that image ?
You can use
java.awt.image.BufferedImage image = ImageIO.read( "image.gif" );
int[] samples = image.getData().getPixel( x, y, null );
// or the pixel converted to the default RGB color model:
int rgb = image.getRGB( x, y )
I think the samples you get from there are the RGB values, but you have to check that...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With