discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Pre-multiplied alpha


From: Alexander Malmberg
Subject: Pre-multiplied alpha
Date: Fri, 12 Dec 2003 01:19:32 +0100

Hi,

While working on the new image loaders (especially the png loader, since
png:s can have alpha) I hit an old issue that I don't think has ever
been resolved properly.

Does the image data stored in an NSBitmapImageRep have premultiplied
alpha (aka associated alpha) or not (aka unassociated alpha)? The image
data passed to NSDrawBitmap?


I can easily have back-art handle either. Currently, it depends on
whether it hits an optimized path or not, but that'll be fixed as soon
as I can commit again.

I'm not really sure what back-xlib does; its compositing code seems to
be uncertain about whether the internal buffers have premultiplied alpha
or not, so the end result is messed up no matter what kind of data I
give it.

png uses non-premultiplied alpha, so for the png loader, it would be
very convenient if that matched the internal NSBitmapImageRep format. :)

tiff (the only other format we have with alpha) can do both
premultiplied and un-premultiplied, and has a header field to tell a
loader which it is. GNUstep currently loads and ignores this field.


I'm leaning towards using un-premultiplied alpha in NSBitmapImageRep and
NSDrawBitmap for mostly the same reasons that are given in the .png
rationale.

- Alexander Malmberg




reply via email to

[Prev in Thread] Current Thread [Next in Thread]