Studio Yotsuba
Back to Node List

Mask

mask

Keep the white areas of a mask and make the black areas transparent

Reviewed
Guide available

Input Ports

NameTypeDescription
Source
source
Image
Required
Source image
Mask
mask
Image
Required
Mask image. White keeps the source, black hides it

Output Ports

NameTypeDescription
Image
output
Image
Masked image

Parameters

NameTypeDefaultRangeDescription / Options
Invert
invert
Bool
false—

Invert the result so white hides and black keeps

Use Alpha
alpha_enabled
Bool
false—

Use mask's alpha channel instead of luminance

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; and path_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 blend works in two steps, while blend_by_mask does 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

  1. Apply a circular mask to a character image to make a round icon.
  2. Keep only the visible area defined by PathMask.
  3. Turn invert on 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_enabled ON.
  • 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 areas
  • blend_by_mask — composite two images through a mask
  • threshold / path_mask / shape_generate — mask sources
  • mask_boolean — AND/OR/difference between masks
Back to Node List