That’s because you are unintentionally applying it to the canvas (see my explanation below).
If you isolate it in a group, then you can easily see its actual behaviour: Areas that are transparent in the layer, are made transparent in the result. (or to put it another way, transparent areas in the layer are ‘cut out’ / ‘removed’ from the result.)
If that’s what it is actually doing, then that is a bug. Destination Out should cut the area covered by Src away (or to put it another way, it should OUTput the pixels that are only opaque in DEST)
Also sounds like it would be a bug if this is really what is happening; Source Atop should use Dest (the bottom layer) as a mask for Source, so that the places where both Src and Dest are opaque contain pixels from Src, and all other places contain pixels from Dest.
Also sounds like it would be a bug if this is really what is happening. Destination Atop should show pixels from Dest in places where Dest and Src overlap, and pixels from Src otherwise.
(compare to Destination in, in which pixels from Dest are shown in the areas where Src overlaps dest, and transparency in all other locations)
The descriptions given here match the “how they look” diagrams found on the porter-duff page that I previously linked.
EDIT: I’ve just rebuilt MyPaint and tested the above layer modes. My results are:
- Dest In: As I described above. √
- Dest Out: As I described above. √
- Src Atop: As I described above. √
- Dest Atop As I described above. √
One factor that I guess may be confusing you here is that in Mypaint, the background layer is implied. This leads to results such as “‘Dest in’ removes canvas for areas that aren’t in Src”. That’s a result of the fact that compositing is done bottom-to-top (as is standard in most paint programs), and this is the reason that isolating it in a group is necessary.
I can write it out like so:
- supposing you have two layers B and C, with C being set to ‘Dest In’ mode
- first, the layer B is applied to the background. In this operation, B is Src and background is Dest. We will call the result of this “RESULT1”
- second, the layer C is applied to RESULT1. In this operation, C is Src and RESULT1 is Dest. We can call the result of this ‘FINAL’
- Since the layer mode of C is ‘Destination in’, the parts of RESULT1(Dest) that were not in Src have been made transparent
Hopefully that illustrates what is happening, and why isolating things in a group is currently necessary.
@bleke : That’s basically Photoshop’s model, IIRC. So it’s definitely possible, the question is what is the best design?
I believe the ‘separate clipping layer’ model was already considered, and was judged as a bit too inflexible.