Bug 423533 - Layer drawn incorrectly after some combinations of blending modes
Summary: Layer drawn incorrectly after some combinations of blending modes
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: General (show other bugs)
Version: 4.2.9
Platform: Manjaro Linux
: NOR normal
Target Milestone: ---
Assignee: Dmitry Kazakov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-26 09:00 UTC by Deif Lou
Modified: 2020-08-20 19:42 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
sample file (1.01 MB, application/x-krita)
2020-06-26 09:00 UTC, Deif Lou
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Deif Lou 2020-06-26 09:00:06 UTC
Created attachment 129689 [details]
sample file

SUMMARY
This both happens in 4.2.9 and master.
It seems that if we have 2 layers and set the top one to a mode that makes the bottom layer only partially visible in the composition (like "Destination In" or "Destination Atop"), when we change back the blending mode to normal or any other that should show all the bottom layer, the bottom layer can be shown cropped as if only some tiles where painted.
It seems that this is only a visualization problem and if the bottom layer is hidden and shown again with the eye icon the layer is shown correctly again.
The main problem is that if the image is saved when the layer is being displayed wrongly, the layer is saved with the artifact.

STEPS TO REPRODUCE
1. Open the attached file in krita
2. Set the blending mode of "Layer 2" to Destination In or Destination Atop
3. Set the blending mode of "Layer 2" back to Normal

OBSERVED RESULT
"Layer 1" is cropped.
See https://imgur.com/a/aRPgGNY

EXPECTED RESULT
"Layer 1" should not be cropped

SOFTWARE/OS VERSIONS
Operating System: Manjaro Linux 
KDE Plasma Version: 5.18.5
KDE Frameworks Version: 5.70.0
Qt Version: 5.15.0
Comment 1 Ahab Greybeard 2020-07-01 15:26:15 UTC
I can confirm this for 4.3.0 and the Jun 30 5.0.0 prealpha (git 8dccf4f) appimages.

You can also restore the correct appearance by toggling the visibility of the white Background layer, if there is one.

If I Save, Close, then reopen, the artifact is not shown on the canvas but it is shown in the preview.png and the mergedimage.png of the .kra file. To correct this you need to make a saveble change and then Save.
Comment 2 Dmitry Kazakov 2020-08-20 19:42:20 UTC
Git commit b39aeef7faa8e91ecc3062be14c77f6494aa71ce by Dmitry Kazakov.
Committed on 20/08/2020 at 19:38.
Pushed by dkazakov into branch 'krita/4.3'.

Fix update of layers with Destination Atop blendign mode

When switching the layer from Destination Atop blending
mode to any other mode, we should take the old extent into
account, because Destination Atop and Destination In modes
can change the layer's extent.

M  +13   -4    libs/image/commands/kis_node_compositeop_command.cpp
M  +3    -0    libs/image/commands/kis_node_compositeop_command.h

https://invent.kde.org/graphics/krita/commit/b39aeef7faa8e91ecc3062be14c77f6494aa71ce
Comment 3 Dmitry Kazakov 2020-08-20 19:42:35 UTC
Git commit e53b9f860941e75f6691a455dce7d526f9f2f0ff by Dmitry Kazakov.
Committed on 20/08/2020 at 19:42.
Pushed by dkazakov into branch 'master'.

Fix update of layers with Destination Atop blendign mode

When switching the layer from Destination Atop blending
mode to any other mode, we should take the old extent into
account, because Destination Atop and Destination In modes
can change the layer's extent.

M  +13   -4    libs/image/commands/kis_node_compositeop_command.cpp
M  +3    -0    libs/image/commands/kis_node_compositeop_command.h

https://invent.kde.org/graphics/krita/commit/e53b9f860941e75f6691a455dce7d526f9f2f0ff