silhouette-2023.5 : Nodes : Power Matte
Power Matte
Description
Power Matte is an easy to use interactive image matting tool capable of extracting almost any object in an image--even if you are dealing with fine hair detail, smoke, or reflections.
To work this magic, Power Matte iteratively estimates the transparency value for every pixel in the image, based on a small sample of foreground (what you want to cut out) and background (what you want to get rid of) pixels marked by defining simple shapes on the image. Results show that compared with previous approaches, our method is more efficient and requires minimal effort to extract high quality mattes for foregrounds with significant semi-transparent regions. In addition, the foreground edge colors can be estimated in the semi-transparent areas to create a seamless composite.
Go to the Power Matte tutorial to see how it works.
Since shapes are required for Power Matte, it has its own shape tools similar to those in the Roto node. See the Roto Node for more information.
Node Group
Key, Silhouette.
Matte Creation
Power Matte uses open or closed shapes to define the object you would like to isolate or extract. The shapes can be loose--they don’t need to follow exactly around the edges. Areas not defined by shapes are considered unknown areas and are automatically computed by Power Matte.
Trimaps
Power Matte creates mattes by using a trimap--a pre-segmented image consisting of three regions of foreground (what you want to cut out), background (what you want to get rid of) and unknown (neither foreground or background).
Partial opacity values are then computed only for pixels inside the unknown region. Three trimap methods can be used: Open Shape, Closed Single Shape and Closed Multiple Shapes.
Open Shape Workflow
Power Matte only requires a few open shapes to define foreground and background areas of the image when using the Open Shape Method. Areas not defined by shapes are considered unknown areas with partial opacity values being computed between the areas marked by foreground and background shapes.
Using the shapes, Power Matte generates an intermediate matte result called a Trimap. White signifies solid foreground, black is complete background and gray is unknown area where Power Matte will compute partial opacity.
The Open Shape Method requires little user input, but when color ambiguity exists between the foreground and background, the Closed Shape Method may create a more accurate matte. In addition, the Open Shape Method will also take slightly longer to render as it requires an extra calculation step.
Open Shape Method Tips & Tricks
Make sure you draw enough foreground (what you want to cut out) and background (what you want to get rid of) shapes. A good technique is to draw an open inner shape within the object you are extracting and an outer, open shape outside the object.
The shapes should be near the boundary of the object, but not right up against the edge.
If the foreground or background has varying colors, the shapes should cover these colors.
When viewing the matte, if you see gray areas in the foreground object that should be completely white, make additional foreground shapes in those areas. If you see gray matte areas in the background that should be completely black, make additional background shapes.
The general rule is to not put different foreground and background shapes too close together unless you need to.
Warning: If you only provide a few sparse shapes, the Open Shape Method will take longer to process with a less accurate result than the Closed Shape Method.
Closed Shape Workflow
The closed shape workflow uses either single or multiple shapes.
Single Shape
A single closed shape with a feathered area defines the entire trimap. Type > FG+Unknown assigns the closed portion of a shape as foreground, the feather region as unknown and the rest as background.
Closed Single Shape Method Tips & Tricks
First, define foreground areas by drawing a closed shape around the inside edges of the foreground (what you want to cut out).
Define the unknown region (transparent pixels whose actual values are not completely foreground or background) using the Feather tool. In other words, the unknown region should include hair detail, transparent or blurry portions of the image.
Note: Large foreground objects take longer to process than small ones.
Multiple Shapes
Closed shapes are used to mark definite foreground and background areas of the image. Any unmarked areas are considered unknown and partial opacity values are then computed for the pixels inside the unknown region. So, make sure that any hair detail, transparent or blurry portions fall within the unknown areas.
Closed Shape trimaps process slightly faster than Open Shape trimaps and can result in extracting a more accurate matte, most notably when color ambiguity exists between the foreground and background. However, they can be tedious to create and tend to fail for images with large portions of semi-transparent foreground where the trimap is difficult to create manually.
Note: The Closed Shape method does not handle a foreground object with background holes. Instead, use the Open Shape method when extracting an object with holes.
Closed Multiple Shape Method Tips & Tricks
First, define foreground areas by drawing a closed shape around the inside edges of the foreground (what you want to cut out).
Next, define background areas (what you want to get rid of) by drawing a closed shape around the background areas.
If your foreground object is completely surrounded by background, a quick way to define the background area is to first draw a closed shape around the outside of the foreground and then invert the shape in the Object Parameters.
Ideally, the unknown region (the regions not defined with foreground or background shapes) should only cover transparent pixels whose actual values are not completely foreground or background. In other words, the unknown region should include hair detail, transparent or blurry portions of the image.
Note: Large foreground objects take longer to process than small ones.
Shape Parameters
Type
FG
Assigns the shape to be used as foreground (what you want to cut out).
BG
Assigns the shape to be used as background (what you want to get rid of).
FG+Unknown
Assigns the closed portion of a shape as foreground, the feather region as unknown and the rest as background. In this manner, a result is produced using a single shape.
Filled
Determines whether or not the shape is filled.
Invert
Inverts a filled shape. This option is only available if Filled is enabled.
Node Parameters
When the Power Matte node is being edited in the Trees window, parameters specific to Power Matte node can be adjusted in the Node parameters.
Source Alpha
Controls how the incoming alpha channel is blended with the Power Matte alpha channel.
Ignore
The incoming alpha channel is not used.
Add
Adds the incoming alpha channel to the Power Matte alpha channel.
Subtract
Subtracts the incoming alpha channel from the Power Matte alpha channel.
Multiply
Produces a result where there is a union of pixels from the incoming alpha channel and Power Matte alpha channel.
Difference
Produces a result where a value exists in the incoming alpha channel and Power Matte alpha channel, but not in both.
Color Estimation
Estimates the color of the foreground in unknown and semi-transparent areas. Color Estimation is off by default and when activated, prevents fringing to create a seamless composite. When disabled, a foreground object with transparent edges against a bright or dark background will have bright or dark edges in the composite.
Note: Color Estimation can cause color flickering in edge areas of partial opacity if your shape position is not constant from frame to frame or if your source footage is grainy. Disable Color Estimation if you see flickering in the edge areas after a preview or rendering.
Sensitivity
Sets the sensitivity of the Unknown areas. The higher the value, the more details are brought out.
Deartifact
Blurry artifacts can be generated while attempting to extract objects that have drop shadows, similar colors to the background or out of focus edges. Deartifact can be used to limit these artifacts.
Accuracy
The accuracy of the generated matte can be increased with this control. When foreground and background shapes are close together, setting the Accuracy to Higher or Full will result in a more accurate matte.
Note: It is best to work with Power Matte at the Accuracy setting that you will be rendering at.
Normal
Normal will work for most images and will render faster than the other settings.
Higher
Higher results in better accuracy than the Normal setting, but not quite as good as Full.
Full
Full will result in the most accurate matte, but will take longer to render.
Color Suppression
When a foreground object has been photographed against a solid blue or green backdrop, the blue or green color can have a tendency to spill onto the foreground object. When extracting an object photographed against one of these colors, you may find it necessary to remove the blue or green spill. This is a process called Color Suppression.
Type
Selects whether blue or green is suppressed from the foreground image.
Foreground
Suppresses color spill in the foreground.The default value of 100 should be sufficient for most situations.
Range
Increases the range of areas that are color suppressed. If color spill is still evident, increase this value.
Edge
Suppresses the color spill of the unknown edge areas to the color gray. This is useful for edges that contain a lot of neutral transparency like glass reflections.
Reset All
Resets all parameters to their default state.
Node Outputs
Output
Outputs the foreground input and generated matte.
Composite
Outputs a composite of the foreground over the background based on the generated matte.
Trimap
Outputs the generated trimap.