Skip to content

Using premultiplied alpha

Doug Thompson edited this page Aug 9, 2018 · 2 revisions

Premultiplied alpha is mentioned a fair bit in game programming circles and can be confusing to newbies. It means that each pixel's component colors (red, green and blue) are multiplied by its opacity (alpha) at some point before it is drawn:

r = r * a
g = g * a
b = b * a

The most common questions about this are "wouldn't this just make the semi-transparent parts of the image darker?" - or more curtly "why bother?"

See the below articles:

Important fact: the chap who wrote the above blog post also wrote Allegro 1.0. Buy him a beer.

Clone this wiki locally