Apple Shake 4 User Manual

Page 428

Advertising
background image

428

Chapter 15

Image Processing Basics

Now things get a little odd. To reassert the mask, you might be tempted to insert
another IMult node after Add2, and connect the munch_mask node to the IMult3
background input. The image is premultiplied again and appears to work.

Although this looks fine, mathematically speaking, there is an error. You need to have
the correct compositing equation:

Comp

= (Fg * A) + ((1-A)*Bg)

But, in fact, the above example multiplies the foreground twice (there are two IMult
nodes), so you have this:

Comp

= (Fg * A * A) + ((1-A)*Bg)

While this solution appears to have worked in this example, further manipulation of the
resulting image data can reveal problems further down the tree. To test to see if this
solution looks fine in all cases, switch the Add node to a ContrastLum node.

To test the equation:

1

In the Node View, select the Add (Add2) node in the tree, then Control-click Color–
ContrastLum.

2

In the ContrastLum parameters, set the contrast value to .5.

Tree with IMult3 inserted

IAdd2

Advertising