Bug 406698 - Transform Tool has SDR preview on HDR image
Summary: Transform Tool has SDR preview on HDR image
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: HDR (show other bugs)
Version: nightly build (please specify the git hash!)
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
: 428605 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-04-20 09:44 UTC by Tiar
Modified: 2021-05-21 11:23 UTC (History)
5 users (show)

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


Attachments
Test file for Transform Tool (440.85 KB, application/x-krita)
2019-04-20 09:44 UTC, Tiar
Details
Layer preview test image (947.85 KB, application/x-krita)
2019-04-20 15:42 UTC, Tiar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tiar 2019-04-20 09:44:05 UTC
Created attachment 119524 [details]
Test file for Transform Tool

SUMMARY
When using Transform Tool on HDR canvas, the preview doesn't show the real colors but a very bright version of them. If the color is bright enough, the preview can go up to white, and if the area is big, it can possibly hurt one's eyes.



STEPS TO REPRODUCE
1. Create a new HDR image (I used elle-g10 profile) in 16bit float.
2. Paint with some not too dark colors.
(You can use attached image as a test image - it will change the colors from dark orange to very bright reddish orange)
3. Use Transform Tool on it.

OBSERVED RESULT
The preview is much brighter than the actual colors.

EXPECTED RESULT
The preview shows the same colors as the image.



SOFTWARE/OS VERSIONS
Krita version: 4.2.0-pre-alpha (git fb08951)
Windows: 10
Qt Version: 5.12.2
Comment 1 Tiar 2019-04-20 15:42:38 UTC
Created attachment 119531 [details]
Layer preview test image

Other places where similar conversion takes place: 

