Difference Matte

Difference Matte operator properties for Script Engine. Builds a transparency matte by comparing the current frame against a reference still (a clean plate of the empty background) and treating any pixels that differ as foreground. Useful for locked-off camera shots that do not use a green/blue screen, security camera extraction, museum or product shots against a fixed wall, and any situation where the camera is static and only the subject moves. Sensitive to camera shake and lighting changes — pair with a stable mount and consistent lighting for best results.

Property Type Access Description
ShowAdvancedOptions bool get/set Reveals additional fine-tuning controls (colour tolerance, refinement, debug). Leave off for simple use; turn on when you need to tune individual channels or matte morphology.
CleanPlatePath Uri get/set Path to the still image of the empty background (no subject). Capture the clean plate with the exact same camera, lens, exposure, and lighting as the live shot.
ReloadCleanPlateCmd Command get Reload the clean plate image from disk — use after replacing the file on disk without changing its path.
Threshold int get/set Minimum difference required for a pixel to count as foreground. [min=0, max=100, default=10]. Lower to catch subtle differences (more sensitive); raise to ignore camera noise and small lighting changes.
Softness int get/set Width of the soft transition around matte edges. [min=0, max=100, default=20]. Raise for natural feathered edges; lower for crisper hard edges.
PreBlur int get/set Smoothing applied before comparison to reduce sensitivity to noise. [min=0, max=10, default=0]. Raise if noisy footage is producing speckled edges; keep at 0 for clean, low-noise sources.
DiffMode DifferenceMode get/set How the difference between frames is measured (RGB average, Luminance, Max Channel). Luminance is forgiving of slight colour shifts; Max Channel is most sensitive; RGB is balanced.
RedTolerance int get/set Tolerance for red-channel differences. [min=0, max=50, default=0]. Raise to ignore small red shifts (e.g. warming light); lower to catch every difference.
GreenTolerance int get/set Tolerance for green-channel differences. [min=0, max=50, default=0]. Raise to ignore small green shifts; useful when live lighting drifts slightly from the clean plate.
BlueTolerance int get/set Tolerance for blue-channel differences. [min=0, max=50, default=0]. Raise to ignore small blue shifts (e.g. cooling light); lower to catch every difference.
ExpandContract int get/set Grows or shrinks the matte. [min=-100, max=100, default=0]. Positive expands (good for catching halos); negative contracts (good for choking edges away from background bleed).
Denoise int get/set Removes small isolated pixels (matte noise). [min=0, max=10, default=0]. Raise if the matte has speckles or stray pixels; keep at 0 for fine details like wisps of hair.
OutMode MatteOutputMode get/set What to output (Composite, Matte Only, Foreground Only, Difference visualisation). Switch to Matte Only or Difference while tuning to inspect the matte; switch back to Composite for the final result.
InvertMatte bool get/set Swap foreground and background regions of the matte. Use when you want to keep the static background and remove the moving subject instead.
ShowCleanPlate bool get/set Show the loaded clean plate image as the operator output (for verification).
Minilog FormattedMessage get/set Status message about clean plate loading and runtime warnings.

Inherits from: AbstractOperator, AbstractAudioMetering.

See also: Difference Matte in Operators — user-facing introduction, screenshots, and section summaries.