Bug 393109 - Transparency mask is merged when a layer is merged with parent layer
Summary: Transparency mask is merged when a layer is merged with parent layer
Status: CONFIRMED
Alias: None
Product: krita
Classification: Applications
Component: Layer Stack (show other bugs)
Version: 4.0.1
Platform: Microsoft Windows Microsoft Windows
: NOR wishlist
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-04-13 16:09 UTC by Philippe Lhoste
Modified: 2018-04-28 10:20 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philippe Lhoste 2018-04-13 16:09:37 UTC
The title is too terse to be clear...
I have a layer with a transparency mask (TM) on it, so part of it is hidden.
I paste some cut image in the layer, actually making a layer above it.
(BTW, it would be nice to be able to paste & merge in one command, but that's a feature request for later.)
So I have to do Merge with Layer Below (ie. good ol' Ctrl+E) to integrate this image into the layer. So far, so good... except the transparency mask is gone! The hidden parts are gone forever (unless I notice this and undo, but the first times, I didn't notice so it was too late).
Even locking the TM layer won't save it.
Fortunately, there is a workaround: use the arrows to move the TM to another layer, do the merge, move the TM back to the original layer.
Not very practical.
I suppose it is an unnoticed bug, or a feature that not everybody wants... :-) so I report it.
Comment 1 Dmitry Kazakov 2018-04-16 14:07:47 UTC
Yes, it seems like the destination layer is flattened before merging. We had exactly the same problem with selection masks, so now we keep them after the merge. But i'm not sure if keeping other kinds of masks will be obvious to the user. We should answer the following questions:

1) Destination layer has transparency mask, should it be kept?
2) Source layer has transparency mask, should it be kept?
3) Source or destination layer has Transform Mask?
3) Source or destination layer has Filter Mask?
Comment 2 Scott Petrovic 2018-04-17 16:06:50 UTC
The most important thing when merging is that the composited result always looks the same. 

With your request, the result will look different which is usually a bad thing. The source layer would then use the destination layer's transparency mask which it didn't before. This can lead to a different appearance then what it looked like before the merge.
Comment 3 Dmitry Kazakov 2018-04-18 14:40:01 UTC
Yep. Speaking truly I don't know what we should do about this bug.

Perhaps we could yse a compromise approach and ask user before the merge something like:

"The merged layers have masks that will be lost during the merge operation. Continue?"

Or we can even ask what to do with the masks...

Scott, what do you think about that?
Comment 4 Scott Petrovic 2018-04-18 16:13:47 UTC
That would be one option to have. Merging is usually a destructive process, so we need to be careful with showing messages when it is expected that some pixel data will be lost.

What different situations would we need to think about for this? I don't want this to get too complicated. I have never seen a dialog when merging layers, so we need a really good reason if we want to start showing one.

Personally I never would want to see a dialog when merging. I am merging to condense my layers, not preserve them.
Comment 5 Philippe Lhoste 2018-04-19 21:22:26 UTC
I understand Scott's objection, and I see we have different use cases.
Perhaps we can avoid a dialog by letting the user to choose what to do.
Either have two merge commands, one merging sub-layers, the other preserving them, or perhaps make effective what I attempted: if the sub-layer (transparency mask) is locked, don't merge it.

Note that my typical use case is to move the selection from one layer to another (typically because I drew on the wrong layer), so I have to cut, paste, then merge. If I could have a command like "move selection to this layer", that would be perfect, no merge involved. :-)
Comment 6 Philippe Lhoste 2018-04-19 21:31:20 UTC
"the result will look different which is usually a bad thing"
Well, at least it would be a visible change, that can be undone.
The problem in my case was that the merge was not noticeable until it was too late... :-)

Also about my process: it is similar to Gimp's copy and paste, which creates a floating selection, which we can anchor on the pasted layer. I guess "merge" and "anchor" are slightly different, at least in the spirit.
Comment 7 Halla Rempt 2018-04-28 10:20:41 UTC
Setting to wishlist. It definitely shouldn't work like this by default.