Bug 72146 - CMYK conversion incorrect? RGB does not match. Missing color profile?
Summary: CMYK conversion incorrect? RGB does not match. Missing color profile?
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
Version:
(earliest affected)
4.0.6.2 release
Hardware: x86 (IA32) All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 94211 (view as bug list)
Depends on:
Blocks: Area-Fill-Tab Color-Palettes
  Show dependency treegraph
 
Reported: 2013-11-29 09:35 UTC by Martin Trautmann
Modified: 2021-04-11 16:33 UTC (History)
9 users (show)

See Also:
Crash report or crash signature:


Attachments
green CMYK color (102 bytes, text/plain)
2013-11-29 09:35 UTC, Martin Trautmann
Details
Screenshots of LOv4142 and GIMPv268 (the later with various colour profiles in effect). (187.18 KB, application/zip)
2014-01-24 10:40 UTC, Owen Genat (retired)
Details
Original logo CMYK (700.98 KB, image/jpeg)
2017-09-29 10:15 UTC, Frédéric MASSOT
Details
Screenshot, comparative colors between Gimp and Writer for original logo CMYK. (233.71 KB, image/png)
2017-09-29 10:17 UTC, Frédéric MASSOT
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Trautmann 2013-11-29 09:35:29 UTC
Created attachment 89984 [details]
green CMYK color

When I edit the color palette via the LibreOffice Preferences the colors look far off.

Example: when I use CMYK 100-0-100-0 (percent values) I do expect a dark green. Instead this becomes a very bright green with RGB 0-255-0.

When I do the same in other programs the color is more what I do expect. 
Gimp would convert CMYK 100-0-100-0 to RGB 0-153-74,
Apple ColorSync Utility converted to RGB 0-166-108.

I suppose that conversion might require color profiles which do an optimum conversion. The LibreOffice conversion is too simple or just wrong?
Comment 1 Julien Nabet 2013-11-29 22:28:11 UTC
Martin: I'm not a color expert but gave a try to some websites and got the same value as LO.
http://easycalculation.com/colorconverter/rgb-color-converter.php
http://www.rapidtables.com/convert/color/cmyk-to-rgb.htm
http://www.ginifab.com/feeds/pms/cmyk_to_rgb.php
Now I don't know if these may be wrong or not.
Reading http://en.wikipedia.org/wiki/CMYK_color_model, it seems there's no a simple way to convert CMYK towards RGB.
You talked about Gimp but I thought Gimp wouldn't provide CMYK

Michael: I thought you might help here. Any idea?
Comment 2 Michael Natterer 2013-11-29 23:10:36 UTC
If you have no profile, any CMYK conversion is entirely pointless.
It probably uses a naive formula that is never right in real life.

I suspect you are trying CMYK colors because some print shop told
you to give them a CMYK document. Did they also give you THEIR color
profile? If they didn't, don't use them. They have no clue whatsoever
and want to free themselves of any responsibility for correct color
reproduction.

A proper print shop takes your RGB document (which you can properly
edit on an RGB display), do the CMYK conversion using their professional
knowledge, give you a proof print and print it JUST LIKE THAT after
you approved.

Also, does LibreOffice support profiles at all?
Comment 3 Julien Nabet 2013-11-30 00:23:14 UTC
Thank you Michael for your feedback. According to this:
http://opengrok.libreoffice.org/xref/core/offapi/com/sun/star/rendering/ColorProfile.idl#26
It seems there's no ICC implemented but perhaps I missed something

Caolán: since ICC are related with the rendering, I thought about vcl part, any idea?
Comment 4 Caolán McNamara 2013-12-05 11:04:16 UTC
We do have lcms2 in the build and we do splat out "emit the sRGB standard profile, in ICC format, in a stream, per IEC61966-2.1" into our pdf files as a dump.

We don't make any other use of this stuff as far as I can see so.
Comment 5 Julien Nabet 2014-01-23 21:10:35 UTC
Martin: because of the bug put in See Also, Magenta and Yellow values are switched.
Could you try "100, 100, 0, 0" instead of "100, 0, 100, 0" ? But even in this case, I got a dark blue and not dark green.
Comment 6 Owen Genat (retired) 2014-01-24 10:40:16 UTC
Created attachment 92720 [details]
Screenshots of LOv4142 and GIMPv268 (the later with various colour profiles in effect).

