Previous | Next --- Slide 54 of 85
Back to Lecture Thumbnails
anthonychen

Does this mean that the non-premultiplied alpha applies alpha to the upsampled blue colors twice and causes the blue pixels on the edge to be twice as transparent? I'm still a little confused about this and I'm wondering whether this could be mitigated by changing the operation a bit.

manuforo

I'm still a bit confused by this. On the next slide there is an equation for how to do this correctly: upscaled color + (1-alpha)*background = composite image with no fringe.

What's the equation for what's going on in this slide?

alpaca

My intuition for non pre-multiplied alpha artifacts: Suppose we mix 2 colors. Final color: mix of original colors. Final alpha: mix of original alphas. Before rendering, we post-multiply this mixed alpha with our mixed color. Now, suppose one of the original alphas was 0 => we don't want any of its color mixed in the final result. However, we multiply some of it (since it is a part of the mixed color) by the mixed alpha > 0 => its contribution ends up being > 0.

alpaca

@manuforo These should be the equations on top of slide 50. Suppose we have two colors C1 and C2. On this slide, we mix colors: red = C2.alpha * C2.red + (1 - C2.alpha)C1.alpha C1.red. Mix alpha: alpha = C2.alpha + (1 - C2.alpha)C1.alpha. I think important part is that the final color channels have some of each color (C1 and C2) and final alpha has some of each alpha(C1.alpha and C2.alpha). So if one color had alpha 0, now it is part of a color with non-zero alpha and has a non-zero contribution.

alpaca

Clarification. There are multiple steps: 1. Start with fully transparent background (each pixel 0, 0, 0, 0). 2. Render blue circle on top. 3. Compose it with yellow background. In step 2 one of the blended colors is black (0, 0, 0). At the end of step 2 we have a mixed color and a mixed alpha. In step 3. we multiply this step 2 mixed alpha by step 2 mixed color => black contribution becomes non-zero.

Please log in to leave a comment.