GNOME Bugzilla – Bug 72959
Making histograms from selection
Last modified: 2004-12-10 23:11:56 UTC
I'd like to have the possibility of making histograms from part (selection) of an image. Why can't I do this? Even when I make selection the histogram is still based on entire image. Strange because histogram in Levels' window is selection sensitive. For photos it would be usefull to select only main subject and analyse only his own histogram.
Changes at the request of Dave Neary on the developer mailing list. I am changing many of the bugzilla reports that have not specified a target milestone to Future milestone. Hope that is acceptable.
This sound more like an enhancement than a bug. Therefore I'm changing this to make the real bug-list more managable.
I could be mistaken, but this looks completely trivial to implement: just add a gimp_drawable_mask_bounds to gimp_tool_histogram_initialize in gimphistogramtool.c. Sven/Mitch: any reason for not doing this?
gimp_drawable_mask_bounds would only restrict it to the bounding box of the selection. That doesn't seem like the right thing to do. We'd have to weight the pixel values by the respective values in the selection mask. That would of course also not be difficult to implement.
It seems to be a lot simpler actually: gimp_histogram_calculate() takes a a mask parameter. We just need to use it. I'm just not sure how the user interface should look like. IMO the GimpHistogramEditor widget should be as compact as possible.
I don't see why the user interface has to change at all. If there is a selection, use it, no questions asked. This seems to be the way most things in Gimp work.
Following further discussion on mailing list, done as suggested: the histogram widget now uses only the contents of the selection. A rare case where functionality can be added by making the code simpler! 2004-12-09 Bill Skaggs <weskaggs@primate.ucdavis.edu> * app/widgets/gimphistogrameditor.c: make histogram editor, and therefore histogram dialog, use the selection. Should resolve bug #72959.