The Lighter and Plus-Darker compositing operators of the Compositing and Blending Level 2 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.
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, 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.
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.
The Lighter and Plus-Darker compositing operators of the Compositing and Blending Level 2 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.
αo = αs + αb
for the output alpha channel value. That implies thatao
can get greater than 1 but how are values geater than 1 handled here? In the Porter & Duff paper Compositing Digital Images, section 4.5 "The Plus Operator" the authors use thedissolve(A, alpha)
function which multiplies each color component including the alpha channel value with thealpha
value. Furthermore, for image A they use the valuealpha
and for image B they use the value1 - alpha
as second argument in thedissolve
function,. Not until then they apply the Plus operator. Therefore, one would get the formulaao = 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 ofao
can get greater than 1.αo = max(0, 1 - αs + 1 - αb)
, which is confusing as1 - αs + 1 - αb
is always geater or equal to 0, and themax()
function does not make any sense here. Moreover, the value of1 - αs + 1 - αb
can get greater than 1, and once again there exists no clarification what it means whenao
gets greater than 1. Maybe, the formula should beao = min(1, 1 - αs + 1 - αb)
which would make much more sense. Similar, the formulaco = max(0, 1 - αs x Cs + 1 - αb x Cb)
is confusing, as1 - αs x Cs + 1 - αb x Cb
is always geater than or equal to 0, and themax()
function is once again unnecessary. Moreover, I suppose that parenthesis are missing in the formula. Is really1 - α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 isco = min(1, (1 - αs) x Cs + (1 - αb) x Cb)
. Please, clarify the meaing of the formulas, or correct them.