Bug 390299 - Artifacts when opening a kra file with drop shadow in a group (Krita 4.0.0-beta1.1.appimage)
Summary: Artifacts when opening a kra file with drop shadow in a group (Krita 4.0.0-be...
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: layer styles (show other bugs)
Version: 4.0.0-beta.1
Platform: Appimage Linux
: NOR normal
Target Milestone: ---
Assignee: Dmitry Kazakov
URL:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2018-02-12 00:04 UTC by mvowada
Modified: 2021-05-17 07:35 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Kra file with drop shadow (215.28 KB, application/x-krita)
2018-02-15 11:29 UTC, Halla Rempt
Details
Kra file with drop shadow on group layer (628.31 KB, application/x-krita)
2018-02-16 12:10 UTC, tkp
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mvowada 2018-02-12 00:04:02 UTC
(Ubuntu 14.04 - Krita 4.0.0-beta1.1.appimage)

For the exact layers stack please, see here: https://forum.kde.org/viewtopic.php?f=139&t=151056&p=394713#p394710
My steps to reproduce:

1) create a new document
2) add 2 Paint layers in a group
3) leave the topmost empty
4) paint strokes on the second one and
5) add the "Drop Shadow" layer style to it.
6) Save, close, reopen

Actual Results: artifacts when reopening the document (see link).
Expected Results: no artifacts.
Comment 1 Halla Rempt 2018-02-15 11:29:28 UTC
Created attachment 110685 [details]
Kra file with drop shadow

