Premultiplied colors and alpha=0
Soeren Sandmann
sandmann at daimi.au.dk
Wed Aug 20 17:53:30 PDT 2008
Keith Packard <keithp at keithp.com> writes:
> On Wed, 2008-08-13 at 21:46 +0200, Soeren Sandmann wrote:
> > Generally to recover the "real" pixel from a premultiplied one, you
> > have to divide by the alpha channel, but this leads to a problem when
> > the alpha channel is 0. How should a render implementation treat such
> > pixels?
>
> Premultiplied *is* the real color; non-premultiplied is a poser.
>
> The Over operator does
>
> dst = dst * (1-srcA) + src
>
> That works for any srcA value, even zero. Pixels where any color channel
> is greater than alpha are called 'super luminescent' colors.
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?
Another way of asking the question is: Suppose you want to convert a
premultiplied pixel from sRGB to linear light. If alpha is interpreted
linearly, then you would have to do something like this for each color
channel:
C' = alpha * (C / alpha) ** 2.2
What do you do if alpha is 0? Or do we not interprete alpha linearly?
Soren
More information about the xorg
mailing list