KeyMix

Function
The KeyMix function mixes two images together through the specified channel of a third image. You can control the mix percentage, and also invert the masking image. KeyMix and Over are the two primary compositing nodes—KeyMix for unpremultiplied images and Over for premultiplied images. For more information on premultiplication, see “The Definition of Premultiplied” on page 375.

Example

In the following node tree, by mixing through the RotoShape node, you can color correct the beach and position the sky separately.

.

Beach
Grad1
RotoShape1
KeyMix1

 

Parameters
Type
Defaults
Function
clipMode
int
1 Toggles between foreground (0) and background resolution (1)
channel
string
"a' The masking channel from the third image
mixPercent
float
100 The percentage of the second image mixed in.
invert
int
0 Inverts the masking channel of the third image.

Synopsis

image KeyMix( 
  image Foreground, 
  image Background, 
  int clipMode, 
  const char * channel,
  float mixPercent
  invert
);

Script

image = KeyMix(
  Foreground, 
  Background, 
  clipMode, 
  "channel", 
  mixPercent, 
  invert 
);        

Command Line

shake -keymix Background clipMode channel mixPercent invert

See Also
Mix, IMult, IAdd