[Digikam-devel] [Bug 128377] Adjust levels: histograms don't match, bad "auto level" function

Matthias Wieser mwieser at gmx.de
Tue Mar 25 20:29:20 GMT 2008


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=128377         




------- Additional Comments From mwieser gmx de  2008-03-25 21:29 -------
Dear Gilles,

> the original histogram is _always_ computed from _original_ image, never from 
> preview. There is no performance problem here, because original histogram is 
> always computed one time, at plugin startup...

OK, no comments up to here.

> The only histogram which is computed in live is about target image,
> and of course for performance reason. Computing full target image 
> histogram is a non-sence: this require to render all color changes [...]

I think it should be possible to refresh the target histogram (based on the original! image) with more than 30fps. So you can have live display of the correct(!) target histogram.
How to do this?
1. calculate the original histogram (already done during plugin start-up as you wrote above)
2. copy the original histogram data (256 values * 3 color channels) into the target histogram data structure and display the "target"-histogram.
3. Every time the user changes a slider, recalculate the target histogram.
  To do this, there is no need to analyze the original or the preview image, just use the original histogram data (256 values * 3 color channels), apply the color transformation on it and display the histogram.

With this simple approach you can have a live histogram that changes while the user is moving the sliders around. AND it is correct and does not differ from the original histogram.

Hope this helps,
  Matthias

> Note : Unforget than Target Histogram computed from preview image is just a 
> guide to help photographer.

If the guide does not correctly show where the highlights and the shadows end, it is not a help to the photographer but the contrary.



More information about the Digikam-devel mailing list