Wednesday, 16 January 2013

Premultiplication Illustrated


Premultiplication Illustrated

Premultiplication exists for one reason only: so that rendered
images have realistic, anti-aliased edges before they are
composited. Without it, a 3D rendering of a silver spaceship
against a plain black background would appear to have a
crude, blocky outline because the edge pixels would not
contain any of that black background. It’s as if the ship has
already been composited against a solid color and needs to
be uncomposited before it can be composited again.
When you ask After Effects to “guess” how to interpret the
footage (on import, by choosing Guess in the Interpret
Footage dialog, or pressing Ctrl+Alt+G/Cmd+Option+G),
it looks for indications of a solid color background multiplied
into edge pixels, indicating that the setting should be
Premultiplied.
Imagine the background value to be 0,0,0 or solid black;
an edge pixel is multiplied by 0 (making it pure black)
and then added back to the source, in proportion to
the amount of transparency in the alpha channel pixel.

Removing edge multiplication with the Premultiplied setting
subtracts this extra black from those edge pixels.
The close-ups in Figure 3.10 show a section of the same
foreground image with two alpha interpretations, one
interpreted correctly, the other not. A misinterpreted
alpha either fails to remove the background color from
the edge pixels or removes color that should actually be
present.

You may fi nd that fringing appears in your comps despite
your careful managing of the alpha channel interpretation
on import. This does not indicate some bug in After
Effects, but rather a mystery you must solve. There are two
basic ways it can occur:
. An alpha channel is misinterpreted in Interpret
Footage.
. Edge multiplication is added within After Effects, probably
unintentionally, by applying a matte to a layer that
has already been matted.
Unfortunately, artists who misunderstand the underlying
problem will resort to all sorts of strange machinations to
fi x the black edge, ruining what may be a perfectly accurate
edge matte.



No comments:

Post a Comment