Studio Yotsuba
Back to Node List

Region Border

region_border

Draws the lines between regions as an image: mortar joints between stones, cracks, stained-glass frames

Reviewed
Guide available

Input Ports

NameTypeDescription
Regions
regions
RegionMap
Required
RegionMap to trace

Output Ports

NameTypeDescription
Image
output
Image
Border line image with transparent background

Parameters

NameTypeDefaultRangeDescription / Options
Connectivity
connectivity
Enum
Four—

Neighbor rule used to detect borders

  • FourFour
    Trace horizontal and vertical borders only
  • EightEight
    Also trace diagonal contacts
Placement
placement
Enum
BothSides—

Which side of a region border receives pixels

  • BothSidesBothSides
    Paint pixels on both sides of each border
  • ForwardSideForwardSide
    Paint one side by scanning right and down neighbors
  • LowerIdSideLowerIdSide
    Paint only the region with the lower id
  • HigherIdSideHigherIdSide
    Paint only the region with the higher id
  • EdgeScanEdgeScan
    Same behavior as "Forward Side" with 4-neighbor connectivity. Kept so older projects keep working — use Forward Side for new graphs
Thickness
thickness
Int
11–8

Pixel thickness of the border

Color
color
Color
[1,1,1,1]—

Border color

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