Yotsuba Games
Back to Node List

Erase By Mask

erase_by_mask

Erase where the mask is opaque and keep where it is 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
็”ปๅƒ
input
Image
Required
ๅˆ‡ใ‚ŠๆŠœใใŸใ„็”ปๅƒใงใ™
ใƒžใ‚นใ‚ฏ
mask
Image
Required
ใ‚ขใƒซใƒ•ใ‚กใงๅ‰Šใ‚‹้‡ใ‚’ๆฑบใ‚ใ‚‹ใƒžใ‚นใ‚ฏใงใ™ใ€‚ไธ้€ๆ˜Ž้ƒจๅˆ†ใงๅ‰Šใ‚Šใ€้€ๆ˜Ž้ƒจๅˆ†ใ‚’ๆฎ‹ใ—ใพใ™

Output Ports

NameTypeDescription
็”ปๅƒ
output
Image
ๅˆ‡ใ‚ŠๆŠœใ„ใŸๅพŒใฎ็”ปๅƒใงใ™

Parameters

NameTypeDefaultRangeDescription / Options
ๅ่ปข
invert
Bool
falseโ€”

ๅ‰Šใ‚‹้‡ใซไฝฟใ†ใƒžใ‚นใ‚ฏใฎใ‚ขใƒซใƒ•ใ‚กใ‚’ๅ่ปขใ—ใพใ™

What is it for?

  • Remove only part of a cloth or flame shape
  • Cut holes in an image with a mask
  • Make a cutout from a mask with alpha

Overview

Cuts a hole in an image using mask alpha. It works in the opposite direction from mask, which keeps opaque areas. Use it to remove material for effects such as frayed cloth, damaged walls, or broken flame shapes.

Usage tips

  • The go-to damage setup is a random mask from noise_generate โ†’ threshold, producing chipped or decayed variants that can be batch-produced by changing the seed.
  • Animating the amount removed creates burning-away or dissolving effects by driving threshold on the mask over time.
  • Only alpha is reduced; RGB remains intact. Reapply outline afterward to outline the newly chipped edges as well.

How to think about it

  • Opaque: erased
  • Transparent: remains unchanged
  • Semi-transparent: partially erased according to alpha

RGB color and brightness are not used. Black, white, and colored pixels erase by the same amount when their alpha is the same.

Turn invert on to reverse the behavior.
The primary purpose of this node, however, is always erasing.

Difference from Mask

  • Mask
    • Keeps opaque mask areas
  • Erase By Mask
    • Erases opaque mask areas

Use Mask when you want to keep an area.
Use Erase By Mask when you want to cut a hole.

Notes

  • RGB remains unchanged; only alpha is reduced.
  • Areas where mask alpha is 1.0 disappear completely.
  • Areas where mask alpha is 0.5 become half as opaque.
  • This node uses only mask alpha; it does not inspect RGB brightness or color.
  • invert is a lightweight way to fix a reversed mask. For the primary keep operation, use Mask.

Examples

  1. Remove part of a cloth edge with a circular mask from Shape Sweep.
  2. Apply the result of Mask Boolean(Subtract) to the final image.
  3. Cut part of a face graphic with a separate shape.
  4. Apply a flowing cutout to an effect image.

Related nodes

  • mask โ€” the opposite direction; keeps opaque mask areas
  • mask_boolean โ€” builds erasing shapes by combining masks
  • noise_generate + threshold โ€” the go-to source for random erasing masks
  • blend_by_mask โ€” replace with another image instead of erasing
Back to Node List
Erase By Mask โ€” PixPipeline Node Reference