Studio Yotsuba
Back to Node List

Region Neighbor Select

region_neighbor_select

Selects the neighbors of a region - recolor everything around one face, or grab only the faces touching the outside

Reviewed
Guide available

Input Ports

NameTypeDescription
Regions
regions
RegionMap
Required
RegionMap to select from

Output Ports

NameTypeDescription
Regions
regions
RegionMap
Selected RegionMap
Mask
mask
Image
White alpha mask for selected regions
Preview
preview
Image
Preview of selected regions
Labels
labels
Map
UI overlay label positions for the inspector

Parameters

NameTypeDefaultRangeDescription / Options
Mode
mode
Enum
NeighborsOfId—

Selection rule

  • NeighborsOfIdNeighborsOfId
    Select neighbors of one region id
  • NeighborsOfRangeNeighborsOfRange
    Select neighbors of ids in a range
  • TouchesOutsideTouchesOutside
    Select regions touching OUTSIDE pixels
  • TouchesEdgeTouchesEdge
    Select regions touching visible image edges
  • InteriorOnlyInteriorOnly
    Select regions not touching outside or visible edges
Region ID
region_id
Int
00–2147483647

Region ID

Min ID
min_id
Int
00–2147483647

Min ID

Max ID
max_id
Int
2550–2147483647

Max ID

Depth
depth
Int
11–32

How many neighbor steps to include

Include Source
include_source
Bool
false—

Include the source ids in neighbor modes

Output Mode
output_mode
Enum
KeepSelected—

How selected regions are output

  • KeepSelectedKeepSelected
    Keep selected regions
  • RemoveSelectedRemoveSelected
    Remove selected regions
Preview Seed
seed
Int
10–99999

Changes preview colors only; selected regions and mask output are unchanged

Show IDs
show_ids
Bool
false—

Show region id labels on the inspector preview

  • type_id: region_neighbor_select
  • category: Generate/Region/Select

Uses RegionMap adjacency to select regions that touch a specified ID, outside pixels, or an image edge. Region Adjacency outputs information, while this node outputs a RegionMap and mask that can flow into downstream processing.

Usage tips

  • It excels at effects around a source. Select regions adjacent to a water ID to obtain a shoreline, or those next to lava to obtain scorched ground.
  • Increasing depth expands the selection like ripples. Use it for concentric coloring such as two levels outward from a center.
  • Use region_filter for simple conditions such as area or ID; use this node when the condition depends on what a region touches.

Related nodes

  • region_filter — condition-based selection
  • region_adjacency — numeric view of adjacency data
  • region_fill — fills the selected result
  • region_distance — surrounding effects based on distance rather than adjacency

Key parameters

ID Contents
mode Neighbors of an ID, neighbors of an ID range, touching outside, touching an image edge, or interior only
region_id / min_id / max_id Source for adjacency selection
depth Number of adjacency steps to include
include_source Include the source ID in the selection
output_mode Keep or remove the selected regions
show_ids Display ID labels in the Inspector preview

TouchesOutside selects regions that actually touch OUTSIDE_ID. Use TouchesEdge when you specifically need regions touching the image edge.

How to use

To process only the area around a specified ID, start with mode = NeighborsOfId and depth = 1. Increase depth to expand through two or more levels of neighbors. Enable include_source only when the starting ID should also be selected.

The regions output is a RegionMap containing only the selected regions. Use mask as a regular image mask, or regions to continue Region processing.

When the input RegionMap wraps horizontally or vertically, adjacency also accounts for connections across those edges. This is useful for selecting neighbors across the seams of a tile asset.

Preview Seed changes only the region colors in the inspector preview. It does not affect the selected regions or mask.

Back to Node List