Studio Yotsuba
Back to Node List

Region Mask

region_mask

Paints the chosen regions white as a mask - the bridge that lets ordinary image nodes (blend, scatter, adjust) work on just those faces: moss on one stone, light on one wall

Reviewed
Guide available

Input Ports

NameTypeDescription
Regions
regions
RegionMap
Required
RegionMap to convert into a mask

Output Ports

NameTypeDescription
Mask
output
Image
White alpha mask generated from selected regions

Parameters

NameTypeDefaultRangeDescription / Options
Mode
mode
Enum
All—

How regions are selected for the mask

  • AllAll
    Select every region
  • IdId
    Select one region id
  • IdRangeIdRange
    Select region ids inside the range
  • AreaRangeAreaRange
    Select regions by pixel area
  • RandomRandom
    Select regions by stable random chance
Region ID
region_id
Int
00–2147483647

Region id used by Id mode

Min ID
min_id
Int
00–2147483647

Minimum region id for IdRange mode

Max ID
max_id
Int
2550–2147483647

Maximum region id for IdRange mode

Min Area
min_area
Int
00–4294967295

Minimum region area in pixels

Max Area
max_area
Int
40960–4294967295

Maximum region area in pixels

Chance
chance
Float
0.50–1 / step 0.01

Random selection chance per region

Seed
seed
Int
10–99999

Random selection seed

Invert
invert
Bool
false—

Invert selected and unselected areas. When inverted, pixels outside any region also turn white — handy for masking the background around your regions

Overview

Extracts a black-and-white mask containing only selected regions from a RegionMap. It is the bridge between the region system and ordinary image nodes such as mask, blend_by_mask, and mask_scatter, enabling region-limited processing such as moss on one stratum or brightness on one face.

Usage tips

  • The go-to flow is create regions → choose IDs and make a mask here → use blend_by_mask for local correction or mask_scatter to scatter within the area.

  • Choose from All, a specific ID, and other selection methods. Check IDs through region_debug_preview or show_ids.

  • Select a contiguous run of IDs with IdRange. For separated IDs, create one mask per ID and combine the masks with mask_boolean.

  • Category: Generate / Region / Select

  • Use: pass regions into existing image nodes such as Mask, Blend, and Mask Scatter

Methods

Value Description
All Make every region white in the mask
Id Make only the region matching region_id white
IdRange Make regions from min_id through max_id white
AreaRange Make only regions with area from min_area through max_area white; use it to remove small fragments or extract large surfaces
Random Create a stable random value per region ID and make only regions at or below chance white

Usage

Connect Region Cells.regions -> Region Mask.regions, then send Region Mask.output to Mask, Blend, Mask Scatter, or a similar node.

Example:

Region Cells.regions -> Region Mask.regions
Region Mask.output -> Mask.mask

Region Fill colors regions for display; Region Mask selects regions for existing image processing.

After evaluating the regions input, the ranges of region_id, min_id, and max_id update to actual region IDs, while min_area and max_area update to the actual maximum region area.

The difference from Region Filter is the output type. Region Mask outputs a normal white alpha mask image. Use Region Filter or Region Neighbor Select when region data should remain region data downstream.

Related nodes

  • blend_by_mask / mask / mask_scatter — destinations for the output mask
  • region_filter — filter while preserving region data
  • mask_boolean — combine multiple masks
  • region_debug_preview — inspect target IDs
Back to Node List