Yotsuba Games
Back to Node List

Path Mask

path_mask

Convert closed bezier paths into a white alpha mask

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
ćƒ‘ć‚¹
path
Path
Required
ćƒžć‚¹ć‚ÆåŒ–ć™ć‚‹ćƒ™ć‚øć‚§ćƒ‘ć‚¹

Output Ports

NameTypeDescription
ē”»åƒ
output
Image
ćƒ‘ć‚¹ć‹ć‚‰ē”Ÿęˆć•ć‚ŒćŸē™½+ć‚¢ćƒ«ćƒ•ć‚”ć®ćƒžć‚¹ć‚Æē”»åƒ

Parameters

NameTypeDefaultRangeDescription / Options
幅
width
Int
641–1024

ć‚­ćƒ£ćƒ³ćƒć‚¹ć®å¹…ļ¼ˆćƒ”ć‚Æć‚»ćƒ«ļ¼‰

é«˜ć•
height
Int
641–1024

ć‚­ćƒ£ćƒ³ćƒć‚¹ć®é«˜ć•ļ¼ˆćƒ”ć‚Æć‚»ćƒ«ļ¼‰

é‡ćŖć‚Šę–¹
fill_rule
Enum
Union—

é‡ćŖć£ćŸé–‰ć˜ćƒ‘ć‚¹ć‚’ć©ć†é¢ćØć—ć¦ę‰±ć†ć‹

  • å…ØéƒØå”—ć‚‹Union
    ć©ć‚Œć‹1ć¤ć®é–‰ć˜ćŸćƒ‘ć‚¹ć®äø­ć«ć‚ć‚Œć°å”—ć‚Šć¾ć™ć€‚ę™®é€šć«å›³å½¢ć‚’é‡ć­ćŸć„ćØććÆć“ć‚Œć§ć™
  • 中を穓にするEvenOdd
    é‡ćŖć‚‹ćŸć³ć«å”—ć‚‹/ęŠœććŒåˆ‡ć‚Šę›æć‚ć‚Šć¾ć™ć€‚ćƒ‰ćƒ¼ćƒŠćƒ„ć‚„ęž ć‚’ä½œć‚ŠćŸć„ćØćć«ä½æć„ć¾ć™
  • å‘ćć§ē©“ć‚’ę±ŗć‚ć‚‹NonZero
    ćƒ‘ć‚¹ć‚’ęć„ćŸå‘ćć§å”—ć‚Šć‹ē©“ć‹ć‚’ę±ŗć‚ć¾ć™ć€‚å¤–å‘ØćØē©“ć‚’č‡Ŗåˆ†ć§ęćåˆ†ć‘ćŸć„äøŠē“šč€…å‘ć‘ć§ć™
ćƒ”ć‚Æć‚»ćƒ«ćƒ‘ćƒ¼ćƒ•ć‚§ć‚Æćƒˆ
pixel_perfect
Bool
false—

ćƒ”ć‚Æć‚»ćƒ«ćƒ‘ćƒ¼ćƒ•ć‚§ć‚Æćƒˆč£œę­£å¾Œć®č¼Ŗéƒ­ć‚’åŸŗęŗ–ć«ćƒžć‚¹ć‚Æć‚’ä½œęˆ

PP ćƒ¢ćƒ¼ćƒ‰
pp_mode
Enum
RemoveCorner—

ćƒ”ć‚Æć‚»ćƒ«ćƒ‘ćƒ¼ćƒ•ć‚§ć‚Æćƒˆč£œę­£ć§ć©ć”ć‚‰ć®å†—é•·ćƒ”ć‚Æć‚»ćƒ«ć‚’å‰Šé™¤ć™ć‚‹ć‹

  • åÆ¾č§’å„Ŗå…ˆDiagonal
    ę°“å¹³ć‚¹ćƒ†ćƒƒćƒ—ć‚’å‰Šé™¤ć—ć¦ć‚ˆć‚ŠåÆ¾č§’ēš„ćŖćƒ©ć‚¤ćƒ³ć«
  • ē›“ē·šå„Ŗå…ˆCardinal
    åž‚ē›“ć‚¹ćƒ†ćƒƒćƒ—ć‚’å‰Šé™¤ć—ć¦ć‚ˆć‚Šę°“å¹³/åž‚ē›“ēš„ćŖćƒ©ć‚¤ćƒ³ć«
  • č§’å‰Šé™¤ļ¼ˆåÆ¾ē§°ļ¼‰RemoveCorner
    åøøć«č§’ćƒ”ć‚Æć‚»ćƒ«Bć‚’å‰Šé™¤ļ¼ˆćƒŸćƒ©ćƒ¼åÆ¾ē§°äæčØ¼ļ¼‰
  • č§’äæęŒļ¼ˆåÆ¾ē§°ļ¼‰KeepCorner
    åøøć«č§’ćƒ”ć‚Æć‚»ćƒ«Bć‚’äæęŒļ¼ˆćƒŸćƒ©ćƒ¼åÆ¾ē§°äæčØ¼ļ¼‰
