Bug 339345

Summary: Palette Colors in Krita are not color managed
Product: [Applications] krita Reporter: ernest.lee
Component: Color modelsAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: halla
Priority: NOR    
Version: 2.9 Beta   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
URL: http://lts.cr/sd/1Ma7
Latest Commit: Version Fixed In:
Attachments: Copic_358_ColorChart
Slightly different palettes

Description ernest.lee 2014-09-24 02:27:32 UTC
Palette aco has cmyk colors.

Suspected problem: Krita directly loads the cmyk values in the aco file into a cmyk color, but assumes it is srgb therefore it gives the incorrect color.

Test case A works correctly:

1. Create a cmyk document
2. Draw a color from aco palette http://lts.cr/sd/5SS4
3. Export the document to psd
4. Load document in photoshop
5. Draw a color from the aco palette
6. Compare with color in document
7. Color is the same

Note: I tried to export tiffs or pdfs and comparing, but the colors were incorrect. So I'm using photoshop...

Reproducible: Always

Steps to Reproduce:
1. Create a rgb document
2. Draw a color from aco palette http://lts.cr/sd/5SS4
3. Export the document to psd
4. Load document in photoshop
5. Draw using the palette in photoshop.
6. Compare with color in document

Actual Results:  
The two patches have different colours.

Expected Results:  
The two patches should have the same colour.

On Windows 8.1
Comment 1 ernest.lee 2014-09-24 02:44:32 UTC
Created attachment 88824 [details]
Copic_358_ColorChart
Comment 2 ernest.lee 2014-09-24 02:48:21 UTC
Created attachment 88825 [details]
Slightly different palettes
Comment 3 ernest.lee 2014-09-24 03:01:37 UTC
You expect the palette to give the exact color when you use it, but in another color space.

Note: this does not work when you convert color spaces for the entire document.
Comment 4 Halla Rempt 2014-11-05 12:12:57 UTC
Hm, we do load the cmyk aco palettes as cmyk colors in KoColorSet.cpp, 491-498:

 else if (colorSpace == 2) { // CMYK
            e.color = KoColor(KoColorSpaceRegistry::instance()->colorSpace(CMYKAColorModelID.id(), Integer16BitsColorDepthID.id(), ""));
            reinterpret_cast<quint16*>(e.color.data())[0] = quint16_MAX - ch1;
            reinterpret_cast<quint16*>(e.color.data())[1] = quint16_MAX - ch2;
            reinterpret_cast<quint16*>(e.color.data())[2] = quint16_MAX - ch3;
            reinterpret_cast<quint16*>(e.color.data())[3] = quint16_MAX - ch4;
            e.color.setOpacity(OPACITY_OPAQUE_U8);
        }

 What can happen, I guess, is that Photoshop uses a different way to convert the cmyk color to rgb. I'm not yet sure what I can do here.
Comment 5 Halla Rempt 2015-06-26 11:56:16 UTC
I'm guessing, but it's undocumented, that photoshop doesn't color manage the colors in its palettes.
Comment 6 Halla Rempt 2017-11-27 10:28:46 UTC
Palette files are now color managed, but ACO files aren't. So, without knowing what CMYK profile was intended for an ACO file, there will still be issues with color reproduction.