Keying: Selection Tools

The Selection Tools are the heart of Primatte Keyer. They contain the “tools” of Primatte, which you will use to perform all of Primatte’s main matte extraction functions. Whatever tool you select here will determine what operation Primatte performs when you make a sample. There are four main components to the Selection tools.

• Select BG

• Clean BG

• Clean FG

• Fine Tune

Select BG

Select BG (where BG stands for Background) is the first step in creating a matte with Primatte Keyer. Select BG lets you select the color you want to remove from the frame or sequence. This first sample gives Primatte Keyer a starting point for matte creation. While the two most common screen colors are blue and green, Primatte Keyer can extract a matte from any color.

To use the Select BG tool, position the cursor in the bluescreen area of the view window, near the foreground object. Sample the targeted background color by selecting a small area with the mouse by clicking and dragging to select a range of pixels. After releasing the mouse button Primatte Keyer will start the compositing process and quickly generate a matte.

The image above shows the original bluescreen area being sampled.

The above image is the matte resulting from the initial sample operation. If the foreground image was shot on a properly lit bluescreen stage, Primatte Keyer will do 90% of the matte generation in this first step.

If you sample a range of pixels in the blue area using either the rectangular sampling method or the point sampling method, Primatte Keyer will average together the different color values of the sampled pixels to obtain a single color value to remove. In many instances Primatte Keyer works better when only a single pixel is sampled instead of a range of pixels.

For example, if the foreground image contains a shadow that you want to keep in the final composite, selecting these shadow pixels when sampling will result in the shadow being keyed out. To prevent the shadow from being included in the matte, simply click once in area outside shadow. Primatte Keyer will select only those pixels with that same color value, leaving the darker pixels of the shadow with the rest of the foreground image.

This first sample that you choose determines the initial color range, so be careful not to sample over any of the foreground area. If you do drag over the foreground area, simply undo, or click the Reset button in the Primatte controls.

Since the initial sample using the SelectBGSelect BG tool sets the center point for the Primatte algorithm, if you cannot get a good key further down in this lesson, try resetting the Primatte Keyer and starting over with a different initial sample.

 

Clean BG

The next step in the matte creation process is removing the noise from the background areas of the matte, and for this you will use the Clean BG tool. Depending on how well your bluescreen element was shot, there will be unwanted white noise areas in the black area of the matte. The Clean BG Noise tool lets you quickly sample the noise to remove it.

When the Clean BG tool is selected, you will sample pixels in the composite window known to be 100% background. White noisy areas in the 100% background region will become black.

Only sample areas that you know to be entirely in the bluescreen area and which you want completely removed. You may need to sample the noisy areas several times to clean the background area.

To remove the noise, position the cursor over the composition window and sample pixels in the noisy regions. It is best to change the View menu to Matte before starting this process.

 

Primatte Keyer will process the sampled areas and eliminate the noise.

You should sample the color key area as often as necessary to remove the noise from the background.

If you are having trouble seeing any noise, try increasing the gamma of your monitor. Increasing the gamma can make it much easier to see dark noise in the matte. Or, if you are on a flat panel monitor, try looking at the monitor from an angle. This can also enable you to see noise that is often times not visible when looking head-on.

While using the Clean BG tool to sample the background noise it is possible to accidentally cause too much detail to be removed from the foreground element. The following element shows a matte with incorrect sampling that has removed the semi-transparent hair detail from our foreground subject.

The sample region above was too close to the wispy hair, and as a result too much detail has been removed (see below).

 

There is no need to eliminate all noise in the bluescreen portions of the image. If you attempt to carefully remove all the noise around the foreground object, an accurate matte is nearly impossible to create and the resulting composite will not look convincing. You can always recover some detail later in the process using the Fine Tuning tool.

 

Clean FG

Clean FG is essentially the opposite of Clean BG, letting you sample any dark areas in the middle of the white foreground area.

When this operational mode is selected, the user samples pixels in the bluescreen element known to be 100% foreground. The color of the sampled pixels will be registered by Primatte to be the same color as in the original foreground image. This will make dark gray areas in the 100% foreground region become white. Clean FG is usually the third step in using Primatte.

To use Clean FG simply sample the image in exactly the same manner as you did when using Clean BG. Instead of sampling the dark pixels in the background area, sample the darker areas in the foreground area until they are completely white. An example sample is in the image below...

This image shows the result of that sample...

 

