Confusion about Pass-through mode and opacity

Let me know if this is better suited for the ‘develop’ board.

I am developing an open source library relating to rendering and how it is performed in Krita. I have tried to google search for more information about how pass through works but I have not found anything satisfactory to explain what I am seeing. From https://docs.krita.org/en/reference_manual/dockers/layers.html:

Pass Through Mode: Only available on Group Layers, this allows you to have the blending modes of the layers within affect the layers outside the group.

In my case I create an image with one group with two layers. Both layers are painted at 100% opacity but one is a little smaller than the other. I turn down the opacity of the group to 0.5.

Screenshot from 2020-04-30 15-03-15

The result:
Screenshot from 2020-04-30 15-03-29

Result if I turn off pass through:
Screenshot from 2020-04-30 15-03-47

It seems like the upper layer is at 0.75 opacity when pass through it on, but from all descriptions of pass through I can find, I don’t see why this would be the case.

Using Gimp 2.10, the same configuration with pass through, the second result is rendered with or without pass-through, which is what I would expect.

(Note that I started with a bigger example that was being weird, and just broke it down to this to aid understanding)

Does anyone know if this is a intentional effect of pass through, and if yes, why it is rendered like this? Else, I can file a bug or look into making a merge request.

Thanks for reading!

Your link to the manual has a colon at the end which makes it go to an error page.
(Apart from that I don’t know.)

I hope I’m not wrong here, but a passthrough group layer is for the most part just a dummy that helps you organize layers.

Basically, the layers inside behave just as if you’d move them out of the group, but they inherit two things from the group: visibility (so you can toggle visibility of multiple layers with one click) and opacity.

I wasn’t really aware the opacity setting even does something, but apparently it just multiplies the opacity of each layer in the group with its own opacity value.
So what you get here is the same as if you had set both of the layers inside the group to 50% opacity.

I have no clue how gimp would give the second result if it’s really skipping creation of a group projection…seems logically impossible to me.

1 Like

@Lynx3d , thanks, that makes much more sense. I think that in Gimp everything at the level of the group would be rendered together, and then the opacity applied, while here the opacity is applied to each layer, and then rendered. Thank you for the clarification. I am not sure which approach is exactly right but at least I can defiantly see the logic in this approach now.

Just found gimp’s documentation about their pass-through mode:
https://docs.gimp.org/2.10/en/glossary.html#glossary-pass-through

So yes gimp definitely still seems to do a separate group projection when opacity is not 100%, only that it uses the below layers basically as backdrop instead of just transparent pixels.
I don’t think this can be done in krita currently.

-edit-
although the result of their example still puzzles me a bit, seems the result is not composited in a typical alpha overlay mode, but just a blend with the opacity value, so calling it “opacity” seems quite misleading to me.