Bug 496388 - The image->monitor color conversion doesn't update with flag changes.
Summary: The image->monitor color conversion doesn't update with flag changes.
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Color models (show other bugs)
Version: nightly build (please specify the git hash!)
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-11-17 17:41 UTC by wolthera
Modified: 2024-11-20 15:13 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description wolthera 2024-11-17 17:41:27 UTC
SUMMARY
After some experimentation here (https://krita-artists.org/t/soft-proofing-doesnt-match-converted-image/104157/37), I realized that Krita only updates the monitor color transform after the monitor profile has been changed, but not for intent or any of the flags (lcms optimisation or blackpoint compensation).

From some basic debugging, the issue is that KisCanvas2::slotConfigChanged() calls KisCanvas2::slotScreenChanged which calls KisCanvas2::setDisplayProfile(const KoColorProfile *monitorProfile) and eventually that sets the profile on isDisplayColorConverter::setMonitorProfile(const KoColorProfile *monitorProfile), which also updates all the extra options. However, if the profile didn't change, this last function is never called.

STEPS TO REPRODUCE
1.  Convert any given image (with black sections) to CMYK.
2.  Switch off (or on) blackpoint compensation in settings->color management.
3.  Observe canvas.
4. Change monitor profile in settings->color management.

Turning on or off blackpoint compensation should change whether or not CMYK black is adjusted for or not (CMYK is usually not as black as a monitor, and the profile usually simulates this... blackpoint compensation maps the blacks of two color spaces), so the blacks should change when BP compensation is changed.

OBSERVED RESULT
Blackpoint compensation changes are only in effect when the monitor profile changes.

EXPECTED RESULT
Blackpoint compensation should take effect even when the monitor profile doesn't change.
Comment 1 Bug Janitor Service 2024-11-19 20:28:50 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/2277
Comment 2 Dmitry Kazakov 2024-11-20 14:14:14 UTC
Git commit 26f30c8caec093ea11cce3c8c01ab7bab2c230e3 by Dmitry Kazakov.
Committed on 20/11/2024 at 14:12.
Pushed by dkazakov into branch 'master'.

Fix display profile conversion flags to be updated on settigns change

Basically, our display rendering code should manipulate **not** with the color
profice, but with a triplet {profile, intent, flags}. And when comparing for the settings
change we should check all the three, not just color profile.

The patch implements KisDisplayConfig that abstracts this triplet. Now all display
rendering code manipulates with KisDisplayConfig instead of a raw KoColorProfile.

Think in the future: we might want to rename KisDisplayProfile into something like
KoColorConvertionConfig and use it for color conversions like KoColorSpace::convertTo()
instead of passing all three arguments manually.

M  +1    -0    libs/ui/CMakeLists.txt
A  +61   -0    libs/ui/KisDisplayConfig.cpp     [License: GPL(v2.0+)]
A  +31   -0    libs/ui/KisDisplayConfig.h     [License: GPL(v2.0+)]
M  +7    -14   libs/ui/canvas/kis_canvas2.cpp
M  +3    -4    libs/ui/canvas/kis_canvas2.h
M  +12   -32   libs/ui/canvas/kis_display_color_converter.cpp
M  +4    -5    libs/ui/canvas/kis_display_color_converter.h
M  +3    -2    libs/ui/canvas/kis_prescaled_projection.cpp
M  +2    -2    libs/ui/canvas/kis_prescaled_projection.h
M  +2    -3    libs/ui/canvas/kis_qpainter_canvas.cpp
M  +0    -1    libs/ui/kis_canvas_resource_provider.h
M  +6    -5    libs/ui/kis_clipboard.cc
M  +5    -3    libs/ui/kis_mimedata.cpp
M  +0    -1    libs/ui/kis_selection_decoration.h
M  +11   -6    libs/ui/opengl/KisOpenGLCanvasRenderer.cpp
M  +5    -12   libs/ui/tests/kis_prescaled_projection_test.cpp
M  +15   -14   libs/ui/widgets/kis_scratch_pad.cpp
M  +5    -2    libs/ui/widgets/kis_scratch_pad.h
M  +41   -10   libs/widgetutils/KisScreenMigrationTracker.cpp
M  +7    -0    libs/widgetutils/KisScreenMigrationTracker.h
M  +4    -8    plugins/dockers/channeldocker/ChannelDockerWidget.cpp
M  +3    -7    plugins/dockers/overview/overviewwidget.cc
M  +2    -1    plugins/dockers/smallcolorselector/kis_small_color_widget.cc

https://invent.kde.org/graphics/krita/-/commit/26f30c8caec093ea11cce3c8c01ab7bab2c230e3
Comment 3 Dmitry Kazakov 2024-11-20 15:13:14 UTC
Git commit ab061b1135acf2cccf89e03ccc19057dfddba18b by Dmitry Kazakov.
Committed on 20/11/2024 at 14:56.
Pushed by dkazakov into branch 'krita/5.2'.

Fix display profile conversion flags to be updated on settigns change

Basically, our display rendering code should manipulate **not** with the color
profice, but with a triplet {profile, intent, flags}. And when comparing for the settings
change we should check all the three, not just color profile.

The patch implements KisDisplayConfig that abstracts this triplet. Now all display
rendering code manipulates with KisDisplayConfig instead of a raw KoColorProfile.

Think in the future: we might want to rename KisDisplayProfile into something like
KoColorConvertionConfig and use it for color conversions like KoColorSpace::convertTo()
instead of passing all three arguments manually.

M  +1    -0    libs/ui/CMakeLists.txt
A  +61   -0    libs/ui/KisDisplayConfig.cpp     [License: GPL(v2.0+)]
A  +31   -0    libs/ui/KisDisplayConfig.h     [License: GPL(v2.0+)]
M  +7    -14   libs/ui/canvas/kis_canvas2.cpp
M  +3    -4    libs/ui/canvas/kis_canvas2.h
M  +12   -32   libs/ui/canvas/kis_display_color_converter.cpp
M  +4    -5    libs/ui/canvas/kis_display_color_converter.h
M  +3    -2    libs/ui/canvas/kis_prescaled_projection.cpp
M  +2    -2    libs/ui/canvas/kis_prescaled_projection.h
M  +2    -3    libs/ui/canvas/kis_qpainter_canvas.cpp
M  +0    -1    libs/ui/kis_canvas_resource_provider.h
M  +6    -5    libs/ui/kis_clipboard.cc
M  +5    -3    libs/ui/kis_mimedata.cpp
M  +0    -1    libs/ui/kis_selection_decoration.h
M  +11   -6    libs/ui/opengl/KisOpenGLCanvasRenderer.cpp
M  +5    -12   libs/ui/tests/kis_prescaled_projection_test.cpp
M  +15   -15   libs/ui/widgets/kis_scratch_pad.cpp
M  +5    -2    libs/ui/widgets/kis_scratch_pad.h
M  +41   -10   libs/widgetutils/KisScreenMigrationTracker.cpp
M  +7    -0    libs/widgetutils/KisScreenMigrationTracker.h
M  +4    -9    plugins/dockers/channeldocker/channeldocker_dock.cpp
M  +3    -7    plugins/dockers/overview/overviewwidget.cc
M  +2    -1    plugins/dockers/smallcolorselector/kis_small_color_widget.cc

https://invent.kde.org/graphics/krita/-/commit/ab061b1135acf2cccf89e03ccc19057dfddba18b