Matte
Processes one or more matte inputs to cut out regions of a source image, with per-input channel selection, combine modes, and feathering. Also used for cross-layer track mattes.
Category: Composite Menu path: Composite > Matte
Ports
| Port | Type | Direction | Description |
|---|---|---|---|
source | imageRgba16f | input | Source image to be matted |
matte1 | imageRgba16f | input | First matte input |
out | imageRgba16f | output | Source with matte applied |
matte_out | imageRgba16f | output | Grayscale matte mask (for inspection or downstream use) |
Additional matte inputs (matte2, matte3, ...) can be added dynamically using the "+" button on the node header.
Parameters
Per-Matte Parameters
Each matte input has its own channel and invert controls. For the first matte:
| Param | Type | Default | Description |
|---|---|---|---|
channel1 | enum | Alpha | Which channel to extract from the matte image. Options: Alpha, Luminance, Red, Green, Blue. |
invert1 | boolean | false | Invert this matte input. |
Additional mattes get numbered params (channel2, invert2, channel3, invert3, etc.).
Global Parameters
| Param | Type | Default | Description |
|---|---|---|---|
combineMode | enum | Union | How to combine multiple matte inputs. Options: Union, Subtract, Intersect, Replace. |
feather | scalar | 0 | Gaussian blur radius applied to the combined matte mask, in pixels. Softens hard matte edges. Keyframeable. |
How It Works
The Matte node uses a multi-pass GPU pipeline:
- Extract -- Each connected matte input is processed individually. The selected channel is extracted and optionally inverted to produce a single-channel mask per input.
- Combine -- When multiple mattes are connected, they are combined using the selected mode:
- Union -- maximum of all masks (additive coverage)
- Subtract -- first mask minus subsequent masks
- Intersect -- minimum of all masks (only where all overlap)
- Replace -- last connected mask wins
- Feather -- If
feather> 0, a gaussian blur is applied to the combined mask to soften edges. - Apply -- The final mask is multiplied against the source image's alpha channel.
The matte_out port exposes the final combined (and feathered) mask as a grayscale image, useful for debugging or feeding into other nodes.
When no mattes are connected, the source passes through unchanged.
Cross-Layer Track Mattes
Track mattes can also be set at the layer level (outside the node graph) using the matte controls in the timeline layer list. Setting a layer's matteLayerId uses another layer's output as a matte source with Alpha or Luminance mode. The matte source layer is automatically hidden from the final composite. This uses the same apply_matte_v2 pipeline internally.
Usage Examples
Basic: Cut out with alpha
- Add a Matte node and connect your main image to
source - Connect a shape render (DrawShape) or image with alpha to
matte1 - Leave channel on
Alpha-- the shape's alpha cuts out the source
Creative: Luminance matte from footage
- Connect a high-contrast image to
matte1 - Set channel to
Luminance - Bright areas of the matte image reveal the source, dark areas hide it
- Use
featherto soften the transition
Advanced: Multi-matte compositing
- Click "+" to add a second matte input
- Connect different mask shapes to
matte1andmatte2 - Set combine mode to
Intersectto only show the source where both masks overlap - Or use
Subtractto punch one mask out of another - Inspect the result via the
matte_outport
Tips
- The "+" button adds new matte inputs dynamically. The "-" button removes the last one. Each new input gets its own channel and invert controls.
featheris a gaussian blur on the matte mask -- useful for softening hard edges from shape-based masks- The
matte_outport is always available and shows the combined mask. Connect it to a viewer or Debug node to see what the matte looks like. - When the source input is disconnected, no output is produced. The bypass passthrough port is
source. - For simple single-layer matting, cross-layer track mattes in the timeline are often easier than the Matte node.
Related Nodes
- Mix -- blend between two images using a mask (softer transitions)
- Merge -- layer compositing with blend modes
- ColorSplit -- extract a specific channel as a standalone grayscale image
- Blur -- alternative to feather for more control over edge softening