Closed GoogleCodeExporter closed 8 years ago
Charles Nicholson points out this article from Tom Forsyth about pre-multiplied
alpha:
http://home.comcast.net/~tom_forsyth/blog.wiki.html#%5B%5BPremultiplied%20alpha%
5D%5D
Original comment by cast...@gmail.com
on 4 Mar 2008 at 10:59
Ignacio-
Here's a patch against 2.0.1 with the following features:
InputOptions has "void setPremultiplyAlpha(bool b)", backed by
InputOptions::Private
"bool premultiplyAlpha".
Compressor has the private method "premultiplyAlphaMipmap(Mipmap&, const
InputOptions::Private&)", that converts the mipmap to a FloatImage, multiplies
the
RGB channels by A into a new FloatImage, and overwrites the old one with the
new one.
This happens after mipmap initialization, but before quantization/compression.
nvcompress.exe has the command-line flag "-premula" to invoke this
functionality.
The code in Compressor is a little sloppy in that it doesn't confirm the correct
number of channels, or error if conflicting options exist. I'm pretty sure you
can
do it to a normal map, which you probably don't want. I adhered to the coding
standard in as much as i could glean without a doc.
Best,
charles
Original comment by charles....@gmail.com
on 5 Mar 2008 at 9:49
Attachments:
Thanks, I checked that in with some changes. I think alpha premultiplication
should
be applied in the destination gamma space. If you apply it in linear space,
then when
you transform the color to gamma space you will also transform the
premultiplied alpha.
Original comment by cast...@gmail.com
on 7 Mar 2008 at 1:49
The cuda compressors now have support for alpha modes.
Original comment by cast...@gmail.com
on 6 May 2008 at 8:04
Original comment by cast...@gmail.com
on 11 Oct 2008 at 7:30
Original comment by cast...@gmail.com
on 24 Nov 2008 at 10:36
Original issue reported on code.google.com by
cast...@gmail.com
on 4 Feb 2008 at 11:23