Understanding Primatte


In this lesson, we'll use Photron's Primatte chroma-keying system. To use Primatte effectively, you need to understand the application and how it works. Primatte constructs a 3D space defined by three concentric partial spheres. Through a series of color scrubs, Primatte places colors along red, green, or blue axes in the 3D space and assigns them to one of four different zones.

Zone 1 is the complete background image; zone 2 is the foreground image with spill suppression and transparency; zone 3 is the foreground image with spill suppression; and zone 4 is the complete foreground image, 100 percent opaque with no spill suppression. As you scrub on an image, Primatte pushes and pulls on the partial spheres based on which function you use, creating dents and bumps on the surfaces. The position of the dents is determined by the pixel values as located on the RGB axes.

Visualizing a Primatte key in 3D color space would look something like this:

Pixels are distributed according to their color values and are manipulated based on their positioning within that 3D space.

Primatte Functions

Each Primatte function assigns pixels to a certain zone:

  • Background When this mode is selected, the sampled pixels within the image window are pixels known to be 100 percent background. The matte is completely black.

  • Foreground When this mode is selected, the sampled pixels within the image window become 100 percent foreground. The color of the sampled pixels are the same color as in the original foreground image. The matte is completely white.

  • Fine Tuning: spillSponge When this mode is selected, the cursor motion in the spillSponge slider performs a color adjustment of the sampled color against the background. After sampling a color region from the image, the farther to the right the cursor moves, the less of the foreground color component (or spill) is included in that color region. The farther to the left the cursor moves, the closer the color component of the selected region will be to the original foreground image. This is similar to the more automatic but less controllable individual Spill Sponge operator.

  • Fine Tuning: fgTrans This mode adjusts the transparency of the matte against the sampled color. After sampling a color region from the image, the farther to the right the cursor is, the more transparent the matte becomes in that color region. This is equivalent to Make FG Trans but offers more control.

  • Fine Tuning: detailTrans This determines the transparency of the sampled color, which is closer to the background color. The slider in this mode is useful for restoring the color of pixels that are faded because of a similarity to the background color. If you slide to the left, picked areas are more opaque. This is equivalent to Restore Detail but offers more control.

  • Matte Sponge This is used to restore foreground areas lost during spill suppression. It affects only the alpha channel.

The following are more automatic but less controllable functions:

  • Spill Sponge This affects the color of the foreground but not the matte. It suppresses the color you pick. This is usually used on spill areas that are known to be opaque, such as blue spill on the face or body. If the change is too drastic, supplement or replace the operation with Fine Tuning: spillSponge.

  • Make FG Trans This gives foreground material more transparency and is used for adjusting elements such as clouds or smoke. It is the equivalent of Fine Tuning: fgTrans, except it has no slider control.

  • Restore Detail This removes transparency on background material. It is useful for restoring lost details such as hair. It is the equivalent of Fine Tuning: detailTrans but doesn't have a slider.

If you are interested in delving further into Primatte, visit www.primatte.com. The site has an excellent white paper with enough technical information to make your head spin.

Viewing Your Clips

Before you begin, you'll need to load the clips.

1.

Open Shake.

2.

Click FileIn on the Image tab and select the bg.1-58.iff, gs.1-58.iff, gs_comp.1-58.iff, and reflection.1-58.iff clips from the Lesson10 folder.

All of these clips are 1920x1080 (HD resolution), so they take longer to load and will take a bit longer to process. It's probably a good idea to use a proxy.

3.

Click the Proxy button and select P2.

This sets the proxy resolution to ¼ which will speed up processing. You can now view the final shot.

4.

Place your cursor over the Viewer and press the F key.

This fits the image to the Viewer.

5.

Go to the Globals tab and set the timeRange to 1-58.

6.

Click the Home icon on the bottom right of the interface to set the Time Bar to the same range as the Globals.

7.

Double-click the gs_comp clip to select it.

8.

Click the Flipbook icon and play the clip.

For this shot, you will create a key of the woman and place her over a background. Then, you will add a moving reflection element after stabilizing its motion.

9.

Close this flipbook and make another one of the gs clip.

This is your green screen element, and boy, it's a doozy. The unevenly lit background and the amount of grain will present a real challenge.

10.

Double-click the bg clip to see it in the Viewer.

The background is your standard industrial metal backgroundhand-forged, no doubt, by Old World artisans.

Creating the Key

When you create a key, also known as a matte, the foreground object that you are attempting to extract should be white in the alpha channel. The colored areas of the blue or green screen ideally would appear as black in the alpha channel. Elements such as smoke would likely have some transparency and show up as gray.

1.

Drag the Time Bar to frame 55.

2.

From the Key tab, right-click the Primatte node and choose Create.

You probably noticed that the Primatte node has quite a few inputs.

Primatte Inputs, from Left to Right

Parameter

Function

Foreground

This is the blue or green screen image.

Background

This is the background image.

garbageMatte

