On Mon, 15 Dec 2003 07:43:39 -0600, "Stephen J Baker" <[EMAIL PROTECTED]> wrote:
> RaphaŽl Quinet wrote:
> > I don't see how this would happen, except if the downsampling filter
> > would be incorrectly processing the R, G, B and A values independently
> > (without weighting by A), which is obviously incorrect.
> Well, it's not "obviously incorrect" unless you assume that RGB's are
> pre-multiplied by alpha.

It looks like you misunderstood what I wrote.  I don't know if this is
the case here, but a frequent mistake is to confuse how the RGBA
values are stored (with or without pre-multiplication of R, G and B by
A) and how these values are used in compositing, subsambpling, etc.

The best way to store the data is to store it with full precision, so
it should be post-multiplied, not pre-multiplied.  But when the pixels
are used in compositing operations, then they should be multiplied by
their alpha values (if possible, using a higher precision for the
intermediate steps), otherwise the color of partially or fully
transparent pixels would bleed into the neighboring pixels.  This is
what I described as the "obviously incorrect" way to process these
pixels.  This is also what has been fixed in a number of GIMP plug-ins
by David Necas and others in:

Note that this is exactly what the GIMP does: store the source pixels
and the results with post-multiplied alpha, but use the correct
weighting for the operations that combine several pixels.

> There is actually a GOOD reason to use post-multiplied alpha - and that
> is that pre-multiplying RGB by alpha destroys information that might come
> in useful later on.   If you can choose to postpone the destruction of
> data - then that's generally a good thing to do.

I agree.  This is what the GIMP does and I was definitely not
suggesting to change this, so I think that you misunderstood what I
wrote.  The GIMP will keep on using post-multiplied alpha in the
future, and this is a good thing.

The whole point of this discussion was based on the fact that because
we use post-multiplied alpha, there is some ambiguity about whether
the average user is supposed to know and rely on the RGB values of
transparent pixels.  If we had been using pre-multiplied alpha, then
there would be no reason for any debate, because all transparent
pixels would have R, G and B = 0.

Gimp-developer mailing list

Reply via email to