Back to Node List

Region Merge Small

region_merge_small

Merges small RegionMap areas into neighboring regions

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
最小面積
min_area
Int
41–4294967295

この面積未満の領域を隣接領域へ統合します

最大反復
max_passes
Int
41–16

小領域統合を繰り返す最大回数です

統合先
target
Enum
LongestBorder

統合先の選び方です

  • 接触辺優先LongestBorder
    もっとも長く接している隣接領域へ統合します
  • 大きい隣接LargestNeighbor
    もっとも大きい隣接領域へ統合します
シード
seed
Int
10–99999

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

ID表示
show_ids
Bool
false

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

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_smallregion_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
Region Merge Small — PixPipeline Node Reference