ChromaKey
Function
This function examines the HSV values of an image and pulls a matte based
upon the parameters. In the gui, you can scrub a color on the Viewer,
but we recommend turning off the matteMult parameter before you
scrub. The hue, saturation and value all of values, followed by a range,
a falloff, and a sharpness for each set:
A typical application is blue- or greenscreen removal. You can stack
multiple ChromaKey operators to extract different ranges. With
the arithmetic parameter, you can choose to add to, subtract from,
or replace the current mask.
Parameters
|
Type
|
Defaults
|
Function
|
hue,
sat, val |
float
|
.666, 1, 1 |
Picks the center value to be pulled on
hue, saturation, and value. |
Range |
float
|
.2, .4, .8 |
Plus and minus from the initial hue, sat,
or value that is picked |
Falloff |
float
|
.1,.8,.1 |
Describes the falloff range from hueRange that is picked, with
the values ramping down
|
Sharpness |
float
|
.5, .5, .5 |
Describes the falloff curve from hueRange to hueFalloff.
0 = linear dropoff
1 = smooth dropoff
|
matteMult |
int
|
1 |
toggle to pre-multiply the RGB channels by the pulled mask
0 = no pre-multiply
1 = pre-multiply
|
arithemetic |
int
|
0 |
0 = replace existing mask
1 = add to existing mask
2 = subtract from existing mask |
Synopsis
image ChromaKey(
image,
float hue,
float hueRange,
float hueFalloff,
float hueSharpness,
float sat,
float satRange,
float satFalloff,
float satSharpness,
float val,
float valRange,
float valFalloff,
float valSharpness,
int matteMult,
int arithmetic
);
Script
image = ChromaKey(
image,
hue, hueRange, hueFalloff, hueSharpness,
sat, satRange, satFalloff, satSharpness,
val, valRange, valFalloff, valSharpness,
matteMult,
arithmetic
);
Command Line
-chromakey hue hueRange etc...
Example
shake parrot.jpg -chromakey .66 .2 .1 .5 1 .4 .8 .5 1 .8 .1 .5
See Also
LumaKey
|