ColorReplace
Function
This function allows you to isolate a color according to its hue, saturation
and value, and replace it with a differnent color. Other areas of the spectrum
will remain unchanged. This is especially handy for spill suppression. There
is a toggle to affect the alpha channel in case you also want to pull a mask
of the affected source color. To better understand the parameters, you might
attach it 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