Back to Node List

Region Boundary Trace

region_boundary_trace

Traces RegionMap borders into PixelLine data

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
ピクセル線
pixel_line
PixelLine
接続成分ごとにまとめた境界ピクセル座標列です
プレビュー
preview
Image
抽出した境界ピクセルの確認用画像です
概要
summary
Map
トレース数とループ情報です

Parameters

NameTypeDefaultRangeDescription / Options
対象
target
Enum
All

どの領域境界を抽出するかです

  • すべてAll
    すべての領域境界を抽出します
  • 領域IDRegionId
    指定IDに接する境界だけを抽出します
  • ID範囲IdRange
    指定ID範囲に接する境界だけを抽出します
  • 領域ペアPair
    指定した2領域の間の境界だけを抽出します
領域ID
region_id
Int
00–2147483647

領域ID対象で使うIDです

最小ID
min_id
Int
00–2147483647

ID範囲対象で使う最小IDです

最大ID
max_id
Int
2550–2147483647

ID範囲対象で使う最大IDです

ID範囲条件
id_range_match
Enum
BothInside

ID範囲対象で境界ペアをどう判定するかです

  • 範囲内同士BothInside
    両方の領域IDが範囲内にある境界だけを抽出します
  • 範囲に接するTouching
    どちらか一方の領域IDが範囲内にある境界を抽出します
  • 範囲の外周Crossing
    範囲内と範囲外の間の境界だけを抽出します
ペアA
pair_a
Int
00–2147483647

領域ペア対象の1つ目のIDです

ペアB
pair_b
Int
10–2147483647

領域ペア対象の2つ目のIDです

近傍
connectivity
Enum
Four

境界判定に使う近傍ルールです

  • 4近傍Four
    上下左右の境界を抽出します
  • 8近傍Eight
    斜め接触も含めます
配置
placement
Enum
ForwardSide

境界のどちら側をピクセル線にするかです

  • 両側BothSides
    境界の両側を抽出します
  • 片側ForwardSide
    右・下方向を基準に片側だけ抽出します
  • 小さいID側LowerIdSide
    IDが小さい領域側だけ抽出します
  • 大きいID側HigherIdSide
    IDが大きい領域側だけ抽出します
最小長
min_length
Int
11–4294967295

この点数より短い線成分を除外します

角整理
cleanup_corners
Bool
false

太い線を削らず、短い突起やノイズを整理します

角整理方式
cleanup_mode
Enum
Safe

角整理をオンにした時の整理方式です

  • 安全Safe
    太い境界に付いた短い突起だけを控えめに整理します
  • 強めStrong
    塊や分岐を保護しつつ、少し長い突起まで整理します
  • 水平優先Horizontal
    Path Stroke の水平側除去に寄せます
  • 垂直優先Vertical
    Path Stroke の垂直側除去に寄せます
突起長
spur_length
Int
11–8

強め整理で消す短い突起の最大長です。安全では1ドットだけ整理します

color
Color
[1,1,1,1]

プレビュー色です

Overview

An advanced boundary node that extracts RegionMap boundaries as line data (PixelLine). Unlike region_border, which produces a quick line image, this node can precisely select which IDs define a boundary and clean protrusions to improve the quality of the resulting pixel lines.

  • Category: Generate / Region / Render
  • Uses: processing boundaries downstream, extracting only a specific region pair's boundary, and cleaning boundaries as pixel lines

Usage tips

  • Use region_border to quickly overlay lines. Use this node when you need only the boundary between particular regions or plan to process the lines downstream.
  • Pair selection is its unique strength. It can isolate the water/sand boundary, for example, to create a white wave line.
  • Corner cleanup with Safe or Strong produces cleaner one-pixel lines for pixel art.

Related nodes

  • region_border — convenient image version
  • region_fill — base image beneath the lines
  • region_remap — stabilizes ID selection beforehand

Target

Value Description
All Extract all region boundaries
RegionId Extract only boundaries touching the specified ID
IdRange Extract only boundaries touching the specified ID range
Pair Extract only the boundary between the specified two regions

ID range condition

Value Description
BothInside Extract only boundaries where both region IDs are in range
Touching Extract boundaries where either region ID is in range
Crossing Extract only boundaries between an in-range and out-of-range region

Placement

Value Description
BothSides Extract both sides of the boundary
ForwardSide Extract only one side, based on the right/down direction
LowerIdSide Extract only the side belonging to the lower region ID
HigherIdSide Extract only the side belonging to the higher region ID

Corner cleanup modes

Value Description
Safe Protects 2x2-or-larger blocks and branches, conservatively removing only short protrusions attached to thick boundaries
Strong Uses Protrusion Length to remove somewhat longer short protrusions; protects blocks, branches, and centers connected in all four directions
Horizontal Follows the behavior of RemoveHorizontal in Path Stroke
Vertical Follows the behavior of RemoveVertical in Path Stroke

How to use

Connect Region Cells.regions -> Region Boundary Trace.regions.

Use Region Border when you need an image immediately. Use this node when you want line data for further processing or need to isolate a specific region pair.

When the input RegionMap has horizontal or vertical wrapping, contacts across the left/right or top/bottom edges are also extracted as boundaries. Boundaries at the seams of a tile asset remain part of the same PixelLine data.

cleanup_corners does not force blocks two or more pixels wide into thin lines. It is an aid for removing short protrusions and isolated-looking noise that stand out in pixel art. Turn it off to preserve thick boundaries, use Safe to remove only fine whiskers, and use Strong for more aggressive cleanup.

Back to Node List
Region Boundary Trace — PixPipeline Node Reference