Ok, a month later, but I wrote you some code (in python) for this;)
(Assuming you are only after the image density histogram)
import cv im2 = cv.LoadImage('ph05l.jpg') width, height = cv.GetSize(im2) hist = [] column_width = 1
To speed things up, you do not need to change the image files, just change the width of the selection cell ( column_width in the script), it is obvious that you will lose some resolution if you do this (as you can see in the image below).
In the picture I show the results (graphical hist display) with your file using column_width of 1, 10 and 100. They ran for me for 0.11, 0.02 and 0.01 seconds respectively.
I wrote it in PIL , but it works about 5-10 times slower.

fraxel
source share