Studio Yotsuba
Back to Node List

Region Grow/Shrink

region_grow_shrink

Fattens or thins every region. Shrink to open gaps (mortar) between faces, or grow to close them up

Reviewed
Guide available

Input Ports

NameTypeDescription
Regions
regions
RegionMap
Required
RegionMap to grow or shrink

Output Ports

NameTypeDescription
Regions
regions
RegionMap
Grown or shrunk RegionMap
Preview
preview
Image
Color preview after grow or shrink
Labels
labels
Map
UI overlay label positions for the inspector

Parameters

NameTypeDefaultRangeDescription / Options
Mode
mode
Enum
Shrink—

Whether to grow or shrink regions

  • GrowGrow
    Fill outside pixels from neighboring regions
  • ShrinkShrink
    Remove border pixels from each region
Amount
amount
Int
10–32

Number of grow or shrink iterations

Connectivity
connectivity
Enum
Four—

Neighborhood used by grow and shrink

  • FourFour
    Use 4-neighbor connectivity
  • EightEight
    Use 8-neighbor connectivity
Preview Seed
seed
Int
10–99999

Changes preview colors only; the region output is unchanged

Show IDs
show_ids
Bool
false—

Show region id labels on the inspector preview

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