Table of Contents

Class PIPChromaKeySettings

Namespace
VisioForge.Core.Types.VideoCapture
Assembly
VisioForge.Core.dll

Provides configuration settings for chroma key (green/blue screen) effects in video mixing operations.

public class PIPChromaKeySettings

Inheritance

Inherited Members

Remarks

Chroma keying, also known as color keying or green/blue screen, is a technique that removes a specific color from a video stream and makes it transparent, allowing another video source to show through. This is widely used in video production for placing subjects against virtual backgrounds.

The quality of chroma key results depends on:

  • Even lighting on the chroma key background
  • Selecting the exact color of your background
  • Properly configured tolerance values
  • Subject separation from the background

Constructors

PIPChromaKeySettings()

Initializes a new instance of the VisioForge.Core.Types.VideoCapture.PIPChromaKeySettings class with default chroma green settings.

public PIPChromaKeySettings()

Remarks

Creates a chroma key configuration with standard values for typical green screen setups:

  • Color: Chroma green (RGB: 57, 162, 37)
  • Tolerance1: 10 - tight inner keying range
  • Tolerance2: 30 - moderate edge softness

These defaults work well for evenly-lit green screens with good color saturation. You may need to adjust the color to match your specific background and fine-tune tolerances based on lighting conditions.

Properties

Color

Gets or sets the chroma key color to be made transparent.

public Color Color { get; set; }

Property Value

Color

Remarks

Choose a color that matches your actual background as closely as possible. The default green value works for standard chroma green backgrounds, but you may need to adjust it based on your specific lighting and background material.

Common chroma key colors:

  • Chroma Green: RGB(0, 177, 64) or similar - most common
  • Chroma Blue: RGB(0, 71, 187) or similar - used when subjects wear green

Tip: Use a color picker tool to sample the exact color from your background for best results, rather than using generic "Green" or "Blue" values.

Tolerance1

Gets or sets the first tolerance value for color matching precision.

public int Tolerance1 { get; set; }

Property Value

int

Remarks

Tolerance1 defines the inner range of color similarity. Colors within this tolerance from the key color are made fully transparent. Lower values create a tighter key (fewer colors keyed out), while higher values key out a broader range of colors.

This works in conjunction with VisioForge.Core.Types.VideoCapture.PIPChromaKeySettings.Tolerance2 to create a soft-edged key. Tolerance1 should typically be set lower than Tolerance2.

Tuning tips:

  • Start with low values (5-15) for clean, evenly-lit backgrounds
  • Increase gradually if the background isn't fully removed
  • Too high values will key out colors in your subject (e.g., green eyes, clothing)

Tolerance2

Gets or sets the second tolerance value for edge softness and color transition.

public int Tolerance2 { get; set; }

Property Value

int

Remarks

Tolerance2 defines the outer range of the key. Colors between Tolerance1 and Tolerance2 from the key color are made partially transparent, creating a soft edge transition. This helps eliminate harsh outlines and green/blue spill around subject edges.

The difference between Tolerance2 and Tolerance1 determines the softness of the key:

  • Small difference (e.g., Tol1=10, Tol2=15): Hard edge, good for clean backgrounds
  • Medium difference (e.g., Tol1=10, Tol2=30): Balanced edge softness (default)
  • Large difference (e.g., Tol1=10, Tol2=60): Very soft edge, good for spill suppression

Important: Tolerance2 must be greater than or equal to Tolerance1. If you experience color spill or green/blue fringing, increase Tolerance2 while keeping Tolerance1 relatively low.