Histogram White Spike bug in Brightness Contrast Filter dialog

William Steidtmann billstei at hbci.com
Wed Dec 1 20:19:28 CET 2010


On 12/01/2010 04:13 AM, Boudewijn Rempt wrote:
> On Tuesday 30 November 2010, William Steidtmann wrote:
>> Attached is a patch that eliminates the KisHistogram::KisHistogram()
>> constructor that does not pass a "bounds" parameter when using a paint
>> device, and modifies all calls to the new KisHistogram constructor that
>> does use "bounds".  Most of these calls are (temporarily) passing
>> exactBounds (and so this code does not change behaviour there), with the
>> exception of the Brightness Contrast filter, which now passes image
>> bounds, and thus fixes the White Spike bug in the Brightness Contrast
>> filter dialog.  This is very much the same as the Levels Filter
>> histogram patch (see Commit #1200357).
>>
>> To recreate the (pre-patch) bug:
>>
>> 1) Create a 10x10 image, 8 bit sRGB.
>> 2) Set the color to a dark gray 92,92,92.
>> 3) Use a pixel brush to paint all (most) of the image this dark gray.
>> 4) Use menu Filter->Adjust->Brightness/Contrast curve...
>> 5) Note that the graph has little or no indication (count) in the second
>> quadrant where this dark gray should be.
>>
>> After the patch, the second quadrant in step 5) will have an appropriate
>> pixel count.
>>
>> William Steidtmann
>>
> Apart from the test that fails to compile, this patch does fix the issue. I'm wondering about the scaling of the histogram, though. The spikes are very small, barely visible.
>
Per the steps above, what I am seeing on the Brightness/Contrast filter 
graph is one full length vertical bar and some smaller ones, so I am not 
sure why you are not seeing at least that, however...

It occurs to me that the appearance of the (previously patched) Levels 
graph versus the Brightness/Contrast graph suggests that in the Levels 
case the largest vertical bar is:  the_largest_bin_count / 
total_bins_count (i.e. <= 1.0),  and in the Brightness/Contrast case the 
largest vertical bar is:  the_largest_bin_count / the_largest_bin_count 
(i.e. always 1.0).  Assuming I am right, I think the Levels graph 
scaling makes the most sense, and I will investigate this soon.



More information about the kimageshop mailing list