Talk:Alpha compositing

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

Missing Porter-Duff Operators, and Stained Glass Windows[edit]

The comment "For some applications, a single alpha channel is not sufficient..." needs fixing. The stained glass example is unfortunate. The Porter-Duff Source-Out and Dest-Out operators (which are missing from the list of operators at the head of the article) allow for subtractive color computations. You can use those operators for stained-glass effects.

It is true that Porter-Duff operators provide an approximation to actual physical perception of mixed colors. See the Metamerism article for a reasonable explanation of why RGB color mixing is a non-physical approximation. But, those problems with stained glass that do exist won't be fixed by three channels of alpha. 3 channels isn't helpful. If you use source Source-Out, 1 channel is perfectly sufficient. And if one channel isn't good enough, you're going to need infinite channels (continuous spectrum computations). There is no three.

On a more adventurous note, it might be worth explicitly acknowledging Porter-Duff compositing operators, or even reframing the entire article around Porter-Duff compositing operators, which are now a standard feature of all major graphics packages written since 1984, on Windows, Mac, Linux, and Color Postscript. I'm pretty sure there are eight compositing operators, not 4. Source-Out, Dest-Out, XOR, not sure what the last one is.

As a professional programmer working in the graphics field since forever, I think the article should be explictly Porter-Duff operators from start to finish.

rerdavies (talk) 03:27, 20 August 2023 (UTC)[reply]

I see no problem with that section other than a lack of a source.
In particular, I don't understand how source/dest out operator helps with it. How would you use it to encode a stained glass window that has a red, a green, and a blue transparent glass segments? Stained glass requires multiplicative blending rather than subtractive, and multiplicative blending is not one of the Porter-Duff operations.
Yes -- for correct spectral composition you'd need more than four channels -- and the text acknowledges that.
As for the number of compositing operators -- it's either 12, 9, or 5 depending on how you count. This article talks about the 5 unique non-trivial operators: over, in, out, atop, xor. If you double-count the asymmetrical operators (e.g A over B vs. B over A) then it's 9. There're also three trivial ones: 0, A, B -- which adds up to the 12 in Porter-Duff paper, but I don't think that they're worth mentioning in this article.
Graphics packages tend to have other compositing methods (often called blend modes) that aren't part of the Porter-Duff paper, and aren't really related to alpha compositing that much. Perhaps you're confusing it with those? bungalo (talk) 02:38, 21 August 2023 (UTC)[reply]

Linear alpha[edit]

Not sure the claim "alpha is always linear" is correct. In HTML/Webkit, Opacity and color alpha both use an sRGB curve. Photoshop: sRGB. PNG: configurable. I'm poking at a Cairo framebuffer to figure out whether their framebuffers are linear or sRGB alpha.

Unfortunately, it's not difficult to find disreputable sources for "alpha is always linear", and difficult to find sources for "alpha isn't always linear". So a [citation needed] isn't going to cut it. But I do think the claim is wrong.

rerdavies (talk) 03:27, 20 August 2023 (UTC)[reply]

Seems you're right; I changed the offending text, though I don't can't find good sources. Couldn't even find the relevant part in the SVG/CSS specs. bungalo (talk) 02:14, 21 August 2023 (UTC)[reply]

The illustrations in the description section[edit]

This regards the blue and orange shapes in the illustrations of the Description section.

While it might be simple to understand for many people, it could be helpful to novices if the A and B colors and shapes were clearly identified. For example:

  • Note that in the illustrations below:
    • A is the blue square
    • B is the orange circle

A legend might also serve the purpose.

Also, the row headers could be simplified:

  • Opaque shapes
  • Partially (50%?) transparent shapes

Thoughts? Dawnvawn (talk) 22:56, 16 January 2024 (UTC)[reply]