Skip to content

Spill Algorithms

Technical deep-dive into the 10 spill detection algorithms available in Despill Maestro.

Understanding Spill Removal

Spill suppression works by detecting where a background color (spill) has contaminated the subject, then removing or reducing that color. The key challenge is determining how much of each color channel to preserve.

Basic Concept

For green screen work:

  • Spill channel - Green (the color we want to remove)
  • Reference channels - Red and Blue (colors we want to preserve)

The algorithm compares the spill channel to the reference channels to determine how much spill exists and how much to remove.

Algorithm Comparison

AlgorithmBest ForComplexityPreserves
Channel AverageGeneral purposeMediumBalanced
Largest ChannelClean footageLowMax reference
Smallest ChannelSubtle spillLowMin reference
Limited by RedSkin tonesLowRed channel
Limited by GreenBlue screensLowGreen channel
Limited by BlueRed spillLowBlue channel
90% of RedAggressive redMediumMost red
Exceed Avg by 10%ConservativeMediumConservative
Double Green/BlueChroma channelsHighChroma balance
Double RedSkin tonesHighSkin tones

Algorithm Details

1. Channel Average

Default algorithm - Balanced approach using weighted averaging.

limit = (ref1 × ref1_weight) + (ref2 × ref2_weight)

Where weights are determined by the Channel Bias parameter:

  • Bias = 50%: Equal weighting (0.5 each)
  • Bias < 50%: Favor first reference channel
  • Bias > 50%: Favor second reference channel

Use when:

  • You need balanced, predictable results
  • Working with evenly-lit green screen footage
  • You want control via Channel Bias parameter

Example: For green spill removal:

limit = (red × 0.5) + (blue × 0.5)
spill_detected = max(0, green - limit)

2. Largest Channel

Simple and effective - uses the maximum of the reference channels.

limit = max(ref1, ref2)

Use when:

  • Footage has clean, well-lit green screen
  • You want conservative spill removal
  • Preventing removal of legitimate colors is priority

Example: For green spill:

limit = max(red, blue)

If either red or blue is high, less green will be removed.

3. Smallest Channel

Uses the minimum of reference channels.

limit = min(ref1, ref2)

Use when:

  • Dealing with very subtle spill
  • More aggressive removal is needed
  • Largest Channel is too conservative

Example: For green spill:

limit = min(red, blue)

Uses the smaller value, resulting in more aggressive removal.

4. Spill Color Limited by Red

Removes spill until the spill channel reaches the red channel value.

limit = red_channel

Use when:

  • Preserving skin tones is critical
  • Subject has warm/red tones you must protect
  • Working with green or blue spill on faces

This algorithm ensures that removal never reduces the spill channel below the red channel value, preserving reddish colors.

5. Spill Color Limited by Green

Removes spill until the spill channel reaches the green channel value.

limit = green_channel

Use when:

  • Working with blue screen footage
  • Subject has natural green tones (foliage, green wardrobe)
  • You need to preserve green channel data

6. Spill Color Limited by Blue

Removes spill until the spill channel reaches the blue channel value.

limit = blue_channel

Use when:

  • Working with red spill
  • Blue channel contains important detail
  • Subject has blue/cyan tones to preserve

7. Limit Spill Color to 90% of Red

More aggressive variant that allows spill removal beyond the red channel.

limit = red_channel × 0.9

For green spill removal, this allows green to be reduced to 90% of the red value rather than stopping at red's level.

Use when:

  • "Limited by Red" is too conservative
  • You need more aggressive skin tone despill
  • Slight color shift is acceptable for better spill removal

8. Limit to Exceed Channel Avg by 10%

Conservative algorithm that only removes spill exceeding 110% of the channel average.

avg = (ref1 × ref1_weight) + (ref2 × ref2_weight)
limit = avg × 1.1

Uses the Channel Bias parameter like Channel Average.

Use when:

  • Preservation of original color is paramount
  • Working with footage where colors are uncertain
  • You want the most conservative removal possible

This algorithm only detects spill if the spill channel is at least 10% above the reference average.

9. Double Green/Blue Average

Specialized algorithm that weights the appropriate chroma channel 2x higher.

For different spill colors:

Red spill:   limit = (2×green + blue) / 3
Green spill: limit = (red + 2×blue) / 3
Blue spill:  limit = (red + 2×green) / 3

Use when:

  • Chroma channels need enhanced preservation
  • Standard averaging doesn't preserve color separation
  • Working with saturated, colorful subjects on green screen

This algorithm recognizes that removing green spill should prioritize the blue channel (cyan direction) over red.

10. Double Red Average

Specialized algorithm for skin tone preservation that weights red 2x higher.

Red spill:   limit = (green + blue) / 2     // Can't double red
Green spill: limit = (2×red + blue) / 3
Blue spill:  limit = (2×red + green) / 3

Use when:

  • Human subjects are the primary focus
  • Skin tone preservation is critical
  • Subject has warm clothing or props to preserve

This is the best algorithm for portraits and people as it prioritizes maintaining the red channel which is essential for natural skin tones.

Performance Notes

  • Simple algorithms (2, 3, 4, 5, 6) are fastest
  • Averaging algorithms (1, 8) have moderate cost
  • Double-weighted algorithms (9, 10) are most expensive
  • GPU acceleration benefits all algorithms equally
  • Algorithm choice has minimal impact vs other parameters like Protection Blur

Ready to start despilling? Head to the User Guide for parameter details and workflow tips.