https://bugs.kde.org/show_bug.cgi?id=527521

            Bug ID: 527521
           Summary: Color picking via Screenshot portal is broken for
                    color managed applications
    Classification: Plasma
           Product: kwin
      Version First 6.7.5
       Reported In:
          Platform: Neon
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: colour-management
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
  Target Milestone: ---

DESCRIPTION

I have finally fixed portal-based color picking in Krita (via
org.freedesktop.portal.Screenshot), and found out that KWin returns the picked
color is a wrong color space. It returns color encoded with gamma-2.2, while
the specification says it should be encoded as sRGB [0].

[0] -
https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.Screenshot.html

STEPS TO REPRODUCE
1. Download the nightly AppImage of Krita:
https://cdn.kde.org/ci-builds/graphics/krita/master/linux/
2. Run with `QT_QPA_PLATFORM=wayland` to enable Wayland color management. Make
sure that color management is enabled in the settings.
3. Draw a blob of some dark color, e.g. 30,30,30
4. Click on the top-left color swatch on the dual-color button at the toolbar
to open the color selector dialog
5. Press the color-picker button to use global desktop color picking and pick
the painted blob

OBSERVED RESULT

6. The color is picked as (34,34,34)
7. If you try to paint with it, it will be brighter than the original, which
basically makes such color picking useless for painters

EXPECTED RESULT

6. The color is picked as (30,30,30)
7. Painting with this color looks the same as the original color blob

NOTES

The problem happens because KWin encodes the picked color as gamma-2.2 instead
of the expected sRGB curve, which makes it brighter when an sRGB curve is
assigned to that. Try running Krita with the following environment set:

export KRITA_USE_GAMMA22_FOR_COLOR_PICKING=1

, Krita will assign a gamma-2.2 profile to the picked color (which is against
the spec) and the picking will start working as expected.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to