Premultiplied colors and alpha=0

Allen Akin akin at pobox.com
Wed Aug 20 20:10:18 PDT 2008


On Thu, Aug 21, 2008 at 02:53:30AM +0200, Soeren Sandmann wrote:
| That's fine when alpha > 0 -- there is a visual interpretation to such
| pixels: they emit light. But for alpha=0, I don't see any visual
| interpretation. Do they emit "infinite" amounts of light?

Alpha is a way of expressing coverage, not luminance, so there's no
mathematical requirement that all the color channel values be less than
or equal to the alpha channel value.

The premultiplied form is preferred mainly because the Porter & Duff
compositing operators produce results in that form.  If you don't have a
way of tagging a pixel value so that you know whether it's in
premultiplied form or not, you need to standardize everything on that
form so that compositing operations can be chained correctly.

Alpha blending doesn't model physical transparency or luminance, or even
provide a general solution for antialiasing edges.  It's just an
efficient technique that allows a few useful combinations of images.

(Consider what you get when you shine a light through a piece of
transparent red plastic combined with a piece of transparent green
plastic, versus what you get when you alpha-blend red and green.)

Allen



More information about the xorg mailing list