The same usage rules for Clean BG also apply to Clean FG. For example, these dark regions should be in areas that are supposed to be 100% foreground and white. Do not sample fine detail areas such as hair, glass or water. Avoid selecting any areas that are transition areas — areas where the foreground and background elements are going to be blended together such as the edges of the foreground objects.

Do NOT select the soft edged transition foreground and background. Selecting these regions will produce unwanted results.

 

 

Fine Tuning

The Fine Tuning controls allow you to select problem areas in your image in order to correct them, such as areas with color spill, or elements that have too little or too much transparency. The Fine Tuning controls work in conjunction with the three sliders directly beneath it, called Spill, Transparency, and Detail.

After sampling the trouble area, the three sliders will snap to whatever the current values are for the sampled pixels. Note that until the Fine Tune button is selected and a sample is made the three sliders will remain deactivated. We will now look at the function of each slider individually.

To get the most of the explanations contained below an understanding of Primatte’s internal algorithm, known as the Polyhedral Slicing Algorithm, is essential. Please refer to The Primatte Algorithm - How Primatte actually works.

Spill Slider

The Spill Slider performs a color adjustment on the foreground by controlling the amount of the background color present in the sampled foreground area. The image below shows us the foreground image. As you can see there is quite a bit of blue spill on the inside of the woman’s arm.

 

To remove this spill we will simply do a sample of the area in question.

 

Sampling on an area of spill in the foreground (above).

In the image above we see the controls before the sample. On the image below we see the sliders after the sample. Note that the sliders have snapped to the values associated with the sampled area.

The Spill Slider value represents the amount of spill removal applied to the image. To remove more spill we need to increase this value.

The image above shows the blue spill areas on the arm before the Spill Slider value was increased from 0.38 to 0.44. The image below shows it after the adjustment...

 

 

Note that only the blue spill color region has been affected, the rest of the image is unchanged. Repeat this process on all color regions with blue spill until all spill is removed. For the above example, you might select some spill in the light flesh tones, remove it, then the dark flesh tones, remove it and then sample on the red sweater color regions. The slider adjustment will only affect spill in the color region selected before moving the slider.

After performing a spill removal operation you may notice a yellow or magenta tint on the foreground. Try lowering the spill removal value to compensate for this tinting. After resampling, increase the Spill value in small increments, such as 0.1. A small value change can often result in a significant change in color to the image.

Transparency

The Transparency Slider adjusts the opacity of the matte by increasing the transparency of the sampled color range. Use the Transparency Slider to adjust the softness of foreground areas such as shadows.

As with the Spill Slider, increasing the Transparency Slider value will make the sampled area more transparent. In the example above, a sample is made of the cigarette's shadow.

The Transparency Slider's value is increased slightly and the shadow becomes more transparent.

Detail

The Detail Slider restores the visibility of foreground pixels that have disappeared because of a close similarity to the background color. Use the Detail Slider to restore lost detail like hair or smoke.

In the image above, some smoke detail had been lost during the spill removal procedure. A sample is made where the smoke used to be and the value of the Detail Slider is decreased.

 

The result is to increase the amount of detail visible in the element.

Base Color Sample

A feature added in Primatte Keyer 4 is to have a separate value for the sample color. This value is the average of the colors sampled during the Select BG stage. By having this value in its own control it enables you to set a keyframe for the background sample color, something you were unable to do in previous versions of Primatte.

Why is this useful? Let’s illustrate this feature with a real-world example. A user of a previous version of Primatte Keyer was working on a music video, featuring a singer in front of a bluescreen. The singer was illuminated from the front by an array of colored disco lights, and these colors were altering the blue color in the bluescreen on almost every frame. This made keying the shot with Primatte difficult, because previously the color sample wasn’t animatable. In Primatte Keyer, however, this is a value that you can keyframe, so you can sample different color ranges throughout the shot and Primatte will interpolate the sample color accordingly.

When you first apply Primatte to your bluescreen source the default sample color will show as black. Once you make a sample using the Select BG tool the Base Color Sample swatch will change to reflect the current sample color.

The image above shows the original swatch and the image below shows the swatch post-sample.

This value can then be keyframed using standard After Effects keyframing methods.

There is one important thing to note about the Base Color Sample. Once the base color has been sampled, all subsequent Primatte color correction functions are dependent upon the sample. If you perform any spill suppression or other correction operations on your foreground element and then alter the Base Color Sample, either by resampling the background or by animating the value manually in After Effects, all color correction operations will be lost and must be resampled. When keying a shot with animated colors in the bluescreen element it is essential that you keyframe your animated Base Color Sample before you perform any spill correction or transparency functions.