Bug 354542 - Show proper CMYK colors embedded in files like Krita
Summary: Show proper CMYK colors embedded in files like Krita
Status: CONFIRMED
Alias: None
Product: gwenview
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Gwenview Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-29 08:57 UTC by Raghavendra kamath
Modified: 2020-01-06 17:18 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
sample CMYK tiff (570.29 KB, image/tiff)
2015-10-29 08:58 UTC, Raghavendra kamath
Details
Sample CMYK jpg (548.86 KB, image/jpeg)
2015-10-29 09:00 UTC, Raghavendra kamath
Details
Screenshot showing different colors (322.92 KB, image/png)
2018-04-14 04:50 UTC, Raghavendra kamath
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Raghavendra kamath 2015-10-29 08:57:24 UTC
I would like to request a CMYK (or any embedded color profile) view support for gwenview. Now if the jpg or tiff has embedded CMYK color it shows the color over saturated and incorrect. you can chk the difference in the image while viewed in krita and gwenview in the screenshot here ->
https://dl.dropboxusercontent.com/u/37777793/krita/gwenview-cmyk.png

Krita shows the colors correctly. I know that to show CMYK correctly we have to convert it to screen rgb and color shown are just approximate. 
As an artist working in comic industry and sending tiff, png or jpg files to client I often have to open such files and opening them in krita just for viewing is a bit overkill, I would like to browse images from gwenview, hence a humble request for this feature.

you can get the sample jpg and tiff with embedded CMYK profile here -> 
https://dl.dropboxusercontent.com/u/37777793/krita/sample-cmyk-cyan.jpg
https://dl.dropboxusercontent.com/u/37777793/krita/sample-cmyk-cyan.tiff

I am also attaching the samples to this bug report for your convenience.

I am using gwenview Version 15.08.2 on arch with latest packages

thank you

Reproducible: Always
Comment 1 Raghavendra kamath 2015-10-29 08:58:17 UTC
Created attachment 95202 [details]
sample CMYK tiff
Comment 2 Raghavendra kamath 2015-10-29 09:00:35 UTC
Created attachment 95203 [details]
Sample CMYK jpg
Comment 3 Huon 2018-04-13 04:01:20 UTC
I can't reproduce, CMYK seems to be rendering correctly in Gwenview.

I found https://phabricator.kde.org/R260:bfc55ac46375070b705402ecc16dfb989134e78c which seemed to fix this in 2008.

Raghavendra if you're still around, are you still having this problem?
Comment 4 null 2018-04-13 13:43:08 UTC
> I can't reproduce, CMYK seems to be rendering correctly in Gwenview.
Try opening the images in Gwenview, Krita, Firefox and Chromium. For me they look different, possibly because of varying levels of support for the embedded colour profile "exiftool" tells me about.

> which seemed to fix this in 2008
But the bug was reported for 15.08.2, which is from 2015, so it should include the fix already, shouldn't it? ;)
Comment 5 Huon 2018-04-13 22:53:23 UTC
(In reply to Henrik Fehlauer from comment #4)
> > I can't reproduce, CMYK seems to be rendering correctly in Gwenview.
> Try opening the images in Gwenview, Krita, Firefox and Chromium. For me they
> look different, possibly because of varying levels of support for the
> embedded colour profile "exiftool" tells me about.

I didn't test with enough applications obviously :(. So I tried the jpg in Chromium, Firefox, qutebrowser, Gwenview, KolorPaint, Krita. All looked 'cyan' except for Chromium and Krita, which looked 'blue'.
So all the 'cyan' ones are wrong? Quite surprising if so.
Comment 6 Raghavendra kamath 2018-04-14 04:44:49 UTC
Hi Huon

I am now using Version 17.12.3 and the bug is still reproducible.

> All looked 'cyan' except for Chromium and Krita, which looked 'blue'. So all the 'cyan' ones are wrong? Quite surprising if so.

Yes the aqua blue image you are seeing is wrong one. Krita and chromium are showing correct colors.

I'll attach a recent screen shot since my original screenshots are deleted.
Comment 7 Raghavendra kamath 2018-04-14 04:50:55 UTC
Created attachment 112020 [details]
Screenshot showing different colors

The screenshot shows the jpg in gwenview on left and in krita on right. I have highlighted the color profile information in Krita
Comment 8 Huon 2018-04-14 23:08:17 UTC
(In reply to Raghavendra kamath from comment #7)
> Created attachment 112020 [details]
> Screenshot showing different colors
> 
> The screenshot shows the jpg in gwenview on left and in krita on right. I
> have highlighted the color profile information in Krita

Thanks for the extra info. I'll tackle this soon.
Comment 9 Huon 2018-04-17 06:22:03 UTC
So I looked into this. Seems like it's beyond me right now. Qt (QImage) obviously doesn't support proper CMYK support, so we'd have to do things manually. And my lack of knowledge in this area means I wouldn't know where to start with that.

Plus I'm not sure if I really understand the problem - Gwenview displays pure cyan correctly. But I'm guessing what Krita and Chromium do is display the closest possible color to what you'd see when printing?

Anyway, afraid to say I'm not able to fix this right now.
Comment 10 null 2018-04-18 21:28:56 UTC
> I'm not able to fix this right now.
It's okay, thanks for trying ;) Maybe someone else will eventually pick up the bug.

https://en.wikipedia.org/wiki/Channel_(digital_image)#CMYK_color_sample
is a bit sparse, but perhaps there are other resources with more information.

> I'm guessing what Krita and Chromium do
Don't forget that you can look at the source. Also Krita folks are quite approachable, you could try asking them how they did things.

> we'd have to do things manually
Maybe something can be done via KImageFormats?
Comment 11 Christoph Feck 2018-05-02 01:14:41 UTC
The CMYK->RGB conversion formulars are likely wrong, probably copied from old Qt versions.
Comment 12 Huon 2018-05-02 01:28:06 UTC
(In reply to Christoph Feck from comment #11)
> The CMYK->RGB conversion formulars are likely wrong, probably copied from
> old Qt versions.

Gwenview doesn't use any explicit formulas. So unless QColor::fromCmyk(), and the countless CMYK - RGB conversion formulas and charts available on the internet are wrong, then this isn't the case.

As far as I found out, this is due to lack of color management.
Comment 13 Raghavendra kamath 2018-05-02 03:56:57 UTC
If you want to get more insight about Krita's color management, you can ping boud or wolthera on #krita (freenode),  I am sure that they'll help.
Comment 14 Raghavendra kamath 2019-12-13 04:36:53 UTC
Apart from CMYK support , there seems to be lack of color management too. Incidentally "Showfoto" from digikam has color management (RGB Only) May be we can check how it works?
Comment 15 Fahad Al-Saidi 2020-01-06 17:18:55 UTC
Okular has the same problem.