Bug 487103 - EXR with XYZ channels are incorrectly visualized
Summary: EXR with XYZ channels are incorrectly visualized
Status: REOPENED
Alias: None
Product: krita
Classification: Applications
Component: File formats (show other bugs)
Version: 5.2.2
Platform: Microsoft Windows Other
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-16 12:56 UTC by CodingInProgress
Modified: 2024-07-04 09:24 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
EXR file with XYZ channels, which are incorrectly visualized in Krita (18.62 KB, image/x-exr)
2024-05-16 12:56 UTC, CodingInProgress
Details

Note You need to log in before you can comment on or make changes to this bug.
Description CodingInProgress 2024-05-16 12:56:37 UTC
Created attachment 169530 [details]
EXR file with XYZ channels, which are incorrectly visualized in Krita

SUMMARY
EXR files with XYZ channels are not visualized correctly. I would assume that the XYZ channels were converted directly to RGB, which is what happens for instance in Blender.

STEPS TO REPRODUCE
1. Open the attached file

OBSERVED RESULT
The word 'Green' is shown in white.

EXPECTED RESULT
- Top left, word 'Red' is stored in 'X' channel
- Middle right, word 'Green' is stored in 'Y' channel
- Bottom left, word 'Blue' is stored in 'Z' channel
The expected result is to see the word 'Red' in red (X channel gets converted to R channel), and the same for the other channels.

SOFTWARE/OS VERSIONS
Windows: 11
Qt Version: 5.15.7

ADDITIONAL INFORMATION
I originally reported it to Blender, but it turns out that it seems to be a Krita bug.
https://projects.blender.org/blender/blender/issues/121841
Comment 1 Halla Rempt 2024-07-04 09:04:50 UTC
Maybe the actual problem is that Krita infers that the image is RGB, while the layer is loaded as XYZ.

https://invent.kde.org/graphics/krita/-/merge_requests/2182?commit_id=ca7b914a8a9d7e0ab384a40fd80c80d9014a47fb has a partial fix. The problem is that in the layer thumbnail blue and red still are not visible, but they become visible on a round-trip converting the layer to rgb and then back.

The thumbnail in the recent files screen also shows only green, but in gray.

When saving the image after round-tripping, it's needed to also convert the image colorspace to xyz, since we cannot apparently save an exr image with layers in a different colorspace from the image, which I thought was possible.
Comment 2 Halla Rempt 2024-07-04 09:07:01 UTC
Git commit ca7b914a8a9d7e0ab384a40fd80c80d9014a47fb by Halla Rempt, on behalf of Rasyuqa A. H..
Committed on 04/07/2024 at 08:36.
Pushed by rempt into branch 'master'.

EXR: Import: add XYZ to top level channel names

M  +9    -3    plugins/impex/exr/exr_converter.cc

https://invent.kde.org/graphics/krita/-/commit/ca7b914a8a9d7e0ab384a40fd80c80d9014a47fb
Comment 3 Halla Rempt 2024-07-04 09:24:51 UTC
So, while there's a partial fix, there still are problems, so let's keep this bug open.