Back to Node List

Region Border

region_border

Extracts pixel borders between RegionMap areas

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
画像
output
Image
透明背景に境界線だけを描いた画像です

Parameters

NameTypeDefaultRangeDescription / Options
近傍
connectivity
Enum
Four

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

  • 4近傍Four
    上下左右だけを見て境界を作ります
  • 8近傍Eight
    斜め接触も境界として扱います
配置
placement
Enum
BothSides

領域境界のどちら側にピクセルを置くかです

  • 両側BothSides
    境界の両側を塗ります
  • 片側ForwardSide
    右・下方向を基準に片側だけ塗ります
  • 小さいID側LowerIdSide
    隣接する領域のうちIDが小さい側だけ塗ります
  • 大きいID側HigherIdSide
    隣接する領域のうちIDが大きい側だけ塗ります
  • 辺スキャンEdgeScan
    右・下方向の境界辺を1回だけ拾って塗ります
太さ
thickness
Int
11–8

境界線のピクセル太さです

color
Color
[1,1,1,1]

境界線の色です

Overview

Extracts the boundaries between regions in a RegionMap as a line image on a transparent background. It produces the lines between surfaces—mortar joints in paving stones, divisions between strata, or outlines around individual faces. The go-to setup overlays it on the fill from region_fill.

  • Category: Generate / Region / Render
  • Use cases: surface boundaries in water or rock, divider lines in pixel art, and boundary extraction for downstream masks

Usage tips

  • The standard composite takes region_fill (fill) and region_border (lines) from the same RegionMap, then overlays them with blend. This lets you adjust line color and thickness independently from the fill.
  • For a pixel-art-like 1px line, use placement = ForwardSide. The default BothSides colors both sides, so some areas effectively look 2px thick.
  • To process the line itself, such as retaining only the lower side for a shadow, use LowerIdSide / HigherIdSide to select one side.

Related nodes

  • region_fill — the fill to overlay
  • region_boundary_trace — organize boundaries as line data
  • region_distance — create a gradient from boundaries instead of lines
  • blend — composite lines with the fill

Placement

Value Description
BothSides The current standard mode. It colors both sides of a boundary, so some areas effectively appear 2px thick even with thickness=1.
ForwardSide Colors only one side using the right/down direction as reference. Use it to quickly create 1px boundaries.
LowerIdSide Colors only the side belonging to the lower-ID region of two adjacent regions.
HigherIdSide Colors only the side belonging to the higher-ID region of two adjacent regions.
EdgeScan Collects each boundary edge in the right/down direction once. Use it when edges between cells should take priority over diagonal contact.

How to use

Connect Region Cells.regions -> Region Border.regions to draw lines only where regions touch. Overlay the result on Region Fill with Blend to adjust surfaces and boundaries separately.

If the input RegionMap loops horizontally or vertically, opposite edges are also treated as connected during boundary detection. Boundaries at the seams of tiled material inherit the loop settings from the generator.

Pixel-perfect lines with L-corner removal, like Path Stroke, are intended for a downstream node that converts boundaries to Path or PixelLine, rather than this node. Region Border remains focused on extracting boundary candidates from region IDs.

Use this node when you want to overlay boundaries immediately as an image. Use Region Boundary Trace when you need to organize them as line data, select only boundaries between particular IDs, or clean up short protrusions.

Back to Node List
Region Border — PixPipeline Node Reference