https://bugs.kde.org/show_bug.cgi?id=381287

[email protected] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #7 from [email protected] ---
I think there is an easy way to do this, at least for my own PSD compositor
tool it was pretty simple to do:
Composite the pass group on top of a copy of the backdrop below, and then lerp
the backdrop before compositing the group with the result after compositing the
group, using the final computed mask for the group as the lerp parameter:

        if isinstance(sublayer, GroupLayer):
            if blend_mode == BlendMode.PASS:
                next_backdrop = backdrop.copy()
            else:
                next_backdrop = np.zeros_like(backdrop)
            color_src = composite(sublayer.children(), offset, next_backdrop)

        # ...

        if blend_mode == BlendMode.PASS:
            if mask_src is None:
                mask_src = opacity
            else:
                mask_src = blendfuncs.mul(mask_src, opacity)
            backdrop = blendfuncs.lerp(backdrop, color_src, mask_src)

Even if this somehow doesn't work with the current compositor strategy, it
should probably be an exceptionally handled case because it's useful to have a
mask for a pass group, and the workarounds seem too convoluted and not obvious.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to