Previous | Next --- Slide 29 of 53
Back to Lecture Thumbnails
kayvonf

Question: Someone work out the math for compositing an alpha=25% red (1,0,0) surface over an alpha=50% yellow (1,1,0) surface over an alpha=50% black surface (0,0,0). Use the premultipied alpha form.

jmrichar

premultiplied values: R = (.25,0,0,.25) Y = (.5,.5,0,.5) B = (0,0,0,.5)

result = over(R,over(Y,B)) over(Y,B) = Y + (1-Y_alpha)B = (.5,.5,0,.5) + (.5)(0,0,0,.5) = (.5,.5,0,.75) over(R,over(Y,B)) = (.25,0,0,.25) + (.75)*(.5,.5,0,.75) = (.25,0,0,.25) + (.375,.375,0,.5625) = (.625,.375,0,.8125)

kayvonf

@jmrichar. Great!