Bug 430105

Summary: [Color Balance] 'Preserve Luminosity' option is inverted
Product: [Applications] krita Reporter: David REVOY <info>
Component: FiltersAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED INTENTIONAL    
Severity: normal CC: dimula73, halla
Priority: NOR    
Version First Reported In: 4.4.1   
Target Milestone: ---   
Platform: Appimage   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: ^ gif-animation of the bug

Description David REVOY 2020-12-07 11:29:40 UTC
Created attachment 133916 [details]
^ gif-animation of the bug

Hi,

To reproduce:
=============
1. Open in Krita an artwork (grayscale dark art highlight better the bug).
2. Apply a Color Balance adjustement filter (Ctrl+B), in "Shadow" category, move  the cursor for Yellow to extreme left.

Result:
=======
The shadows turns to a pure yellow color, even if the "Preserve Luminosity" checkbox is 'on'. Turning the checkbox 'off' preserve better the Luminosity (not  matching HSY "color" blending mode, but ok'ish ;-) ). So, I conclude the checkbox behavior went inverted at one point.
Comment 1 Dmitry Kazakov 2021-07-27 12:31:55 UTC
Hi, David!

The problem is that in the code the current implementation does really try to preserve the luminosity. It converts the final color into HSL color space and recovers the old value of L channel :)

If you check the midtones slider, then you can see that the effect of the checkbox is visible much better :)

I'm not actually sure it is a bug :)
Comment 2 Halla Rempt 2021-07-27 12:44:59 UTC
Git commit dda41897e7e1c947883149148b63747736580e07 by Halla Rempt.
Committed on 27/07/2021 at 12:44.
Pushed by rempt into branch 'master'.

Resort the pattern chooser so the new pattern gets in the list

Selecting the actual new pattern doesn't work though.

M  +3    -0    libs/ui/kis_control_frame.cpp
M  +10   -0    libs/ui/kis_custom_pattern.cc
M  +2    -1    libs/ui/kis_custom_pattern.h
M  +1    -1    libs/ui/widgets/gradient/KisGradientChooser.cpp
M  +3    -0    libs/ui/widgets/kis_pattern_chooser.cc
M  +5    -2    libs/ui/widgets/kis_pattern_chooser.h

https://invent.kde.org/graphics/krita/commit/dda41897e7e1c947883149148b63747736580e07
Comment 3 Halla Rempt 2021-07-27 12:46:06 UTC
Eek, this commit was for a different bug.
Comment 4 David REVOY 2021-07-27 13:13:11 UTC
Thank you Dmitry for checking!

Ok, I understand that I misunderstood the 'Luminosity' term in the user interface. I thought it would be a HSY based. 

"Luminosity Vs Luminance Vs Lightness Vs Luma Vs Exposure Vs Value" is a difficult game :-)

No need for a fix then; I understand fixing it to HSY would be a pain and break retro-compatibility; especially for Filter-Layers of old Kra.

The bug can be marked as 'Resolved/Wontfix'.
Comment 5 Dmitry Kazakov 2021-07-28 05:17:15 UTC
Okay, closing a bug as "intentional" :)