Bug 502962

Summary: Color management inconsistency
Product: [Applications] digikam Reporter: David <gardiandavid>
Component: ColorManagement-ViewsAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: caulier.gilles, metzpinguin
Priority: NOR    
Version First Reported In: 8.6.0   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed/Implemented In: 8.7.0
Sentry Crash Report:
Attachments: screenshots of my color management settings
The ICC profile I use for my monitor that is both enabled in Windows and selected in digiKam profile settings

Description David 2025-04-18 11:24:03 UTC
Created attachment 180378 [details]
screenshots of my color management settings

SUMMARY
DigiKam's use of ICC profiles is quite inconsistent. Switching directories or restarting digiKam makes the color management stop working and has to be disabled and re-enabled in the settings. I test this using one of my photos exported from darktable, but mostly ICC test images available here:
https://displaycal.net/icc-color-management-test/

STEPS TO REPRODUCE
1. enable color management
2. open an ICC test image
3. observe if the test image is displayed as expected (if it passes the test)
4. switch opened directory OR restart digiKam
5. color management most likely stopped working (or only for some images) until disabled and re-enabled in settings

OBSERVED RESULT
This is what digiKam often displays - random test images don't pass the test:
https://www.youtube.com/watch?v=ow7BIAeLeB4
By random I mean it is not the same image(s) that fail, and I don't see any pattern. Although the first JPEG almost always fails.

EXPECTED RESULT
All images should always be displayed consistently.

SOFTWARE/OS VERSIONS
Windows: 11 23H2

ADDITIONAL INFORMATION
Display profile that is applied, is my custom profile made using DisplayCAL and applied to an Asus ProArt PA248QV used as a secondary monitor. This problem happens regardless of ICC profile selected in settings.
Comment 1 caulier.gilles 2025-04-18 11:57:42 UTC
ok, so the CM settings is not retained between the digiKam sessions. Right ?

Can you sahre yoi ICC profile file ?

Best

Gilles Caulier
Comment 2 Maik Qualmann 2025-04-18 12:09:22 UTC
At least here on Linux, I can't reproduce the problem using the test images. I'll test it later on Windows.

A note regarding the incorrectly displayed red thumbnail in your YouTube video. The thumbnails are saved with color management or not, depending on whether color management is enabled or disabled. This is done for performance reasons. Therefore, you'll need to regenerate the thumbnails after making changes, e.g., by pressing F5 in the current album or using the maintenance tool.

Maik
Comment 3 David 2025-04-18 12:21:06 UTC
Created attachment 180380 [details]
The ICC profile I use for my monitor that is both enabled in Windows and selected in digiKam profile settings
Comment 4 David 2025-04-18 12:24:15 UTC
(In reply to caulier.gilles from comment #1)
> ok, so the CM settings is not retained between the digiKam sessions. Right ?
Yes, restarting digiKam makes CM stop working, although it is still enabled in the settings. As I said, it often happens after only changing open directory.

> Can you sahre yoi ICC profile file ?
Ok, I added the ICC file.
Comment 5 Maik Qualmann 2025-04-18 13:03:08 UTC
I can reproduce the problem with the first image after launching digiKam. It's related to the Histogram tab in the right sidebar, if it's active at startup. The problem doesn't occur with other active tabs. It's likely related to retrieving the image from the image cache; I'll fix it.

Maik
Comment 6 David 2025-04-18 14:38:45 UTC
(In reply to Maik Qualmann from comment #5)
> I can reproduce the problem with the first image after launching digiKam.
> It's related to the Histogram tab in the right sidebar, if it's active at
> startup. The problem doesn't occur with other active tabs. It's likely
> related to retrieving the image from the image cache; I'll fix it.
> 
> Maik

Nice, thank you!
Comment 7 Maik Qualmann 2025-04-18 18:15:41 UTC
Git commit 7861910af570f88b53ffbd7a26c402234448ef22 by Maik Qualmann.
Committed on 18/04/2025 at 18:14.
Pushed by mqualmann into branch 'master'.

check cached image for color management applied
FIXED-IN: 8.7.0

M  +1    -1    NEWS
M  +20   -0    core/libs/threadimageio/fileio/loadsavetask.cpp
M  +8    -7    core/libs/threadimageio/fileio/loadsavetask.h
M  +5    -0    core/libs/threadimageio/preview/previewtask.cpp

https://invent.kde.org/graphics/digikam/-/commit/7861910af570f88b53ffbd7a26c402234448ef22