I cannot reproduce this anymore with a current build (there's one here: http://rempt.xs4all.nl/~boud/Krita-4.0.0-beta1-9f3212b-x86_64.appimage) and the attached .kra file. If you've got a .kra file that still shows the problem, please attach it.
Comment 2 mvowada 2018-02-15 12:15:58 UTC
(In reply to Boudewijn Rempt from comment #1)
> Created attachment 110685 [details]
> Kra file with drop shadow
> 
> I cannot reproduce this anymore with a current build (there's one here:
> http://rempt.xs4all.nl/~boud/Krita-4.0.0-beta1-9f3212b-x86_64.appimage) and
> the attached .kra file. If you've got a .kra file that still shows the
> problem, please attach it.

Thank you very much for the appimage link!
I've checked with your file and the one I had, and I'm not able to reproduce this issue anymore. Thanks again :)
Comment 3 tkp 2018-02-16 12:10:35 UTC
Created attachment 110714 [details]
Kra file with drop shadow on group layer
Comment 4 tkp 2018-02-16 12:13:03 UTC
Indeed, thanks for the review and appimage !

Unfortunately it is not fixed on my side : you file opens correctly, but the bug still seem to be here :

1. open bla.kra : no artifacts (neither in Krita 3.3.3)
2. put the drop shadow effect on Layer5 (group layer) instead of Layer3
3. save and re-open, artifacts are visible in both 3.3.3 and latest appimage

The attached modified bla2.kra file attached should show the issue.
Comment 5 mvowada 2018-02-16 13:38:18 UTC
(In reply to tkp from comment #4)
> Unfortunately it is not fixed on my side
> The attached modified bla2.kra file attached should show the issue.

Yes, you're right. (changing the status back to "Confirmed")
Comment 6 Dmitry Kazakov 2018-02-26 11:30:54 UTC
Git commit f17d3500db2a8336a7c20b362f0074e4e5a035ba by Dmitry Kazakov.
Committed on 26/02/2018 at 11:30.
Pushed by dkazakov into branch 'master'.

Fix rendering of group layers with convolution-based layers styles

Basically, group layers and adjustment layers depend on children and
predecessors correspondingly. We should take care about that, because
layer styles can also depend on that...

M  +33   -1    libs/image/layerstyles/kis_layer_style_projection_plane.cpp
M  +78   -11   libs/image/tests/kis_walkers_test.cpp
M  +1    -0    libs/image/tests/kis_walkers_test.h

https://commits.kde.org/krita/f17d3500db2a8336a7c20b362f0074e4e5a035ba
Comment 7 Dmitry Kazakov 2019-05-09 14:18:41 UTC
Git commit 9d2920f896c0342774cacd95d4f8a4c5c9f58329 by Dmitry Kazakov.
Committed on 09/05/2019 at 14:17.
Pushed by dkazakov into branch 'master'.

Fix rendering of masks and layer styles on dependent nodes

In Krita we have two [0] types of "dependent" nodes, that is,
whose contents depends on the result of a merge of other layers.

KisAdjustmentLayer depends on the result of composing all the
layer below it. KisGroupLayer depends on the result of composing
its children.

All these layers can have filter masks and/or layer styles. To
handle them, the patch introduces a term needRectForOriginal().
needRectForOriginal(rect) means "what area of layer's original
device should be prepared to correct result in 'rect' of the
'final device'". Under 'final device' it may be considered
projection for a layer or a final composed planes for a
projection plane.

What is the difference between needRectForOriginal() and needRect?

needRect() defines "what area of layers below should be prepared
to get correctly merged image". Obviously, group layer doesn't
depend on layers below (it depends on its children) and adjustment
layer's needRect also includes filter's needRect, which is not the
case for needRectForOriginal().

[1] --- actually, we have three. KisCloneLayer is also "dependent",
        but it is not covered by this patch.
Related: bug 366419

M  +5    -0    libs/image/kis_abstract_projection_plane.cpp
M  +8    -0    libs/image/kis_abstract_projection_plane.h
M  +4    -1    libs/image/kis_adjustment_layer.cc
M  +5    -2    libs/image/kis_async_merger.cpp
M  +23   -2    libs/image/kis_base_rects_walker.h
M  +17   -0    libs/image/kis_layer.cc
M  +15   -0    libs/image/kis_layer.h
M  +5    -0    libs/image/kis_layer_projection_plane.cpp
M  +1    -0    libs/image/kis_layer_projection_plane.h
M  +5    -0    libs/image/kis_mask_projection_plane.cpp
M  +1    -0    libs/image/kis_mask_projection_plane.h
M  +5    -0    libs/image/layerstyles/kis_layer_style_filter_projection_plane.cpp
M  +1    -0    libs/image/layerstyles/kis_layer_style_filter_projection_plane.h
M  +44   -18   libs/image/layerstyles/kis_layer_style_projection_plane.cpp
M  +3    -0    libs/image/layerstyles/kis_layer_style_projection_plane.h
A  +-    --    libs/image/tests/data/async_merger_test/dependent_adj_mask.png
A  +-    --    libs/image/tests/data/async_merger_test/dependent_adj_style.png
A  +-    --    libs/image/tests/data/async_merger_test/dependent_group_mask.png
A  +-    --    libs/image/tests/data/async_merger_test/dependent_group_mask_style.png
A  +-    --    libs/image/tests/data/async_merger_test/dependent_group_style.png
M  +160  -0    libs/image/tests/kis_async_merger_test.cpp
M  +7    -0    libs/image/tests/kis_async_merger_test.h
M  +3    -2    libs/image/tests/kis_walkers_test.cpp

https://invent.kde.org/kde/krita/commit/9d2920f896c0342774cacd95d4f8a4c5c9f58329
Comment 8 Dmitry Kazakov 2021-05-17 07:35:43 UTC
Git commit 1a68ab810d6dd57c29e07e6f6b3bd738eceba62d by Dmitry Kazakov, on behalf of Eoin O'Neill.
Committed on 17/05/2021 at 07:35.
Pushed by dkazakov into branch 'master'.

Fix artifacts when merging multiple animated layers w/ layer styles

M  +6    -1    libs/image/kis_layer_utils.cpp

https://invent.kde.org/graphics/krita/commit/1a68ab810d6dd57c29e07e6f6b3bd738eceba62d