ColorReplace

Function
The ColorReplace function allows you to isolate a color according to its hue, saturation, and value, and then replace it with a different color. Other areas of the spectrum remain unchanged. This is especially useful for spill suppression.

To pull a mask of the affected source color, enable affectAlpha in the ColorReplace parameters. To better understand the parameters, you can attach the ColorReplace node to a ColorWheel node to observe the effects graphically.

Parameters
Type
Defaults
Function
affectAlpha
int
0 This toggles if the alpha color is also adjusted by the color correction. If so, you can then easily use this as a mask for other operations.
r, g, bSource
float
0, 0, 0 The Source color that is to be replaced
r, g, bReplace
float
r, g, bSource The new color that will be inserted instead of the Source color.
hueRange
float
.1 The range on the hue (from 0 to 1) that is affected. Therefore a range of .5 affects the entire hue range
hueFalloff float .1 The falloff to 0 from the hueRange that is pulled as well.
satRange float .1 The range of the saturation from the Source color. 1 means the entire range.
satFalloff float .1 The falloff from the satRange to 0.
valRange float 1 The value range, with 1 being the entire range.
valFalloff float 1 The falloff of the value to 0.


Synopsis

image ColorReplace( 
  image In,
  int affectAlpha,
  float rSource,
  float gSource,
  float bSource,
  float rReplace,
  float gReplace,
  float bReplace,
  float hueRange,
  float hueFalloff,
  float satRange,
  float satFalloff,
  float valRange,
  float valFalloff
);


Script

image ColorReplace( 
   In,
   affectAlpha,
   rSource,
   gSource,
   bSource,
   rReplace,
   gReplace,
   bReplace,
   hueRange,
   hueFalloff,
   satRange,
   satFalloff,
   valRange,
   valFalloff
);

See Also
AdjustHSV, Lookup, ColorMatch, SpillSuppress, Keylight