Bug 169563 - xyB Images - wrong colours
Summary: xyB Images - wrong colours
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
Version:
(earliest affected)
25.8.3.2 release
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Format-Filters
  Show dependency treegraph
 
Reported: 2025-11-20 08:39 UTC by DM
Modified: 2026-01-26 00:42 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description DM 2025-11-20 08:39:58 UTC
Description:
Embedding or linking an XYB image (created from XNView jpegli encoder with XYB option) has the colour displayed wrongly.
Saving as PDF likewise, in the current situation it creates PDFs with the colour wrong even in the latest Acrobat Reader, unless there's a way to achieve that it Libreoffice will need to ensure conversion to RGB on Export (maybe with some kind of alert) even if it would normally just embed losslessly.

Steps to Reproduce:
1.Empty document
2.Drag XYB jpeg image in

Actual Results:
Colours greeny

Expected Results:
Normal colours


Reproducible: Always


User Profile Reset: No

Additional Info:
Used the correct colour profile
Comment 1 m_a_riosv 2025-11-20 22:43:59 UTC
Please attach a sample file, reduce the size as much as possible without private information,
and paste the information in Menu/Help/About LibreOffice, there is a copy icon.
Comment 2 DM 2025-11-21 10:19:57 UTC
Here we go, a zip of the odt file with image dragged in, and the image also as a separate item -

https://www.paintdrawer.co.uk/temp/bugxyb169563.zip

Version: 25.8.3.2 (X86_64)
Build ID: 8ca8d55c161d602844f5428fa4b58097424e324e
CPU threads: 8; OS: Windows 11 X86_64 (build 26200); UI render: Skia/Raster; VCL: win
Locale: en-GB (en_GB); UI: en-GB
Calc: CL threaded
Comment 3 m_a_riosv 2025-11-21 14:01:47 UTC
Just importing the image shows the color change.
Reproducible
Version: 26.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 620(Build:0)
CPU threads: 16; OS: Windows 11 X86_64 (build 26200); UI render: Skia/Vulkan; VCL: win
Locale: es-ES (es_ES); UI: en-US
Calc: threaded
Comment 4 V Stuart Foote 2026-01-23 17:51:18 UTC
I don't know that this can be implemented.  ODF has no support for xyB image encoding, and IIANM internally images are always converted to our RGBA BMP.

Filter support for reading in xyB would have to be implemented. Does seem to be Python libs but found nothing worked up for C++ use.

And even if we could filter import image source from xyB, I don't think it would be required to export document content using the format.

@Quikee, has this format come up for adoption, would extension to ODF be needed?
Comment 5 Tomaz Vajngerl 2026-01-26 00:42:24 UTC
The issue here is that we don't apply the ICC profile after importing a JPEG or other images to convert it to sRGB as we should and is expected. There is already a bug (I think from Gabor) that the imported image has different colors, which is the same bug - just not using a profile with xyb colorspace, which is specific to jpegli, but probably something like AdobeRGB profile and the colors come out all wrong. We don't need to extend ODF for this.

We already have lcms2 library as an external library as we probably use it for something else, so we could use that to apply the icc color profile from jpeg images as well, but we probably need iccjpeg to get the icc profile from jpeg images.

Probably this could be a nice GSoC project - I'll write it into the idea page.