[fxtf-drafts] [compositing-2] Compositing Operators Lighter and Plus-Darker need some clarifications (#454)

RolandHeinze has just created a new issue for https://github.com/w3c/fxtf-drafts:

== [compositing-2] Compositing Operators Lighter and Plus-Darker need some clarifications ==
The [Lighter](https://drafts.fxtf.org/compositing/#porterduffcompositingoperators_plus) and [Plus-Darker](https://drafts.fxtf.org/compositing/#porterduffcompositingoperators_plus_darker) compositing operators of the [Compositing and Blending Level 2](https://drafts.fxtf.org/compositing) specification leave some questions to the reader. The definition of Plus-Darker is even strange and probably wrong. Please clarify the definition of both operators.

1. The Lighter operator uses the formula `αo = αs + αb` for the output alpha channel value. That implies that `ao` can get greater than 1 but how are values geater than 1 handled here? In the Porter & Duff paper [Compositing Digital Images](https://graphics.pixar.com/library/Compositing/paper.pdf), section 4.5 "The Plus Operator" the authors use the `dissolve(A, alpha)` function which multiplies each color component including the alpha channel value with the `alpha` value. Furthermore, for image A they use the value `alpha` and for image B they use the value `1 - alpha` as second argument in the `dissolve` function,. Not until then they apply the Plus operator.  Therefore, one would get the formula `ao = alpha * as + (1 - alpha) * ab` which is always less than or equal to 1. Unfortunately, this constraint of the Plus operator is not part of the Lighter operator in the specification, and as mentioned the value of `ao` can get greater than 1.
2. The Plus-darker operator uses the formula `αo = max(0, 1 - αs + 1 - αb)`, which is confusing as `1 - αs + 1 - αb` is always geater or equal to 0, and the `max()` function does not make any sense here. Moreover, the value of `1 - αs + 1 - αb` can get greater than 1, and once again there exists no clarification what it means when `ao` gets greater than 1. Maybe, the formula should be `ao = min(1, 1 - αs + 1 - αb)` which would make much more sense. Similar, the formula `co = max(0, 1 - αs x Cs + 1 - αb x Cb)` is confusing, as `1 - αs x Cs + 1 - αb x Cb` is always geater than or equal to 0, and the `max()` function is once again unnecessary. Moreover, I suppose that parenthesis are missing in the formula. Is really `1 - αs x Cs + 1 - αb x Cb` meant here, or should it be `(1 - αs) x Cs + (1 - αb) x Cb`? Maybe, the correct formula is `co = min(1, (1 - αs) x Cs + (1 - αb) x Cb)`. Please, clarify the meaing of the formulas, or correct them.

Please view or discuss this issue at https://github.com/w3c/fxtf-drafts/issues/454 using your GitHub account


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

Received on Sunday, 6 March 2022 13:50:06 UTC