## Digital compositing

CS 248 - Introduction to Computer Graphics
Autumn Quarter, 2002
Marc Levoy
Lecture notes for Tuesday, October 22 (last half of class)

Press here for the Powerpoint slides I showed in class (HTML or PPT or PDF).

Question for thought: What compositing formula was used to create the last slide? Treat the background, the buddha, and each airbrush stroke as a separate image having color and alpha channels. Your formula should be of the form "A op1 B op2 C op3...", optionally with parentheses, where A, B, and C are images and op1, op2, and op3 are taken from the list of 12 Porter and Duff compositing operators.

To save time in class, I didn't discuss the relationship (above) between binomial coefficients and the expectation of two independent random variables, but it's an interesting fact.

Reference: Wallace, B., Merging and Transformation of Raster Images for Cartoon Animation,
Computer Graphics (Proc. SIGGRAPH '81), Vol 15, No. 3, August, 1981, pp. 253-262.

Reference: Porter, T., Duff., T., Compositing digital images,
Computer Graphics (Proc. SIGGRAPH '84), Vol. 18, No. 3, 1984, ACM, pp. 253-259.

I didn't have time in class to show Wallace's 1981 formulation (without pre-multiplied alpha). In any case, Porter and Duff's 1984 formulation (with premultiplied alpha) is more convenient, and it leads naturally to an elegant algebra. For more details about these formulations, and discussion of the history of digital composition, click here.

levoy@cs.stanford.edu