GNOME Bugzilla – Bug 737440
EOG - CMYK jpg colors are saturated and not correct
Last modified: 2021-06-19 08:47:04 UTC
Created attachment 287166 [details] attachment showing difference in color between EOG and other CMYK color aware application images (jpg, tiff) with CMYK colors are over saturated and incorrect when viewed from EOG (image viewer). I have added a screenshot for reference. When viewed from CMYK aware application the colors are correctly displayed whereas when the same jpg is viewed in EOG the colors are incorrect.
Hmm, I am not sure, but there could be a little problem with color management here. However as eog gets CMYK images decoded as RGB this might take a bit. Can you attach your sample image for reference?
Created attachment 287201 [details] CMYK jpg with 100% cyan fill
Yes sure, please find the attached image in comment #2. it is filled with 100% cyan, it is the same image which I have shown in the attachment. If it helps I want to add one more detail, the thumbnail that the OS (ubuntu 14.04) creates is also wrong. But this image is shown correctly in other software which support CMYK colorspace. May be which displaying the CMYK image in rgb colorspace EOG is doing wrong conversion.
Created attachment 287204 [details] cyan.jpg converted into pdf for referrence
I converted the same cyan.jpg to pdf with imagemagick and opened it in evince. Evince shows the colors correctly I am attaching the PDF in comment #4 for your reference so that you can quickly see what the original color looks like
Okay, this is practically a matter of applying the included color profile. Eog doesn't apply CMYK color profiles currently as eog already gets pre-converted RGB(A) data from the image decoders. From my understanding we would have to use the ICC profile to do the color conversion instead of the one built-into the image decoder, which is currently not possible. There exists an option that makes color profiling library interpret the RGB data as inverted CMYK, which works with your sample picture. But I am currently not sure how "correct" and portable this is.
From which image decoder are you getting the pre-converted RGB data? I noticed that all Linux image viewers share this same bug and produce the same oversaturated output(except Imagemagick display, which has even weirder output). Only krita, scribus and cinepaint seem to be getting it right. So I had hoped that this was a problem in one library and could be fixed there once for all viewers. I concluded this had to be libjpeg. But now the developers of libjpeg-turbo insist that their library, as well as the original libjpeg, does no conversion CMYK-RGB (discussed here: http://sourceforge.net/p/libjpeg-turbo/mailman/message/33266986/). So which library is used to convert CMYK-RGB for eog? Is this a GTK thing?
I can confirm that all the viewers behave the same with cmyk images, so I guess you are right. I have tried almost all image viewers but haven't found one that shows the color correctly. I have libjpeg8, libjpeg-turbo, libicc2, libcm1, and other color libraries installed. Mine is a ubuntu 14.20 and it has default libraries that came with it. I haven't installed anything extra. Unfortunately i am not a programmer but an artist so finding out which library is used is a bit difficult for, however i can do so with your guidance. I use krita and it does excellent job in showing the correct cmyk colors. I am on their IRC channel I can ask them for more information too.
(In reply to comment #7) > From which image decoder are you getting the pre-converted RGB data? > > I noticed that all Linux image viewers share this same bug and produce the same > oversaturated output(except Imagemagick display, which has even weirder > output). Only krita, scribus and cinepaint seem to be getting it right. So I > had hoped that this was a problem in one library and could be fixed there once > for all viewers. I concluded this had to be libjpeg. > > But now the developers of libjpeg-turbo insist that their library, as well as > the original libjpeg, does no conversion CMYK-RGB (discussed here: > http://sourceforge.net/p/libjpeg-turbo/mailman/message/33266986/). > > So which library is used to convert CMYK-RGB for eog? Is this a GTK thing? eog uses gdk-pixbuf for image decoding, except for SVGs which are rendered using librsvg. gdk-pixbuf abstracts the image decoding away from eog and provides a loader mechanism which allowed adding more formats by including another 'plugin'. But, as it wasn't extended beyond supporting the RGB colorspace (with alpha channel), its JPEG loader automatically does a simple CMYK->RGB conversion. However, this prevents eog from doing a full color correction as the color profile expects CMYK pixel data as input. eog does interface with libjpeg only for losslessly saving rotated JPEG images. Switching to libjpeg for loading as well is currently not undertaken as it will likely require larger architectural changes.
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME/eog/-/issues/ Thank you for your understanding and your help.