View Full Version : Histogram of colour levels

04-24-2006, 10:41 AM
How could I produce a histogram of the grey levels in an image?

I would like to be able to get a .bmp image, put it into my program and then have that give me the grey levels of each pixel.

I could then put this data into Excel and produce a Histogram of it.

Can anyone tell/guide me to how I could get the data for each pixel?

Any help is much appreciated, thanks in advance!

04-24-2006, 11:02 AM
glReadPixels will do nicely, but you don't need openGL to do this job, it can be done by just loading the bmp and directly getting the histogram data from the image data.

alternatively use the GL_EXT_histogram extention

04-24-2006, 12:14 PM
Thanks so much for such a quick reply!

I'm having some compiler trouble atm so I will try it out later.

Thanks again!