Bug 476571 - Creating Filter Layer based off current selection then changing its Blending mode will produce artifacts and weird behavior
Summary: Creating Filter Layer based off current selection then changing its Blending ...
Status: RESOLVED INTENTIONAL
Alias: None
Product: krita
Classification: Applications
Component: Filter Layers (show other bugs)
Version: 5.2.1
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-05 04:38 UTC by Dorijan Salak
Modified: 2023-11-06 03:18 UTC (History)
1 user (show)

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


Attachments
Results - Initial Filter Layer effect vs Changing blending mode vs Workaround (150.25 KB, image/jpeg)
2023-11-05 04:38 UTC, Dorijan Salak
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dorijan Salak 2023-11-05 04:38:27 UTC
Created attachment 162874 [details]
Results - Initial Filter Layer effect vs Changing blending mode vs Workaround

SUMMARY
Not certain if this is a bug or a limited functionality of how Filter Layer's transparency (alpha) works in Krita but the results are weird and could be caused by a bug.

If Filter Layer is added while having an active selection (in order to affect only selected area) then changing its Blending Mode (for example from default Copy to Overlay) creates box artifact around affected area and further if turning visibility of affected layers (layers below the added filter layer) the effect spreads to entire affected layers.


STEPS TO REPRODUCE
1. Create Paint Layer and draw something (rectangle for example) with any color except pure white or black (as the result may not be visible based on used blend mode) 
2. Create a selection selecting a portion of added pixels on paint layer (portion of the rectangle)
3. Add Filter Layer (Gradient Map, HSV adjustment or literally any filter)
4. Change Filter Layer Blending Mode from default Copy to Overlay or something (some may have a visible issue based on colors used)

OBSERVED RESULT
After Changing the Blending Mode of created Filter Layer, the alpha(?) of that Filter Layer (not entire added filter effect) will spread around initially affected selection in a box shape and further turning visibility of affected Layer/layers below will spread the effect to entire affected layer (the rectangle from example).

EXPECTED RESULT
After Changing the Blending Mode of created Filter Layer, only Blending Mode within initially affected Selection should change.

SOFTWARE/OS VERSIONS
Windows: Windows 10 Pro, Version 2009
KDE Plasma Version: nowhere to be found within Krita Help > About KDE
KDE Frameworks Version: same as above
Qt Version: 5.15.7

ADDITIONAL INFORMATION
Currently Installed Krita version 5.2.1 but the issue seems to go further back (tried 5.0 up to 5.2.1 and had same results). Used RGB/Alpha 8-bit Color Space, but results are the same in other Models/Depths too. 

WORKAROUND
Only way I could find where alpha of Filter Layer doesn't partially bleed past selection is to Add Transparency Mask based on said selection to the Filter Layer after changing blending mode. This produces close to desired result where changing blending mode will stick to selection (currently transparency mask). However if the transparency mask is added before changing from copy to another Blend will again reproduce only partial bleed where in order to get full change I have to turn visibility of affected layer off/on, same if I go back to copy from any other blending mode.
Comment 1 Dmitry Kazakov 2023-11-05 09:46:25 UTC
Hi, Dorijan!

The Filter Layers are expected to work in "Copy" mode only. They take the entire projection below the layer, process it and replace with the new version. 

If you want to play with blending modes, you need to either convert that layer into a Paint Layer or just replace it with a filter mask attacked to your selected object:

1) Cut-paste your selection into a new layer
2) Deselect
3) Add a Filter Mask to the newly added layer
4) Now you can properly change the blending mode of this "object".
Comment 2 Dorijan Salak 2023-11-06 03:18:38 UTC
I see, so that's the duplicated layer basically and transparency mask doesn't automatically apply for the selection but rather only for what the filter changes.  Thank you for the explanation.