Re: [fxtf-drafts] [compositing] Question: How to properly blend and composite isolated groups (#440)

I'm not familiar enough with the spec to quote from it, but here's how your example should behave:

 1. Composite A into the root group with mix-blend-mode: normal.
 2. Composite B into the root group with mix-blend-mode: normal.
 3. Create an intermediate surface for the isolated group for C, which starts out fully transparent.
 4. Draw the contents of C into the intermediate surface for the isolated group. In this case, this is just the background color of C. The mix-blend-mode of C is ignored while drawing the contents of C.
 5. Composite the intermediate surface of C (which the spec calls "single element containing color and alpha information") into the root group with mix-blend-mode: difference.

Expressed with compositing functions "normal(dest, source)" and "difference(dest, source)", the final color is computed as follows:

`difference(normal(normal(root backdrop, A), B), C)`

Here, `normal` just does regular source-over compositing, and `difference` first adjusts the unpremultiplied source RGB values using the "difference" blend mode equation and then does source-over compositing with that adjusted source color.

> Since `mix-blend-mode: difference` is a [separable blend mode](https://drafts.fxtf.org/compositing-1/#blendingseparable), we use `mix-blend-mode: normal` for these blendings.

Kind of unrelated to the main point of this issue, but this sentence doesn't make sense to me. Separability is about the calculations of a single composting step - it describes whether the calculations can be done independently for the R, G, and B color components. It doesn't have any impact on what to do for other elements in the group.

-- 
GitHub Notification of comment by mstange
Please view or discuss this issue at https://github.com/w3c/fxtf-drafts/issues/440#issuecomment-956363608 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 1 November 2021 16:05:07 UTC