Bug 396244

Summary: Cross-channel color adjustment goes plain red
Product: [Applications] krita Reporter: caetano <chameleonscales>
Component: Filter LayersAssignee: joupent
Status: RESOLVED FIXED    
Severity: normal CC: griffinvalley, info
Priority: NOR    
Version: 4.1.0   
Target Milestone: ---   
Platform: Appimage   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: [^ screenshot of the bug, reproductible 4.1appimage]

Description caetano 2018-07-06 09:47:41 UTC
When setting a cross-channel color adjustment layer (or mask) to channel: Saturation and Driver channel: Hue
every pixel of the original image that has 0 saturation becomes plain red as soon as we tweak the curve no matter how.

Steps to reproduce:
1. Create a new Krita document
2. Add some brush strokes of grays with 0 saturation and some brush strokes with a very slight color saturation.
3. Add a filter layer or filter mask
4. Set it to Cross-channel color adjustment
5. Set Channel to Saturation and Driver channel to Hue
6. add a point to the curve and move it in any direction: the white canvas becomes plain red and the grey strokes have plain red multiplied in them too.

My GPU: Nvidia GeForce 820M with proprietary driver on Linux Mint.
Comment 1 David REVOY 2018-07-06 10:05:51 UTC
Created attachment 113798 [details]
[^ screenshot of the bug, reproductible 4.1appimage]

Hi, confirmed and easy to reproduce. 
I attach a screenshot.
Thank you for the clean step by step.
Comment 2 wolthera 2018-07-06 11:14:41 UTC
probably caused by the fact that grey has no hue so the algorithm just assigns it hue value 0(red).
Comment 3 David REVOY 2018-07-06 14:52:56 UTC
@Wolthera: yes, this is correct. I also think the Saturation of the cross-channel is HSV based, that could explain the sudden jump to full red for white.
Comment 4 joupent 2018-07-08 13:00:54 UTC
Git commit cb0ea0fb194a98e548f9e4a02ba6ee9ba592a0b8 by Jouni Pentikäinen.
Committed on 08/07/2018 at 12:58.
Pushed by jounip into branch 'master'.

Fix out-of-range lookups in cross-channel curve filter

M  +5    -4    plugins/color/colorspaceextensions/kis_hsv_adjustment.cpp

https://commits.kde.org/krita/cb0ea0fb194a98e548f9e4a02ba6ee9ba592a0b8
Comment 5 Halla Rempt 2018-07-09 15:09:18 UTC
Git commit 62588fded3bf9da84280cda582ecf28c9d663668 by Boudewijn Rempt, on behalf of Jouni Pentikäinen.
Committed on 09/07/2018 at 14:40.
Pushed by rempt into branch 'krita/4.1'.

Fix out-of-range lookups in cross-channel curve filter

M  +5    -4    plugins/color/colorspaceextensions/kis_hsv_adjustment.cpp

https://commits.kde.org/krita/62588fded3bf9da84280cda582ecf28c9d663668