Back to Node List

Region Filter

region_filter

Keeps or removes RegionMap areas by id, area, random, or edge touch

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
領域
regions
RegionMap
絞り込み後の RegionMap です
プレビュー
preview
Image
絞り込み後の領域を色分けした確認用画像です
ラベル
labels
Map
Inspector に重ねるIDラベル位置です

Parameters

NameTypeDefaultRangeDescription / Options
方式
mode
Enum
All

どの条件で領域を残すかです

  • 全領域All
    すべての領域を残します
  • ID指定Id
    指定した領域IDだけを残します
  • ID範囲IdRange
    指定したID範囲の領域を残します
  • 面積範囲AreaRange
    ピクセル面積の範囲で領域を残します
  • ランダムRandom
    領域ごとの安定したランダム値で残します
  • 端に接するEdgeTouch
    画像端に接する領域を残します
  • 内側Interior
    画像端に接しない内側の領域を残します
領域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

条件に合わない領域を残します

ID詰め直し
compact_ids
Bool
false

絞り込み後の領域IDを0から詰め直します

ID表示
show_ids
Bool
false

Inspector のプレビュー上に領域IDラベルを表示します

Overview

Selects regions by a condition such as ID, area, randomness, or edge contact. Unselected pixels become outside pixels. It can keep only large islands, remove regions that touch an edge, or randomly thin regions into a pattern while preserving the RegionMap type.

  • Category: Generate / Region / Select
  • Uses: keeping only small regions, removing edge-touching regions, and randomly thinning regions

Usage tips

  • Random thinning is visually useful: thin Voronoi regions into scattered stones, or noise islands into isolated shrubs.
  • Think of it as the Region counterpart to list_filter, retaining elements that meet a condition.
  • The output remains a RegionMap, so fill, boundary, and distance nodes work downstream. If you only need a black-and-white mask, region_mask is more direct.

Related nodes

  • region_mask — extracts the result as a mask image
  • region_neighbor_select — selects by adjacency
  • region_grow_shrink — fills outside pixels after filtering
  • region_merge_small — merges regions instead of removing them

Modes

Value Description
All Keep every region
Id Keep only the specified ID
IdRange Keep the specified ID range
AreaRange Keep regions within the specified area range
Random Keep regions using a stable random value per region
EdgeTouch Keep regions that touch an image edge
Interior Keep interior regions that do not touch an image edge

How to use

Connect nodes such as Region Cells.regions -> Region Filter.regions -> Region Fill.regions.

To remove regions that are too small, set mode = AreaRange and raise min_area. To remove edge-touching regions, use mode = EdgeTouch with invert = true.

When the input RegionMap wraps horizontally or vertically, edges in that direction connect to the opposite side instead of outside. In a tile that wraps both ways, a region is not treated as EdgeTouch merely because it lies at an edge.

Enable compact_ids only when needed. It is off by default so the original IDs remain aligned with upstream selections.

Region Mask differs in its output type. Region Filter returns the selection as a RegionMap, allowing further use of Region Fill, Region Border, Region Distance, and other region nodes. Use Region Mask when you need only a regular image mask.

Back to Node List
Region Filter — PixPipeline Node Reference