Previous | Next --- Slide 32 of 63
Back to Lecture Thumbnails
dvanmali

I am stuck trying to figure out how non premultiplied alpha computes rgb differently than premultiplied alpha. Essentially the equations are the same except for RGB except in premultiplied we carry the alpha value for each call. How does the alpha value equation change for composite vs premultiplied? The only difference I see is dividing the alpha from each and summing?

mdsavage

I think the point was that the alpha channel now blends identically to the other channels, so we could (for example) express each color as a 4D vector, and represent the over operation as a single scale and addition (with no special casing needed to handle alpha).

keenan

Essentially the equations are the same except for RGB except in premultiplied we carry the alpha value for each call.

@dvanmali With one very, very important additional thing: the R, G, and B values get multiplied by the A value before you do any other calculations (hence, _pre_multiplied). Notice that in the slide above our vector isn't [ R G B A ] but [ AR AG AB A ].