é–‰ćƒ‘ć‚¹å¤–ē©ćƒ¢ćƒ¼ćƒ‰
pp_closed_cross
Bool
false—

é–‰ć˜ćŸć‚µćƒ–ćƒ‘ć‚¹ć«å¤–ē©ćƒ™ćƒ¼ć‚¹ć®å†…/å¤–ć‚Øćƒƒć‚øå‰Šé™¤ć‚’é©ē”Ø

é–‰ćƒ‘ć‚¹å‰Šé™¤å“
pp_closed_side
Enum
Outer—

é–‰ćƒ‘ć‚¹ć®ć©ć”ć‚‰å“ć®ć‚Øćƒƒć‚øć‚’å‰Šé™¤ć™ć‚‹ć‹

  • 内偓Inner
    å†…å“ć®ć‚Øćƒƒć‚øć‚’å‰Šé™¤
  • 外偓Outer
    å¤–å“ć®ć‚Øćƒƒć‚øć‚’å‰Šé™¤

Overview

Converts closed paths into a white + alpha mask image. It turns a free-form shape drawn in a path editor into something usable for a cutout (mask) or a scatter area (mask_scatter). It bridges "draw the shape as a path" and "determine its use as a mask."

Usage tips

  • The go-to flow is multi_path_editor → path_mask → mask (clip an image), or → mask_scatter (scatter within the area).
  • For a shape with a hole, use fill_rule = EvenOdd: draw an outer and inner boundary to create a doughnut or frame mask.
  • Enable pixel_perfect when the line from path_stroke and the silhouette must match exactly.
  • Standard PP cleanup uses pp_mode. For a closed path with pp_closed_cross enabled, pp_closed_side is used instead.
  • Use path_fill when you need a colored fill image instead of white.

Related nodes

  • mask / mask_boolean — use or further combine the mask
  • mask_scatter — use it as an area
  • path_fill — when you need a colored fill
  • path_reverse — control holes under NonZero

Fill rules

Mode Description
Union / Fill all Fills a point if it is inside any closed path. This is the basic mode for simply overlapping shapes.
EvenOdd / Cut out the inside Alternates fill and cutout on every overlap. Suited to hollow centers such as doughnuts or frames.
NonZero / Determine holes by direction Uses path direction to determine whether an area is filled or cut out. An advanced mode for drawing outer boundaries and holes explicitly.

Pixel perfect

  • Off: builds the mask from the normal outline.
  • On: builds the mask from the same PP-corrected outline as Path Stroke.

Enable it when the appearance of Path Stroke must match the filled silhouette.

Algorithm

  1. For closed subpaths only, obtain the outline pixel sequence with rasterize_subpath.
  2. Treat all subpaths as one face and test the center of every pixel with fill_rule to determine inside/outside.
  3. Draw white (1,1,1,1) in the fill area and outline, leaving everything else transparent.

Examples

Create a mask from a path

[Multi Path] → path → [Path Mask(fill_rule:Union)] → [Preview]

Clip an image to a path shape

[Pixel Canvas] → source → [Mask] → [Preview]
                         ↑
               [Path Mask] → mask

Define an area for surface scattering

[Multi Path] → [Path Mask] → [Mask Scatter]

Notes

  • Open subpaths are ignored.
  • If there is no closed subpath, or no Path is connected, the result is transparent.
  • Unlike PathFill, this treats multiple subpaths together as one face.
  • The output is a white + alpha image intended for use with the Mask node.
  • Use Union / Fill all when overlapping areas should remain filled.
Back to Node List
Path Mask — PixPipeline Node Reference