Bug 98876 - FILEOPEN: image color is degraded when open pptx file (missing CMYK JPEG support)
Summary: FILEOPEN: image color is degraded when open pptx file (missing CMYK JPEG supp...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 120549 (view as bug list)
Depends on:
Blocks: Format-Filters
  Show dependency treegraph
 
Reported: 2016-03-25 07:44 UTC by dinghao
Modified: 2023-07-24 18:20 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
pptx file, screenshots with both office and libreoffice (6.41 MB, application/x-zip-compressed)
2016-03-25 07:44 UTC, dinghao
Details

Note You need to log in before you can comment on or make changes to this bug.
Description dinghao 2016-03-25 07:44:04 UTC
Created attachment 123819 [details]
pptx file, screenshots with both office and libreoffice

when I open one office pptx file with libreoffice 5.1.1.3,the color of image included in my pptx file seems to be degraded to 256 color depth.I attached related pptx file and screen shots for your reference.
Comment 1 Buovjaga 2016-04-03 14:41:53 UTC
Confirmed.

It seems the PPTX has some kind of color filter applied. We have to find out what it is. There might be a duplicate report, we have to find the keyword.

64-bit, KDE Plasma 5
Build ID: 5.1.1.3 Arch Linux build-2
CPU Threads: 8; OS Version: Linux 4.4; UI Render: default; 
Locale: fi-FI (fi_FI.UTF-8)
Comment 2 Xisco Faulí 2017-03-12 18:34:36 UTC
Reproduced in

LibreOffice 3.3.0 
OOO330m19 (Build:6)
tag libreoffice-3.3.0.4
Comment 3 Regina Henschel 2017-03-17 22:34:07 UTC
It is the image itself, which generates problems. Unpack the pptx file and find the image in ppt/media. Open the image in other application. My old PaintShopPro 5 shows the image in same bright way as LibreOffice, whereas Paint.net shows it same as PowerPoint 2010. The reason is, that the image is 32-bit in CMYK color space.

There a no filter involved, neither in PowerPoint nor in LibreOffice.
Comment 4 Buovjaga 2017-03-18 17:36:00 UTC
(In reply to Regina Henschel from comment #3)
> The reason is, that the image is
> 32-bit in CMYK color space.

Eek, you are right. I can see the CMYK in Krita: Image - Properties, but the color depth is 8-bit.

Regina: what do you think we should do? I could not find a report about general CMYK support. I did find this report about a specific case: bug 102928
Comment 5 Regina Henschel 2017-03-18 22:28:40 UTC
The problems with CMYK images are inherited from OpenOffice.

I'm no image or color space expert, but to my knowledge a color profile would be needed to get a visual correct conversion. But such profile is individual to a special monitor-printer combination. So a general solution can only be a compromise. And you have to keep in mind, that it is not only a problem, how the image looks on the screen, but you have to consider printing and pdf-export as well.
Comment 6 QA Administrators 2018-03-19 03:33:45 UTC Comment hidden (obsolete)
Comment 7 QA Administrators 2020-03-19 02:35:03 UTC Comment hidden (obsolete)
Comment 8 QA Administrators 2022-03-20 03:30:57 UTC Comment hidden (obsolete)
Comment 9 Gabor Kelemen (allotropia) 2023-03-29 16:11:40 UTC
*** Bug 120549 has been marked as a duplicate of this bug. ***
Comment 10 Gabor Kelemen (allotropia) 2023-07-24 17:38:28 UTC
A possible option could be to (re?)use the http://www.openjpeg.org/ library, which seems to me having some level of support for CYMK support[1] since quite some time (2014), and has 2-clauses BSD license[2].

[1] https://github.com/uclouvain/openjpeg/pull/559/files
[2] https://github.com/uclouvain/openjpeg/blob/master/LICENSE

@Tomaz: any thought on this direction?
Comment 11 Buovjaga 2023-07-24 18:10:05 UTC
(In reply to Gabor Kelemen (allotropia) from comment #10)
> A possible option could be to (re?)use the http://www.openjpeg.org/ library,
> which seems to me having some level of support for CYMK support[1] since
> quite some time (2014), and has 2-clauses BSD license[2].
> 
> [1] https://github.com/uclouvain/openjpeg/pull/559/files
> [2] https://github.com/uclouvain/openjpeg/blob/master/LICENSE
> 
> @Tomaz: any thought on this direction?

libjpeg-turbo also supports CMYK, but it leaves colour management as an exercise for the user: https://github.com/libjpeg-turbo/libjpeg-turbo/blob/895287572db62318332a78395a0c07eb86137fd8/turbojpeg.h#L289

"In order to convert between CMYK and RGB, it is necessary to use a color management system (CMS.) A CMS will attempt to map colors within the printer's gamut to perceptually similar colors in the display's gamut and vice versa, but the mapping is typically not 1:1 or reversible, nor can it be defined with a simple formula. Thus, such a conversion is out of scope for a codec library."

In that openjpeg commit I see they use liblcms2, which we also have as a dependency.
Comment 12 Tomaz Vajngerl 2023-07-24 18:20:52 UTC
OpenJPEG is a library for Jpeg2000 images, not JPEG(1). 

What we probably need is iccjpeg [1] and qcms [2] to properly correct.

[1] https://chromium.googlesource.com/chromium/src.git/+/refs/heads/main/third_party/iccjpeg/
[2] https://chromium.googlesource.com/chromium/src.git/+/refs/heads/main/third_party/qcms/