I've found that for lightening up a dark image, increasing the gamma value works best. However, that introduces a haze over the image (it looks as if it was slightly foggy), and I've noticed that I can make the haze go away by decreasing brightness and increasing contrast in such a way that the histogram curve occupies the entire range. This also works to get the haze out of images that have it from the beginning. However, this method takes some fiddling with the BC numbers/sliders to get right. Would it be possible to have a button or checkbox to make this happen automatically? Bonus points if the tool is batchable (with gamma adjustment as a parameter) Or is there already a tool that does this naturally? (None of the color->AutoCorrection seem to do much (except Equalize), and Equalize usually spoils the colors completely).
We need an algorithm to adjust BCG settings automatically... Any proposal, link, url ? Gilles Caulier
I dunno... the histogram is displayed, so at some point it's probably stored somewhere. Assuming the histogram x axis goes from 0 to 99, maybe we could do something as follows: int min=-1; int max=-1; int i; for(i=0; i<=99; i++) { if(histogram[i] != 0) { min=i; break; } } for(i=99; i>=0; i++) { if(histogram[i] != 0) { max=i; break; } } brightnessCorrection = 100-(min+max); contrastCorrection = 100-(max-min); I don't really know the digikam code that much, so maybe the numbers (bounds) probably need adjustment and/or scaling to make everything fit. The goal here is to tweak contrast/brightness such that the black part of the histogram stretches enough to fill the available space, without any black part being "cut" off, and without any part where y is 0 (or very small) left over near the bounds.
Reminds me of levels adjust, with some automatic determination of input range?
Possibly... but it'd need a simpler UI
Doesn't the auto-correction in the colours menu do that already?
Unfortunately not (see my first comment)
auto correction (I think the last option in it) does what levels adjust can be used for and hence imho what is needed to lighten up images that do not use the full spectrum/range.
Just for info, AutoLevels code is in this dir, if you want to take a look to improve it : https://projects.kde.org/projects/extragear/graphics/digikam/repository/revisions/master/show/libs/dimg/filters/levels Gilles Caulier
As S. Burmeister said in comment #5, stretch histogram feature is already implemented in Colors/Auto-color correction tool (available in BQM and Image Editor). I close this file now. Gilles Caulier