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

If we don't "un-premultiply" and just store the value C' in a buffer, would that mean the next time we composite colors C' and D, C' is already premultiplied and doesn't need the RGB * a computation at the beginning?

uhhh

That seems to be the case. If we do several alpha compositions, then we do not need to divide at each step, instead we can do it once at the end.

JeenaYin

I agree. If we don't "un-premultiply" we just wouldn't know the original alpha value or the color value.

motoole2

Yes, both @uhhh and @JeenaYin are correct. Our composition operator for non-premultiplied colors cannot be used repeatedly, because the input is non-premultiplied colors and the output is a premultiplied color (i.e., it depends on the alpha value); this was highlighted here. However, the composition operator shown here for premultiplied colors can be applied repeatedly, because both input and output are premultiplied colors.

I'll also point out that the slide is a bit misleading; we don't always want to apply the un-premultiply division step at the end. For example, consider rendering a red object with 50% transparency, given by [1 0 0 0.5], over a black background. We typically want the resulting appearance to be the premultiplied version of the RGB values [0.5 0 0], and not [1 0 0]. The un-premultiply step is only necessary when we are interested in storing/visualizing the color values separately from the alpha.