- layer preview, I think both in Layers docker and when you hold your cursor over the layer preview in Layers docker
- color picker showing previous color and the new one that is being picked
- "last opened documents" on welcome screen shows it wrong too - it is caused by mergedimage.png and preview.png being converted to SDR while saving (see bug #406710).
Comment 2 Tiar 2019-04-24 10:32:55 UTC
- history of colors and colors from the image are also rendered converted to SDR.  I know Advanced Color Selector doesn't work with HDR, but those colors around it are useful (and work correctly, at least the history; show a wrong color, but choose the correct one as you can see in Small Color Selector).
Comment 3 Tiar 2019-05-05 19:21:54 UTC
There are two ways of showing colors converted to SDR values:
A. clipped to 80 nits
B. in full glory of HDR brightness

Issues mentioned above are using the following way:
1. preview of the Transform Tool: method B.
2. layer preview: method A.
3. color picker: method B.
4. image preview in Last Documents: method A.
5. history of colors: method A.

Method B is worse, because it often causes very bright colors to appear in big amounts, which is not desireable.
Comment 4 Tiar 2019-05-12 12:03:24 UTC
- Overview docker also shows the image in SDR (behavior A)
Comment 5 Tiar 2019-09-04 12:24:43 UTC
7. Palettes - behaviour A
Comment 6 Sree 2019-09-07 19:54:32 UTC
(In reply to Tymond from comment #3)
> There are two ways of showing colors converted to SDR values:
> A. clipped to 80 nits
> B. in full glory of HDR brightness
> 
> Issues mentioned above are using the following way:
> 1. preview of the Transform Tool: method B.
> 2. layer preview: method A.
> 3. color picker: method B.
> 4. image preview in Last Documents: method A.
> 5. history of colors: method A.
> 
> Method B is worse, because it often causes very bright colors to appear in
> big amounts, which is not desireable.

Glad to see color picker problem mentioned here. But I'm confused. 
If I draw a very bright white and use color picker(color selector) tool to pick it, it picks a very dim white. Is this what you are mentioning here?
Comment 7 Tiar 2019-10-05 15:30:43 UTC
(In reply to Sree from comment #6)
> Glad to see color picker problem mentioned here. But I'm confused. 
> If I draw a very bright white and use color picker(color selector) tool to
> pick it, it picks a very dim white. Is this what you are mentioning here?

No. Color picker is something different from color selector: color picker is the pipette tool, color selector is the color wheel. It picks the right color, it just draws it wrong in the on-canvas little popup boxes. And it will nearly always be much brighter than the picked color, especially light colors like light grey or white. This bug report is also only related to HDR displays.

Your issue is most probably related to misconfiguration of color management, to get help please go to the official Krita forum: https://forum.kde.org/viewforum.php?f=136 or on reddit: https://reddit.com/r/krita . Most probable fix: Configure Krita -> Advanced Color Selector -> make sure "Color selector uses a different color space than image" is *unchecked*.
Comment 8 Tiar 2019-10-11 14:21:22 UTC
Git commit 32ab64c90109672c6b363c996d236a203516ab95 by Agata Cacko.
Committed on 11/10/2019 at 14:20.
Pushed by tymond into branch 'master'.

Fix transparency checkers looked white on HDR display

On HDR displays before this commit transparency checkers
looked white because it was just a SDR image showed in
full HDR glory. Hence both light and darker light grey
checkers looked just bright white, no different from each
other, even though in fact their colors were different.
This commit fixes this behaviour by converting the colors
properly from SDR/sRGB to Rec2020-pq (or other display format)
as it should be done.
Related: bug 407238

M  +24   -14   libs/ui/opengl/kis_opengl_image_textures.cpp

https://invent.kde.org/kde/krita/commit/32ab64c90109672c6b363c996d236a203516ab95
Comment 9 Tiar 2019-10-11 14:21:23 UTC
Git commit 5b53507f5abf544e9e33ad9aaf10073e1121a332 by Agata Cacko.
Committed on 11/10/2019 at 14:20.
Pushed by tymond into branch 'master'.

Fix background color conversion

Background color should be converted using the monitor profile
instead of display converter.

M  +12   -6    libs/ui/opengl/kis_opengl_canvas2.cpp
M  +5    -0    libs/ui/opengl/kis_opengl_image_textures.cpp
M  +1    -0    libs/ui/opengl/kis_opengl_image_textures.h

https://invent.kde.org/kde/krita/commit/5b53507f5abf544e9e33ad9aaf10073e1121a332
Comment 10 Tiar 2019-12-11 12:51:33 UTC
Git commit 275cf87b66d93cd5ab13b9ea87ac920508666cab by Agata Cacko.
Committed on 10/12/2019 at 18:53.
Pushed by tymond into branch 'krita/4.2'.

Fix transparency checkers looked white on HDR display

On HDR displays before this commit transparency checkers
looked white because it was just a SDR image showed in
full HDR glory. Hence both light and darker light grey
checkers looked just bright white, no different from each
other, even though in fact their colors were different.
This commit fixes this behaviour by converting the colors
properly from SDR/sRGB to Rec2020-pq (or other display format)
as it should be done.
Related: bug 407238

M  +24   -10   libs/ui/opengl/kis_opengl_image_textures.cpp

https://invent.kde.org/kde/krita/commit/275cf87b66d93cd5ab13b9ea87ac920508666cab
Comment 11 Tiar 2019-12-11 12:51:33 UTC
Git commit ab0d7595fd21db5d5988a46770382934a070a2d9 by Agata Cacko.
Committed on 10/12/2019 at 18:55.
Pushed by tymond into branch 'krita/4.2'.

Fix background color conversion

Background color should be converted using the monitor profile
instead of display converter.

M  +12   -6    libs/ui/opengl/kis_opengl_canvas2.cpp
M  +5    -0    libs/ui/opengl/kis_opengl_image_textures.cpp
M  +1    -0    libs/ui/opengl/kis_opengl_image_textures.h

https://invent.kde.org/kde/krita/commit/ab0d7595fd21db5d5988a46770382934a070a2d9
Comment 12 Dmitry Kazakov 2021-05-21 11:22:38 UTC
*** Bug 428605 has been marked as a duplicate of this bug. ***
Comment 13 Dmitry Kazakov 2021-05-21 11:23:20 UTC
Transform tool can now do in-stack preview. It solves the problem of HDR support in the tool.