Bug 406710

Summary: For HDR kra files, mergedimage.png and preview.png are in SDR and have wrong colors
Product: [Applications] krita Reporter: Tiar <tamtamy.tymona>
Component: HDRAssignee: Krita Bugs <krita-bugs-null>
Status: CONFIRMED ---    
Severity: normal CC: alvin, griffinvalley
Priority: NOR    
Version: nightly build (please specify the git hash!)   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Image preview test image

Description Tiar 2019-04-20 15:38:07 UTC
Created attachment 119530 [details]
Image preview test image

SUMMARY
When you save a HDR .kra file, next time you open Krita and look at Last Documents, you see it all wrong. It's because it shows the content of mergedimage.png or preview.png (not sure which), which is automatically converted to SDR.



STEPS TO REPRODUCE
1. Make a new HDR image.
2. Save as .kra file.
3a. Open Krita, look at Last Documents on welcome screen.
3b. Open as an archive, extract mergedimage.png and preview.png. Open them in Krita.


OBSERVED RESULT
Last Documents shows miniatures with wrong colors.
Both images are in SDR and have wrong colors. (Some colors get lost while converting from float to integer.)


EXPECTED RESULT
Images in Last Documents are displayed correctly, in HDR.
mergedimage.png is in HDR or at least has float color space assigned, so the colors won't be horribly wrong when displayed.


SOFTWARE/OS VERSIONS
Version: 4.2.0-pre-alpha (git fb08951)
Windows: 10
Qt Version: 5.12.2
Comment 1 wolthera 2019-04-20 15:55:29 UTC
the original reason these are converted to sRGB was because of a request from David Revoy, and after that it also turned out stuff like shell-extensions and image previewer cannot be expected to handle sRGB properly.

We'll need a good lutbaking workflow for this.
Comment 2 Alvin Wong 2019-04-20 16:18:35 UTC
I would really suggest to not change the existing behaviour and use another file for a flattened HDR image (perhaps with colour profile includd). We should avoid breaking existing tools/shell extensions which makes use of preview.png and mergedimage.png. The existing tools may not support loading such images.