Question

How to plot and display Histogram of an Image ?If it can done using Java Advance Imaging API please suggest me how to do this?

Was it helpful?

Solution

This link provides a tutorial to use the Java Advanced Imaging API http://www.raditha.com/java/image/ to do what you want. Personally I use the standard image API's to do this, create a BufferedImage from your image file and then use getRGB() on each pixel. From this you can get the individual red, green and blue values for each pixel. You can count the number of values, 0-255, storing them in an array like the bins of a histogram. I use this for internal processing and don't display the graph so unfortunately I can't help you with the displaying part.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top