This is used to get rid of rigging or other elements you want to be transparent when they are otherwise not pulled by the keying operation.

holdoutMatte

This is a matte input for areas that you want to be opaque.

defocusedFg

This is used to create a blurred version of the blue screen to help deal with grain variation for film plates; typically you would attach a Blur node to the blue screen footage and insert it here.

replaceImage

You can do spill suppression with a solid color, with the background image (when no replaceImage is supplied), or with an alternate replaceImage to supply the color that will go into spill-suppressed areas. Common inputs for this are bg, bg with Blur applied to it, fg with Blur applied to it, fg with Monochrome applied to it, or fg with AdjustHSV attached to it.


3.

Connect the gs clip to the far-left input of the Primatte node and the bg clip to the second input.

The Primatte node has a lot of parameters, so it's a good idea to change the layout of your interface.

4.

Click the dividing line between the Parameters workspace and the Node workspace, and drag the line up to give yourself more room in the Parameters workspace.

The interface should look like this:

Now you can see all the parameters without having to scroll the window. Primatte works by picking a Center value, meaning the average color of the key you want to pull. Primatte is ready to scrub your background color as soon as you add the node.

5.

In the Viewer, drag across a small section of the green screen.

Initially nothing will happen, because Primatte is set to output Alpha Only by default. If you are not viewing the alpha channel in the Viewer, you won't see anything. If you want to see the composite, switch from Alpha Only to Comp in the Output parameters.

6.

In the Output parameters, click Comp.

You can now see a preliminary composite. It needs worklots of work.

The matte is weak, so the woman looks like a ghost.

7.

Set the Output mode back to Alpha Only.

8.

Look at the alpha channel in the Viewer.

You will notice that there are gray values for both the woman image and the background.

9.

Click the Foreground button and drag across the gray areas of the woman's face.

This step tells Primatte to consider the gray pixels in the woman's face as foreground (opaque) material. As you have probably figured, it's going to take more than one swipe to remove the gray values inside the face, but don't go crazy. Each swipe produces a "harder," more opaque matte. Making the key too hard, either in the black background or white foreground areas, will result in lousy edges. Your goal is to remove as much of the gray as possible. The rest we will take care of with rotoshapes.

10.

Repeat the previous step multiple times until most of the gray areas within the woman's face are gone by clicking the Foreground operator and then sampling areas in the Viewer.

After your foreground swipes, your alpha channel should look something like the image on the following page.

Because background gray values also exist, you should click the Background button and drag that away as well. Do this even if you can't see any impurity in the background. Your monitor will often disguise noise hiding in the background. This is not a problem here, however.

11.

Click the Background button and drag to the right of the woman's left shoulder (screen right), being careful not to scrub into the completely white areas.

12.

Click the Background button again and drag to the right of the woman's left ear (screen right).

Note

For foreground and background scrubs, you can drag as much as you want. For the other scrubs, use very fine, short scrubs.

After your background swipes, your matte should look like this:

Tuning Your Matte

Using rotoshapes, we will create a garbage matte for the areas of the background that should be transparent (black in the alpha channel) and a holdout matte for inside areas of the face that should be opaque (completely white in the alpha channel). These shapes can be plugged directly in to the Primatte inputs.

Garbage mattes are used to mask off unwanted areas of the background like set equipment or crewmembers eating doughnuts; holdout mattes are used to fill in holes within the interior of the matte.

1.

Select a RotoShape node from the Image tab.

2.

Set the Res parameter to 1920x1080.

3.

Click the left side of the Primatte node so that you can see the alpha channel.

4.

Draw a shape that surrounds the gray and white values in the background.

This shape will be used for the garbage matte.

5.

Select Main mode from the RotoShape Viewer toolbar and pull out a point over the woman's right shoulder (screen left).

A soft edge is created in this region of the rotoshape.

6.

Watch the magic happen as you connect the output of RotoShape1 to Primatte's garbageMatte inputthe third input from the left.

The garbage matte removes the unwanted areas from the background. The holdout matte is next and will fill in the foreground areas of the woman.

7.

Select another RotoShape node from the Image tab.

8.

Set the Res parameter to 1920x1080.

9.

View the Primatte node while editing RotoShape2.

10.

Draw a shape around the inside of the woman similar to the shape below.

She moves slightly from right to left, so don't draw too close to her edge.

11.

Connect the output of RotoShape2 to Primatte's holdOutMatte inputthe fourth input from the left.

The foreground is filled in with the area of the shape. Our matte is actually starting to look like it's going to work.

12.

Click the Proxy button to deactivate it.

When performing keying functions, it is best to double-check your results every once in a while at full resolution, as the proxy can hide imperfections in the matte.

13.

Set the Output parameter to Comp.

14.

Look at the RGB channels in the Viewer.

When working at full resolution, you can activate the Viewer DOD (Domain of Definition).

The Viewer DOD isolates an area and speeds up all image processes.

15.

Turn on the Viewer DOD button in the Viewer toolbar.

16.

Drag the corner handles to crop the image.

