Back to Node List

Mask

mask

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

Reviewed
Guide available
The node name and summary are available in English. Port, parameter, and article details are currently shown in Japanese.

Input Ports

NameTypeDescription
ソース
source
Image
Required
ソース画像
マスク
mask
Image
Required
白い所を残し、黒い所を隠すマスク画像です

Output Ports

NameTypeDescription
画像
output
Image
マスク適用後の画像

Parameters

NameTypeDefaultRangeDescription / Options
反転
invert
Bool
false

白で隠し、黒で残す向きに反転します

Alphaを使用
alpha_enabled
Bool
false

マスクの輝度ではなくアルファチャンネルを使用

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
Mask — PixPipeline Node Reference