KeyMix

Function
This 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, with KeyMix for non-premultiplied images and Over for premultiplied images. For more information, see Overview - About Premultiplication.

Example

With the following tree, we are able to color correct the beach and position the sky separately from each other by mixing through the QuickShape:

.

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