RSS/Atom feed Twitter
Site is read-only, email is disabled

get raw histogram data for image, not just statistics

This discussion is connected to the gimp-user-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

2 of 2 messages available
Toggle history

Please log in to manage your subscriptions.

get raw histogram data for image, not just statistics phil laks 11 Sep 16:15
  get raw histogram data for image, not just statistics Sven Neumann 12 Sep 08:49
phil laks
2007-09-11 16:15:57 UTC (over 17 years ago)

get raw histogram data for image, not just statistics

Hi,
I would like to use the perl interface to automate processing of black and white images. I would like to set a threshold for white vs black on the images based upon the histogram without
physically looking at each image. I dont want to do it using the gimp-gui. I would like to get an array consisting of the histogram hist[i] = count of pixels in image with intensity i.
however the only function i see in the PDB is (mean,std_dev,median,pixels,count,percentile) = gimp_histogram (drawable,channel,start_range,end_range) which would require 256 calls of this function to get the data. Is there another function that can return an array of the histogram?
My goal is to use the histogram to pick a threshold between "gray background" and text on a jpg image of a book page that I make a picture of with my digital camera.
Thanks
Mitchell

I also posted this to usenet gimp group. I dont know how to avoid cross posting this.

---------------------------------
Be a better Heartthrob. Get better relationship answers from someone who knows. Yahoo! Answers - Check it out.

Sven Neumann
2007-09-12 08:49:54 UTC (over 17 years ago)

get raw histogram data for image, not just statistics

Hi,

On Tue, 2007-09-11 at 07:15 -0700, phil laks wrote:

however the only function i see in the PDB is (mean,std_dev,median,pixels,count,percentile) = gimp_histogram (drawable,channel,start_range,end_range) which would require 256 calls of this function to get the data. Is there another function that can return an array of the histogram?

What's wrong with doing 256 PDB calls? Shouldn't take considerable time to complete. If you dislike this, you could also look at the pixel data and create the histogram yourself.

Sven