Graphics Reference
In-Depth Information
Inline Exercise 17.2: Explain why, in the dissolve operation, we had to multi-
ply the “rgb” values by s , even though we were merely altering the opacity of
the pixel.
The dissolve operation can be used to create a transition from one image to
another:
blend ( U , V , s )= dissolve ( U , ( 1
s )) + dissolve ( V , s ) ,
(17.7)
where component-by-component addition is indicated by the + sign, and the
parameter s varies from 0 (a pure- U result) to 1 (a pure- V result).
α U and
α V are both between zero
Inline Exercise 17.3: Explain why, if
and one, the resultant
α
-value will be as well so that the resultant pixel is
meaningful.
Image operations like these, and their generalizations, are the foundation of
image editing programs like Adobe Photoshop [Wik].
17.4.4.1 Problems with Premultiplied Alpha
Suppose you wrote a compositing program that converted ordinary RGBA images
into premultiplied-
images internally, performed compositing operations, and
then wrote out the images after conversion back to unpremultiplied-
α
images.
What would happen if someone used your program to operate on an RGBA image
in which the
α
α
-values were already premultiplied? In places where
α
= 0, it
would make very little difference; the same goes for
= 1. But in partially opaque
places, the opacity would be reduced. That would make background objects
show through to the foreground more clearly. In practice, this happens fairly
frequently; it's a tribute to our visual system's tolerance that it does not tend to
confound us.
α
17.4.5 Physical Units and Compositing
We've spoken about blending light “intensity” using
-values. This has really
been a proxy for the idea of blending radiance values (discussed in Chapter 26),
which are the values that represent the measurement of light in terms of energy.
If, instead, our pixels' red values are simply numbers between 0 and 255 that
represent a range from “no red at all” to “as much red as we can represent,”
then combining them with linear operations is meaningless. Worse still, if they
do not correspond to radiance, but to some power of radiance (e.g., its square
root), then linear combinations definitely produce the wrong results. Nonetheless,
image composition using pixel values directly, whatever they might mean, was
done for many years; once again, it's a testament to the visual system's adaptivity
that we found the results so convincing. When people began to composite real-
world imagery and computer-generated imagery together, however, some prob-
lems became apparent; the industry standard is now to do compositing “in linear
space,” that is, representing color values by something that's a scalar multiple of
a physically meaningful and linearly combinable unit [Rob].
α
 
 
 
Search WWH ::




Custom Search