Mask image

Mask image

Applies a binary mask to the input image. A pixel is copied from the input image to the output image if the corresponding pixel in the mask image is non-zero. Otherwise the pixel in the output image is set to zero. The logic can be inverted with the invert flag.

Inputs

image
Input image.
mask
Binary mask. Must be the same size as the input.
invert
Logic inversion flag. If the value is true, a non-zero pixel in the mask means a zero pixel in the output image.

Outputs

image
Output image.