Back to Node List

Region Mask

region_mask

Converts selected RegionMap areas 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
領域
regions
RegionMap
Required
マスク化する RegionMap です

Output Ports

NameTypeDescription
マスク
output
Image
選択した領域から作った白アルファマスクです

Parameters

NameTypeDefaultRangeDescription / Options
方式
mode
Enum
All

どの条件で領域をマスク化するかです

  • 全領域All
    すべての領域を選択します
  • ID指定Id
    指定した領域IDだけを選択します
  • ID範囲IdRange
    指定したID範囲の領域を選択します
  • 面積範囲AreaRange
    ピクセル面積の範囲で領域を選択します
  • ランダムRandom
    領域ごとの安定したランダム値で選択します
領域ID
region_id
Int
00–2147483647

ID指定方式で選ぶ領域IDです

最小ID
min_id
Int
00–2147483647

ID範囲方式で選ぶ最小IDです

最大ID
max_id
Int
2550–2147483647

ID範囲方式で選ぶ最大IDです

最小面積
min_area
Int
00–4294967295

選択する領域の最小ピクセル面積です

最大面積
max_area
Int
40960–4294967295

選択する領域の最大ピクセル面積です

確率
chance
Float
0.50–1 / step 0.01

ランダム方式で各領域を選ぶ確率です

シード
seed
Int
10–99999

ランダム選択に使うシードです

反転
invert
Bool
false

選択領域と非選択領域を反転します

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