Bug 497336 - [retrocompatibility] Color issue with Filter Layers: Color Adjustment curves
Summary: [retrocompatibility] Color issue with Filter Layers: Color Adjustment curves
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Filter Layers (show other bugs)
Version: 5.2.7
Platform: Appimage Linux
: NOR major
Target Milestone: ---
Assignee: Dmitry Kazakov
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2024-12-11 17:27 UTC by David REVOY
Modified: 2024-12-12 13:12 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
^ The jpg on left (color as saved in 2017), the Krita files in modern Krita on right. The curve was applied on the "Hue" channel instead of the Lightness. (424.83 KB, image/jpeg)
2024-12-11 17:27 UTC, David REVOY
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David REVOY 2024-12-11 17:27:33 UTC
Created attachment 176527 [details]
^ The jpg on left (color as saved in 2017), the Krita files in modern Krita on right. The curve was applied on the "Hue" channel instead of the Lightness.

Hi, 

I opened an old (2017) Krita files and saw the color rendering was surprisingly really off. (see attachment ). The artwork uses a Color Adjustement (curves) as a filter layer on the top of the stack.

I guess the issue comes from the fact that in 2017, the Color Adjustment curves didn't had all the channels it has nowadays. 

From what I understand of the bug: 
- in 2017, I modified the 4rth channel, and at that time the fourth was "Lightness" (to adjust the contrast).
- in 2024, with the new Hue and Saturation channel, my curve was applied to the 4rth option: "Hue".  

Files:
====
The artwork (jpg exported from the built in PNG): https://www.peppercarrot.com/en/viewer/misc__2017-04-22_merci_by-David-Revoy.html
Krita KRA source: https://www.peppercarrot.com/0_sources/0ther/misc/zip/2017-04-22_merci_by-David-Revoy.zip
Comment 1 Dmitry Kazakov 2024-12-12 13:08:41 UTC
Git commit 28ba6500890c9d14994a14255cb67bbc3efbf8b1 by Dmitry Kazakov.
Committed on 12/12/2024 at 13:08.
Pushed by dkazakov into branch 'master'.

Fix backward compatibility of Per-Channel filter

In Krita 5.1.0 we added two additional "virtual" channels to the
per-channel filter ("Hue" and "Saturation"). And we added them **not**
to the end of the list, but **before** the "Lightness" channel, which
basically broke all the files created in Krita version before 5.1.0.

The patch manually remaps the channels depending on the number of channels
present in the configuration XML.

M  +68   -8    plugins/filters/colorsfilters/kis_multichannel_filter_base.cpp
M  +22   -0    plugins/filters/colorsfilters/kis_multichannel_utils.cpp

https://invent.kde.org/graphics/krita/-/commit/28ba6500890c9d14994a14255cb67bbc3efbf8b1
Comment 2 Dmitry Kazakov 2024-12-12 13:11:14 UTC
Git commit c94a5e594ed9acc19438acd07bad2b3d97b2658c by Dmitry Kazakov.
Committed on 12/12/2024 at 13:11.
Pushed by dkazakov into branch 'krita/5.2'.

Fix backward compatibility of Per-Channel filter

In Krita 5.1.0 we added two additional "virtual" channels to the
per-channel filter ("Hue" and "Saturation"). And we added them **not**
to the end of the list, but **before** the "Lightness" channel, which
basically broke all the files created in Krita version before 5.1.0.

The patch manually remaps the channels depending on the number of channels
present in the configuration XML.

M  +68   -8    plugins/filters/colorsfilters/kis_multichannel_filter_base.cpp
M  +22   -0    plugins/filters/colorsfilters/kis_multichannel_utils.cpp

https://invent.kde.org/graphics/krita/-/commit/c94a5e594ed9acc19438acd07bad2b3d97b2658c
Comment 3 Dmitry Kazakov 2024-12-12 13:12:10 UTC
Hi, David!

Thank you very much for this report and sample files! The bug was really important and critical, so I fixed it with high priority! :)