Studio Yotsuba
Back to Node List

Region Merge Small

region_merge_small

Absorbs tiny leftover regions into their neighbors - cleans up the 1-2px crumbs a split leaves behind, keeping only usable faces

Reviewed
Guide available

Input Ports

NameTypeDescription
Regions
regions
RegionMap
Required
RegionMap to clean up

Output Ports

NameTypeDescription
Regions
regions
RegionMap
RegionMap after small-region merge
Preview
preview
Image
Color preview after merging small regions
Labels
labels
Map
UI overlay label positions for the inspector

Parameters

NameTypeDefaultRangeDescription / Options
Min Area
min_area
Int
41–4294967295

Regions smaller than this are merged into neighbors

Max Passes
max_passes
Int
41–16

Maximum cleanup iterations

Target
target
Enum
LongestBorder—

How the merge target is selected

  • LongestBorderLongestBorder
    Merge into the neighbor sharing the longest border
  • LargestNeighborLargestNeighbor
    Merge into the largest neighboring region
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

A cleanup node that absorbs fragment regions that are too small into their neighbors. Generated regions often contain a few-pixel fragments that make the image look noisy when filled directly. Insert this between the generator and region_fill to clean up the surfaces.

  • Category: Generate / Region / Edit
  • Use cases: reduce small fragment regions so fills, boundaries, and masks are easier to work with

Usage tips

  • Its standard position is immediately after generation: region_cells (or another generator) → region_merge_small → region_fill. It is nearly essential after region_noise, which readily produces fragments.
  • min_area is a pixel count. Start with the default, which removes areas smaller than 4, enable ID display, and raise it while inspecting the result.
  • Excessive merging also removes the character of the surfaces. The trick is to stop once the noise blends into its surroundings.

Related nodes

  • region_cells / region_noise / region_voronoi — generators that can produce fragments
  • region_fill — color the cleaned regions
  • region_split_islands — the reverse operation, separating islands
  • region_filter — select regions by conditions

Merge target

Value Description
LongestBorder If a neighboring stable region meets the minimum area, merges into the one sharing the longest boundary. If all neighbors are small, first merges small regions together.
LargestNeighbor Merges into the largest adjacent region.

How to use

Connect nodes as in Region Cells.regions -> Region Merge Small.regions -> Region Fill.regions.

Raising min_area reduces the number of small fragment regions. Applying it too strongly also removes surface detail, so enable ID display and adjust while checking the merged result.

If the input RegionMap loops horizontally or vertically, the node also treats opposite edges as adjacent when selecting merge targets. A small region at a seam in tiled material can therefore merge naturally into the region on the opposite side.

min_area is a pixel area. Raising it increases the number of merge candidates, but the goal is not to turn everything into large masses; it is to blend overly small noise into its surroundings. Use LargestNeighbor for strong absorption into large surfaces, or the default LongestBorder to preserve a natural boundary flow.

Back to Node List