Bug 505420 - Unexpected alpha blending with linear color space
Summary: Unexpected alpha blending with linear color space
Status: CONFIRMED
Alias: None
Product: krita
Classification: Applications
Component: * Unknown (other bugs)
Version First Reported In: 5.2.9
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-06-10 09:44 UTC by main
Modified: 2025-06-10 14:32 UTC (History)
1 user (show)

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


Attachments
Image of the described problem. The two sides uses different color spaces for alpha blending (blend mode "Nornal"). (309.87 KB, image/png)
2025-06-10 09:44 UTC, main
Details

Note You need to log in before you can comment on or make changes to this bug.
Description main 2025-06-10 09:44:54 UTC
Created attachment 182142 [details]
Image of the described problem. The two sides uses different color spaces for alpha blending (blend mode "Nornal").

SUMMARY
When using a linear color space, the alpha blending with “Transparency Checkerboard” and a background layer of the same color will give different results. See attached image.

STEPS TO REPRODUCE
1. Set image to a linear color space.
2. Set the “Transparency Checkerboard” to some color (for example black).
3. Create a gradient from some color (for example white) to fully transparent.
4. Create a layer behind the gradient layer. Fill half of this layer with the same color as the “Transparency Checkerboard” color and the other half as fully transparent.

OBSERVED RESULT
Even though the “Transparency Checkerboard” and the background are the same color, the halfs look different. The half that is filled black is the expected result, while the transparent side seemingly use sRGB for the blending even though the image should use a linear color space. The attached image shows this better than words.

EXPECTED RESULT
That the two sides look the same.

SOFTWARE/OS VERSIONS
Windows: 10

Link to Krita forum post about this issue that has some additional information: https://krita-artists.org/t/unexpected-alpha-blending-with-linear-color-space/126236

I am not familiar with the Krita source code, but I would assume this issue arises because Krita internally uses the correct color space when rendering the layers, but not when the resulting image is blit to the canvas. This is problematic when you want to work in a linear color space and also have an accurate image of how the resulting semi-transparency will look when exporting. The work-around for now is to create a background-layer while working on the image so it looks the same as when the image is exported.
Comment 1 Wolfgang Baer 2025-06-10 14:32:19 UTC
Confirmed with Krita 5.3 prealpha on Windows 11.