Now, take away some green spill from the woman's hair.

17.

Zoom in to the woman's hair.

18.

Click the right side of the Primatte node to reload its parameters.

19.

Select Spill Sponge and scrub a green strand of the woman's hair.

The green spill is removed.

20.

Click the Active button to toggle the spill sponge operation on and off to see what it is doing. Leave the Active button on when you are done.

You may want to use Fine Tuning: spillSponge instead, because it gives you more control.

21.

Click Delete Op to remove the spill sponge operation.

Undo and Primatte are not on speaking terms, but if you are using the trial version of Shake, you don't know what Undo is anyway. You are in luck nonetheless: To remove an operator, just click the Delete Op button.

22.

Drag the currentOp slider all the way to the left.

Notice how you toggle through the operations you have already performed. By parking the currentOp slider at a particular point, you can modify, delete, or insert a new operation. Nice, huh?

23.

Click evalToEnd to turn it off, and drag the currentOp slider back and forth.

Turning off evalToEnd shows you the Primatte composite only up to the operation that you are parked on. This helps you examine all the various steps that went into the creation of your key.

24.

Click evalToEnd to turn it back on, and drag the currentOp slider all the way to the right.

25.

Select Fine Tuning and scrub again on a green strand of hair.

26.

Move the spillSponge slider all the way to the right.

The green spill is now under control.

Another useful Primatte function is the Status feature, which checks the values in your key. The Status output gives you a color code to determine where each of the pixels is positioned in the four Primatte zones:

27.

Deactivate the Viewer DOD and fit the image to the Viewer.

28.

Click the Output Status button.

Primatte zones:

  • Black, zone 1

    All background

  • Blue, zone 2

    Transparent foreground

  • Green, zone 3

    Suppressed foreground

  • Red, zone 4

    All foreground

Compositing the Shot

The first part of this shot is almost done, but it needs some color correction and additional matte treatment. It would be best to complete the composite outside of Primatte. The output setting determines what is changed by Primatte:

  • Alpha Only Primatte affects only the matte.

  • On Black Primatte affects both the foreground image and the matte.

  • Comp If you have an optional second input image, this will composite the foreground with the background.

  • Status This special output gives you a color-coded image to determine where each of the pixels is positioned in the four Primatte zones.

1.

Click the Alpha Only button.

Alpha Only will output an unaffected foreground along with its alpha channel. This will negate the spill suppression in the Primatte, but we will compensate for it later with color correction.

2.

Click the dividing line between the Parameters workspace and the Node workspace, and drag the line down to give yourself more room in the Node workspace.

3.

Click the Node View tab so that you can see your tree.

Matte Treatment

This shot's matte has some impurities in the background and is a bit ratty, so you're going to work on it by using a DilateErode node.

1.

Highlight the Primatte node.

2.

From the Filter tab, add a DilateErode.

DilateErode isolates each channel and cuts pixels away or adds them to the edge of the channel. It is good for either growing or shrinking mattes. For example, if you wanted to eat into your matte, you would set your channels to a for the alpha channel and then set the Pixels to a value of 1. In contrast, a positive value would grow the matte. By default, you are working with whole pixels, but you can switch to subpixel precision by toggling on Soften. Note that the Soften parameter really slows the function down. I recommend low values for the Pixel parameter if you are turning on the Soften feature. When Soften is turned on, the Sharpness parameter controls how soft the edge is.

3.

In the Channels parameter, delete rgb so that only the letter a shows.

DilateErode will now affect only the alpha channel.

4.

View the alpha channel in the Viewer.

5.

Set the Pixel parameter to a value of 2.

The DilateErode node has chewed into the matte slightly.

6.

Activate Soften to turn on subpixel erosion of the edge.

DilateErode removes some of the background impurities and shrinks the matte slightly. Next, you will composite the woman over the background.

7.

Click the Proxy button and select P2.

8.

View the RGB channels in the Viewer.

9.

Add an Over node from the Layer tab and connect an output of bg to the right input.

10.

Turn on preMultiply.

The composite is working pretty well so far except for the color balance of the woman in comparison with the background.

Color-Correcting the Shot

Try color-correcting the shot so that the woman's face is darker and bluer.

1.

Highlight DilateErode1 in your tree.

2.

From the Color tab, select a Mult and then a Brightness node.

3.

Set the Value parameter to 0.8.

The brightness of the two elements matches.

4.

Click the right side of the Mult1 node so that you can edit its parameters.

5.

Expand the two Color subtrees and set red to 0.85, green to 0.89, and blue to 1.2.

6.

Click the Flipbook icon to check your progress.

The color match works for me now.

7.

Close the flipbook when done.

8.

Fit the image to the Viewer so that you can see the entire image.




Apple Pro Training Series. Shake 4. Professional Compositing and Visual Effects
Apple Pro Training Series. Shake 4. Professional Compositing and Visual Effects
ISBN: 321256093
EAN: N/A
Year: 2005
Pages: 156

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net