Bug 493493 - Color profile not found when importing gradient on some OS, leading to wrong colors
Summary: Color profile not found when importing gradient on some OS, leading to wrong ...
Status: REPORTED
Alias: None
Product: krita
Classification: Applications
Component: Resource Management (other bugs)
Version First Reported In: 5.2.3
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-09-22 17:02 UTC by Robert Moerland
Modified: 2024-09-22 18:25 UTC (History)
0 users

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


Attachments
test gradient that shows up as red when the color profile is not used, and green when it is. (645 bytes, image/svg+xml)
2024-09-22 17:02 UTC, Robert Moerland
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Moerland 2024-09-22 17:02:47 UTC
Created attachment 173968 [details]
test gradient that shows up as red when the color profile is not used, and green when it is.

SUMMARY
I created gradients in the ACEScg-elle-V4-g10 color space, that is shipped with Krita. It turns out that on MacOS and with a Linux AppImage, the color profile is not found and the embedded fallback sRGB colors are used. On Windows, it works regardless of being an installed version or a portable version in a random directory. I expected the color profile to be found in all cases (as it is shipped) and perhaps this is a bug?

STEPS TO REPRODUCE

I have created a 'coal mine canary' gradient, that is defined as solid green in the ACEScg color space, but has sRGB Red as its fallback color. Therefore, importing this gradient and observing the color of the resulting thumbnail tells us whether the color profile was used or not.

Steps in Windows
1. Install or use portable version of Krita
2. Import the gradient with the resource manager.
3. Gradient should show up as green for both the installed version and the portable version
-> This makes me believe that the 'local' field embedded in the SVG file is parsed and the correct color profile is found in the search path of Krita


Steps in MacOS
1. Install Krita
2. Import the gradient with the resource manager.
3. Gradient likely shows up as red
    -> This makes me believe that the correct color profile is *not* found in the search path of Krita
4. Adding the field xlink:href="/Applications/Krita.app/Contents/share/color/icc/krita/ACEScg-elle-V4-g10.icc" to the color-profile tag and re-importing the gradient likely makes it show up in green
   -> Is the path to the *.icc files added to the search path on MacOS?

Steps in Linux
1. Install Krita AppImage
2. Import the gradient with the resource manager.
3. Gradient likely shows up as red
4. Adding the field xlink:href="/Applications/Krita.app/Contents/share/color/icc/krita/ACEScg-elle-V4-g10.icc" to the color-profile tag and re-importing the gradient likely makes it show up in green

OBSERVED RESULT
MacOS and Linux AppImage: gradients fall back to sRGB colors despite using an ICC profile that ships with Krita, unless the path is hardcoded into the SVG gradient.
Windows: gradients are imported correctly, regardless of the absolute location of the ICC profile, but still relative to the Krita main folder.

EXPECTED RESULT
All OS/platforms should import the gradients correctly

SOFTWARE/OS VERSIONS
Windows: 10
macOS: not sure (test performed by user of krita-artists.org, see below)
Linux:  Ubuntu 22.04 LTS (and first reported by other user at krita-artist.org, see below)
Qt Version: 5.15.7

ADDITIONAL INFORMATION
Discussion on krita-artists.org: https://krita-artists.org/t/interference-based-gradients/102328/5
Comment 1 Robert Moerland 2024-09-22 18:25:36 UTC
Erratum for step 4 on Linux:
The path to the correct ICC profile is tmp/.mount_krita-{random}/usr/share/colour/icc/ACEScg-elle-V4-g10.icc on Linux Mint as reported by user AhabGreybeard on krita-artists.org, and is /usr/share/colour/icc/ACEScg-elle-V4-g10.icc for Ubuntu Mate as seen by myself.