Previous | Next --- Slide 56 of 85
Back to Lecture Thumbnails
pslui88

Premultiplying alpha has another benefit. If we did not premultiply the r,g,b values by alpha and treated them separately, then we can get incorrect color outputs, as shown in this slide. Here, we imagine a 2x2 window at the edge of the leaf and red background, where the alpha window is like a mask with white on the left and black on right so that the desired final image only keeps the green of the leaf. If we happen to filter our window, the color and alpha windows will be separately filtered, the color one turning into a yellow, and the alpha turning into a gray. The final composite will be a light yellow. On the other hand, if we had premultiplied our input color window by our alpha window, then the green samples would remain and the red would be zeroed out, so when we apply the filter, we would get a correct mid-green color.

tsk

I personally find this slide explains the additional benefit of premultiplied alpha better than the previous example that includes a blue ball with a yellow background.

Please log in to leave a comment.