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

Matthias Wieser mwieser at gmx.de
Sun Mar 23 17:35:51 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-23 18:35 -------
Hello *, thanks for the respond.

About problem 1: This seems to be performance related. If using the preview image as histogram source is the only possible way (performace wise) I'm fine with it. But maybe it's possible to precompute one R, one G and one B histogram from the full image (don't know how long it takes, but should be fast) and use this as base for the GUI. Changing the sliders would then only stretch or compress the precomputed histogram data and would not require to re-create the histogram.

About problem 2:
Regarding the auto-function I would not look at other programs but at the users. I think what most of the users most often want is a feature to stretch the contrast of an image. This means:
* No visible change to the colour, only luminance (I know about the slight differences between RGV vs. LAB)  (an image of a green plant should remain green and should not become grey)
* No highlight or shadow clipping.

Therefore one single multiplication factor and one substraction factor should be computed for all three RGB channels:
 Substraction_factor = min(min(R), min(G), min(B))
 multiplication factor = 255/max(max(R - substraction_factor), max(R - substraction_factor), max(B - substraction_factor)) (for 8 bit per channel)
==> new_pixel_value = (old_pixel_value-substraction_factor)*multiplication_factor (same factors for all channels).

Best regards,
   Matthias



More information about the Digikam-devel mailing list