Boost Multiprecision Library
[ipdf/documents.git] / LitNotes / PorterDuffCompositing
1 Porter, Thomas and Duff, Tom, "Compositing Digital Images", Computer Graphics Vol 18, Num 3, July 1984
2
3 Compositing Digital Images
4 Thomas Porter
5 Tom Duff
6 Computer Graphics Project
7 Lucasfilm Ltd.
8
9
10 Perter and Duff's classic paper "Compositing Digital Images" lays the
11 foundation for digital compositing today. By providing an "alpha channel,"
12 images of aribitary shapes — and images with soft edges or sub-pixel coverage
13 imformation — can be overlayed digitally, allowing separate objects to be
14 rasterized separately without a loss in quality.
15
16 Pixels in digital images are usually represented as 3-tuples containing
17 (red component, green component, blue component). Nominally these values are in
18 the [0-1] range. In the Porter-Duff paper, pixels are stored as (R,G,B,\alpha)
19 4-tuples, where alpha is the fractional coverage of each pixel. If the image
20 only covers half of a given pixel, for example, its alpha value would be 0.5.
21
22 To improve compositing performance, albeit at a possible loss of precision in
23 some implementations, the red, green and blue channels are premultiplied by the
24 alpha channel. This also simplifies the resulting arithmetic by having the
25 colour channels and alpha channels use the same compositing equations.
26
27 Several binary compositing operations are defined:
28 - over
29 - in
30 - out
31 - atop
32 - xor
33 - plus
34
35 The paper further provides some additional operations for implementing fades and
36 dissolves, as well as for changing the opacity of individual elements in a
37 scene.
38
39 The method outlined in this paper is still the standard system for compositing
40 and is implemented almost exactly by modern graphics APIs such as OpenGL. It is
41 all but garunteed that this is the method we will be using for compositing
42 document elements in our project.

UCC git Repository :: git.ucc.asn.au