I can probably confirm this bug as an enhancement to get colour profile support more widely included in LO (currently only sRGB for PDF export as indicated in comment #3 and comment #4). Under Ubuntu 10.04 x86_64 if I install these packages:

- gnome-color-manager (which pulls in the argyll package)
- icc-profiles

... a variety of ICC profiles will be installed under /usr/share/color/icc/ allowing GIMP to be used in different colour spaces (Edit > Proferences > Color Management > select CMYK profile). 

The attached screenshots likely indicate what the reporter is seeing. For example, when the CMYK profile is set to use the "ISO coated" profile, the result for CMYK 100-0-100-0 is RGB 0-157-80. For "ISO uncoated" RGB 0-158-66. For "ISO webcoated" RGB 0-161-66, and so on. Tested using GIMP v2.6.8. Screenshot from LO v4.1.4.2 Build ID: 0a0440ccc0227ad9829de5f46be37cfb6edcf72 included for comparison. Note: These examples are not intended as accurate representations (I am not running any matching video card adjustment).
Comment 7 QA Administrators 2014-08-04 16:17:53 UTC Comment hidden (obsolete)
Comment 8 QA Administrators 2014-09-03 12:05:32 UTC Comment hidden (obsolete)
Comment 9 Buovjaga 2015-09-21 07:02:28 UTC
According to comment 6 this should have been set to NEW.
Comment 10 Buovjaga 2015-09-21 07:03:01 UTC
*** Bug 94211 has been marked as a duplicate of this bug. ***
Comment 11 Gérald Maruccia 2016-09-17 11:13:35 UTC
…so what have been done since regarding rgb / cmyk in LibreOffice ?
Comment 12 Heiko Tietze 2017-03-09 13:37:34 UTC
Because of the buggy conversion of RGB to CMYK, access to the latter is now (5.3) possible only in the color picker. AFAIR the issue was restricted to the former area style dialog and not the picker. So I'd say it's fixed. But that should be verified => NEEDINFO.
Comment 13 QA Administrators 2017-09-29 08:58:15 UTC Comment hidden (obsolete)
Comment 14 Frédéric MASSOT 2017-09-29 10:14:16 UTC
Hi,

I have new tested with Debian LibreOffice 5.4.1-1 and with the file sent with the bug report 94211 (marked as duplicated). The colors of the image in LibreOffice are not good.

I opened the JPEG file in Gimp and the image in a Writer document. You can see the difference in color. The screenshot is attached.

Regards.
Comment 15 Frédéric MASSOT 2017-09-29 10:15:01 UTC
Created attachment 136614 [details]
Original logo CMYK
Comment 16 Frédéric MASSOT 2017-09-29 10:17:39 UTC
Created attachment 136616 [details]
Screenshot, comparative colors between Gimp and Writer for original logo CMYK.
Comment 17 Heiko Tietze 2017-09-29 12:19:09 UTC
Christoph, may I ask you for an advice. On my system (Linux, LXQt) the image has a more blueish pink compared to Gimp. That's true for Firefox, Gwenview, Libreoffice - all look similar but not like Gimp. What's the truth here? Or rather who should we follow.
Comment 18 Frédéric MASSOT 2017-09-29 13:51:15 UTC
Hi, 

The file opened in Gimp has the correct color.

Regards.
Comment 19 V Stuart Foote 2017-09-29 16:16:53 UTC
This really is an import filter issue, not about working in CMYK which as noted we can't do, and on export to PDF we specify the sRGB.icc (comment 4). Frankly for UX the CMYK on the color picker is not very useful and should probably be dropped--I think that was gist of comment 2.

So, this is mostly about the graphics filter mishandling CMYK colorspace images on insert into a sRGB color space, with poor results.  

For what it is worth, the ImagMagick 'convert' utility done without a -profile spec produces the same sRGB hue as LibreOffice's existing import.

IIUC, a source image will often identify its color profile, and some image formats will fully embed it.  So thinking out loud, while filter inserting a CMYK color space image, could we pull out the color profile if specified, and if one of the "well known" ICC profiles, e.g. supporting PDF/A-1, then use that to control import conversion of the image to our sRGB.icc compliant color space?
 
=-ref-=
http://www.color.org/chardata/drsection1.xalter

http://www.color.org/srgbprofiles.xalter

http://www.imagemagick.org/Usage/formats/#profiles

https://www.pdfa.org/wp-content/until2016_uploads/2011/08/tn0002_color_in_pdfa-1_2008-03-14.pdf
Comment 20 Frédéric MASSOT 2017-09-29 17:01:36 UTC
Hi,

I just tested the display of the CMYK image on a Windows 10. The colors of the image are good with Word, Powerpoint, Paint, IE11 and Edge, the image icon on the desktop has the right colors. Colors are not good with Writer, Firefox and Chrome.

On my workstation, Debian Buster and Mate Desktop, the image icon on the desktop does not have the right colors. The colors are not good with Eye of Mate, Eye of Gnome, Firefox and Chromium. They are only good colors with Gimp.

Regards.
Comment 21 Heiko Tietze 2018-01-11 10:45:06 UTC Comment hidden (no-value)