Previous Next
529
SECTION 7.2 Basic Compositing Computations
The result shape and opacity are given by
f r = Union ( f b , f s )
Union ( f b × q b , f s × q s )
-
q r = --------------------------------------------------------
fr
where the variables have the meanings shown in Table 7.5.
TABLE 7.5 Variables used in the result shape and opacity formulas
VARIABLE MEANING
fr Result shape
fb Backdrop shape
fs Source shape
qr Result opacity
qb Backdrop opacity
qs Source opacity
These formulas can be interpreted as follows:
• The result shape is simply the union of the backdrop and source shapes.
• The result opacity is the union of the backdrop and source opacities, weighted
by their respective shapes. The result is then normalized by the result shape,
ensuring that when this shape and opacity are subsequently used together in
another compositing operation, the opacity’s contribution is correctly repre-
sented.
Since alpha is just the product of shape and opacity, it can easily be shown that
α r = Union ( α b , α s )
This formula can be used whenever the independent shape and opacity results
are not needed.
Previous Next