Bug 443422

Summary: Textured smudge brush causes square artifacts when drawing on a transparency mask
Product: [Applications] krita Reporter: Ralek Kolemios <info>
Component: Brush enginesAssignee: Dmitry Kazakov <dimula73>
Status: RESOLVED FIXED    
Severity: normal CC: dimula73, 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: Artifacting of smudge brush on transparency mask

Description Ralek Kolemios 2021-10-07 03:55:51 UTC
Created attachment 142229 [details]
Artifacting of smudge brush on transparency mask

This is probably the most specific bug report I've ever made, but here's how to reproduce it:

1. Fill a layer with black
2. Add a transparency mask to the layer
3. Fill the transparency mask with grey (the most obvious color it shows up on)
4. Set your brush to any textured smudge engine brush with any settings and any color and draw

You then end up with the attached

5.0.0-beta2 (git 6d23534)
Comment 1 Dmitry Kazakov 2021-10-08 11:36:19 UTC
I can reproduce the issue with "Wet Bristles Rough", which is not textured actually.
Comment 2 wolthera 2021-10-08 14:36:48 UTC
Can confirm as well.
Comment 3 Dmitry Kazakov 2021-10-11 09:53:06 UTC
Git commit 6f53747912fe1da4ad4df9dac2f4a6fa2160d07a by Dmitry Kazakov.
Committed on 11/10/2021 at 09:47.
Pushed by dkazakov into branch 'master'.

Fix linking color space of Alpha color spaces

Before the patch, the alpha color spaces could be interpreted in
multiple different ways, depending on the conversion destination.
When it was converted into rgb8 or graya8, it was interpreted as
srgb-gamma corrected graya space. But when the conversion was
requested for rgb16 or graya16 color space (e.g. in color smudge
tool), the conversion happened through the LabA color space, which
is linear. It caused rendering issues, when painting with color
smudge brushes on transparency masks (or any alpha8-based layers).

This patch fixes the issues and makes "Gray-D50-elle-V2-srgbtrc" to
be the only linking color space for alpha colorspaces. Which basically
means that all the flavours of alpha color space are now basically
flattened versions of srgb-gamma-corrected graya color space.
CC:kimageshop@kde.org

M  +22   -0    libs/pigment/KoColorConversionSystem.cpp
M  +12   -0    libs/pigment/KoColorConversionSystem.h
M  +33   -2    libs/pigment/KoColorConversionSystem_p.h
M  +12   -4    libs/pigment/colorspaces/KoAlphaColorSpace.cpp
M  +1    -8    libs/pigment/colorspaces/KoAlphaColorSpace.h
M  +164  -6    libs/pigment/tests/TestColorConversionSystem.cpp
M  +1    -0    libs/pigment/tests/TestColorConversionSystem.h

https://invent.kde.org/graphics/krita/commit/6f53747912fe1da4ad4df9dac2f4a6fa2160d07a
Comment 4 Dmitry Kazakov 2021-10-11 14:19:48 UTC
Git commit 44ab8cc19e58b634762578236269232309918207 by Dmitry Kazakov.
Committed on 11/10/2021 at 14:19.
Pushed by dkazakov into branch 'krita/5.0'.

Fix linking color space of Alpha color spaces

Before the patch, the alpha color spaces could be interpreted in
multiple different ways, depending on the conversion destination.
When it was converted into rgb8 or graya8, it was interpreted as
srgb-gamma corrected graya space. But when the conversion was
requested for rgb16 or graya16 color space (e.g. in color smudge
tool), the conversion happened through the LabA color space, which
is linear. It caused rendering issues, when painting with color
smudge brushes on transparency masks (or any alpha8-based layers).

This patch fixes the issues and makes "Gray-D50-elle-V2-srgbtrc" to
be the only linking color space for alpha colorspaces. Which basically
means that all the flavours of alpha color space are now basically
flattened versions of srgb-gamma-corrected graya color space.
CC:kimageshop@kde.org

M  +22   -0    libs/pigment/KoColorConversionSystem.cpp
M  +12   -0    libs/pigment/KoColorConversionSystem.h
M  +33   -2    libs/pigment/KoColorConversionSystem_p.h
M  +12   -4    libs/pigment/colorspaces/KoAlphaColorSpace.cpp
M  +1    -8    libs/pigment/colorspaces/KoAlphaColorSpace.h
M  +164  -6    libs/pigment/tests/TestColorConversionSystem.cpp
M  +1    -0    libs/pigment/tests/TestColorConversionSystem.h

https://invent.kde.org/graphics/krita/commit/44ab8cc19e58b634762578236269232309918207