Bug 397364

Summary: blur filters assume Alpha Locked is on for layers with Inherit Alpha on
Product: [Applications] krita Reporter: cornellg
Component: FiltersAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: halla
Priority: NOR    
Version: 4.1.0   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed In:

Description cornellg 2018-08-11 09:02:02 UTC
When blurring layers with Inherit Alpha: Yes and Alpha Locked: No with any blur filter, the filter will not blur into transparent parts of the layer, even if the lower layer that provides the information for Inherit Alpha permits it.

Steps to reproduce:
1 create new document
2 paint on transparent layer named Layer 2 for default document, leaving transparent space around paint - eg draw rectangular selection and fill with gf/bg colour.
3 In Layers docker, tick Inherit Alpha button for Layer 2.
4 apply any blur filter

Expected behaviour: As Layer 1 is completely opaque, the paint on layer 2 should be blurred into the transparent portion of the layer, according to the blur radius. 

Effectively, the blur filters currently behave as one would expect for a layer with Inherit Alpha: Yes and also Alpha Locked: Yes.
Comment 1 cornellg 2018-08-11 09:04:28 UTC
Have not tried in newer builds of Krita. (I am currently working towards a deadline, so am not at this time willing to risk messing anything up with the setup by installing/uninstalling)
Comment 2 Halla Rempt 2018-09-01 12:33:04 UTC
Hi,

I can confirm the issue. Thanks for your report.
Comment 3 Halla Rempt 2019-05-02 10:32:46 UTC
Note: creating a filter mask from the blur filter does give the expected result.
Comment 4 Halla Rempt 2019-05-02 11:03:15 UTC
Er, filter layer -- filter mask seems to show the same problem on trying it again.
Comment 5 Halla Rempt 2019-05-02 11:06:59 UTC
Even more curious, the result for a filter mask is dependent on whether it was created when the associated layer had inherit alpha enabled or not, it doesn't get recalculated when that status changes, so it must be part of the filter definition. Let's see what happens when I save this image...
Comment 6 Halla Rempt 2019-05-02 11:09:21 UTC
Okay, on loading the image, inherit alpha on, both filter masks blur the image correctly.
Comment 7 Dmitry Kazakov 2019-05-08 08:24:50 UTC
Git commit 8884943c6bd801cf21814c052f4bdb784e065ad4 by Dmitry Kazakov.
Committed on 08/05/2019 at 08:24.
Pushed by dkazakov into branch 'master'.

Fix handling Inherit Alpha/Lock Alpha by filters

1) When applying, filters should treat "Lock Alpha" instead of
   "Inherit Alpha".

2) Filter masks should not handle parent layer's alpha locks
   at all

M  +0    -3    libs/image/kis_filter_mask.cpp
M  +3    -2    libs/ui/dialogs/kis_dlg_filter.cpp

https://invent.kde.org/kde/krita/commit/8884943c6bd801cf21814c052f4bdb784e065ad4