Bug 259223

Summary: Overexposure prevention in white balance tool [patch]
Product: [Applications] digikam Reporter: pochini
Component: Plugin-Editor-WhiteBalanceAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: wishlist CC: caulier.gilles, pochini
Priority: NOR    
Version: 1.6.0   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In: 2.4.0
Attachments: avoid overesposure in white balance
Prevent overexposure in WB tool
Prevent overexposure in the white balance tool

Description pochini 2010-12-08 17:02:58 UTC
Created attachment 54305 [details]
avoid overesposure in white balance

Version:           1.6.0 (using KDE 4.4.3) 
OS:                Linux

The white balance tool has a big problem in its current form: almost always it overexposes and clips at least one of the rgb components. The exposure compensation thing does not help here because it is applied on the already clipped image.
I wrote a simple proof-of-concept patch (attached) that makes the wb tool useable by scaling down the rgb multipiers just enough to prevent clipping.
The biggest problem with my patch is that the final image can be quite a lot dimmer than the preview image because the scaler smooths the (usually tiny) brightest spots of the photo.


Reproducible: Sometimes
Comment 1 pochini 2010-12-12 15:13:05 UTC
Created attachment 54459 [details]
Prevent overexposure in WB tool

I prepared a better patch. This one is against the latest svn version, works in both 8 and 16 bits mode and it follows the coding style.
Comment 2 caulier.gilles 2010-12-13 08:50:44 UTC
Thanks Pochini. I will review your patch soon...

Gilles Caulier
Comment 3 caulier.gilles 2011-11-10 10:30:33 UTC
Pochini, 

Do you have an updated version of your patch working with 2.x code from git/master repository ?

Gilles Caulier
Comment 4 pochini 2011-11-13 23:04:59 UTC
Created attachment 65631 [details]
Prevent overexposure in the white balance tool

Yes, the patch is attached. It applies cleanly to any v2.x .
Comment 5 caulier.gilles 2011-11-14 13:50:24 UTC
Git commit 86f103b771a9bdcc1a80f16e6f2a57c648ed5bc1 by Gilles Caulier.
Committed on 14/11/2011 at 14:47.
Pushed by cgilles into branch 'master'.

Apply patch #65631 to prevent Overexposure with Withe Balance adjustement.
Modify patch to always compute RGB multipliers over original image in case of preview rendering in image editor.
Use more private internal container plus code polish
BUGS: 259223

M  +3    -0    imageplugins/color/whitebalancetool.cpp
M  +13   -4    libs/dimg/filters/wb/wbcontainer.h
M  +103  -25   libs/dimg/filters/wb/wbfilter.cpp
M  +17   -5    libs/dimg/filters/wb/wbfilter.h
M  +12   -13   libs/dimg/filters/wb/wbsettings.cpp
M  +2    -3    libs/dimg/filters/wb/wbsettings.h

http://commits.kde.org/digikam/86f103b771a9bdcc1a80f16e6f2a57c648ed5bc1