What is it for?
- Keep only the needed part of an image
- Use a black-and-white mask to define visible areas
- Perform the opposite operation from
Erase By Mask
Overview
The most basic mask-compositing node, cutting out an image with a black-and-white mask. Remember one rule—white remains, black becomes transparent—and you can apply it to circular icons, shape cutouts, and partial visibility.
Usage tips
- Masks usually come from three sources:
shape_generate, where a white shape is already a mask;threshold, which extracts a condition from an image; andpath_mask, which uses a path shape. - Gray produces partial transparency. You can create a soft mask with a 1px gray edge, though binary black and white is the standard for pixel art.
- To cut out and then composite over another image, this node plus
blendworks in two steps, whileblend_by_maskdoes it in one.
How to think about it
- White: remains
- Black: disappears
- Gray: remains at half opacity
Turn invert on to reverse the behavior.
Difference from Erase By Mask
Mask- Keeps white areas
Erase By Mask- Erases white areas
Use Mask to show only the mask shape.
Use Erase By Mask to cut a hole in the mask shape.
Technical details
By default, mask-image luminance is used as alpha: white areas remain, while black
areas become transparent.
Turn alpha_enabled on to use mask-image alpha instead of luminance.
Both invert and alpha_enabled can be promoted to input pins for shared or
animated control.
Examples
- Apply a circular mask to a character image to make a round icon.
- Keep only the visible area defined by
PathMask. - Turn
inverton to hide only white areas.
Common pitfalls
- Everything disappeared / remained: the mask is pure black / pure white. Preview the mask, and remember that a color image is interpreted by luminance.
- Mask alpha has no effect: luminance is used by default. Turn
alpha_enabledON. - Different dimensions cause misalignment: source and mask should normally match.
Fit the mask with
canvas_resize.
Related nodes
erase_by_mask— the opposite direction, erasing white areasblend_by_mask— composite two images through a maskthreshold/path_mask/shape_generate— mask sourcesmask_boolean— AND/OR/difference between masks