Back to Node List

Region Grow/Shrink

region_grow_shrink

Grows regions into outside pixels or shrinks region borders

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
Shrink

領域を拡張するか縮小するかです

  • 拡張Grow
    外側ピクセルを隣接領域で埋めます
  • 縮小Shrink
    各領域の境界ピクセルを外側にします
amount
Int
10–32

拡張縮小を繰り返す回数です

接続
connectivity
Enum
Four

拡張縮小で使う近傍方向です

  • 4方向Four
    上下左右の4方向で判定します
  • 8方向Eight
    斜めを含む8方向で判定します
シード
seed
Int
10–99999

プレビュー色に使うシードです

ID表示
show_ids
Bool
false

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

Overview

Grows or shrinks regions in a RegionMap, like the Region counterpart to image morphology. Shrinking creates gaps such as mortar joints or grooves between regions; growing fills gaps and holes with nearby regions.

  • Category: Generate / Region / Edit
  • Uses: creating spacing between regions and filling holes or outside pixels from nearby regions

Usage tips

  • A second way to create cobblestone joints is region_voronoi → Shrink(1–2px) → region_fill. The gaps preserve the background color, creating different depth than region_border, which overlays lines.
  • A Shrink → Grow round trip can also smooth and clean boundaries.
  • Applying only Grow immediately after a generator that fills the whole canvas has no effect because there are no outside pixels. Create some first with Shrink or region_filter.

Related nodes

  • region_border / region_distance — when you need a line or edge map
  • region_fill — fills the processed result
  • region_filter — another way to create outside pixels
  • morphology — equivalent operation for an image mask

Modes

Value Description
Grow Fill outside pixels from adjacent regions
Shrink Turn each region's boundary pixels into outside pixels

How to use

Use Shrink to create gaps between regions. Use Grow after Region Filter or Shrink to assign outside pixels back to nearby regions.

If the entire canvas is filled with regions, as with an unprocessed Region Cells output, Grow alone makes little difference. Create outside pixels first with Shrink or Region Filter.

When the input RegionMap wraps horizontally or vertically, an edge connects to the opposite side instead of outside. This prevents tile assets from shrinking unnecessarily at their edges.

Shrink does not draw boundary lines. It edits regions by removing boundary pixels and turning them into outside pixels. Use Region Border for a line image or Region Distance for an edge map with distance values.

Back to Node List
Region Grow/Shrink — PixPipeline Node Reference