Studio Yotsuba
Back to Node List

Region Remap

region_remap

Renumbers region ids (top-left first, by size, random) when you need tidy, predictable ids for selection or palette mapping

Reviewed
Guide available

Input Ports

NameTypeDescription
Regions
regions
RegionMap
Required
RegionMap to renumber

Output Ports

NameTypeDescription
Regions
regions
RegionMap
RegionMap with remapped ids
Preview
preview
Image
Color preview of the remapped regions
Labels
labels
Map
UI overlay label positions for the inspector

Parameters

NameTypeDefaultRangeDescription / Options
ID Order
id_order
Enum
Current—

How region ids are renumbered

  • CurrentCurrent
    Keep the current ids
  • TopLeftTopLeft
    Assign smaller ids by ascending bounding-box top edge, then left edge
  • BottomRightBottomRight
    Assign smaller ids by descending bounding-box bottom edge, then right edge
  • AreaAscAreaAsc
    Assign smaller ids to smaller regions
  • AreaDescAreaDesc
    Assign smaller ids to larger regions
  • RandomRandom
    Assign ids by stable random order
Seed
seed
Int
10–99999

Seed for random order and preview colors

Show IDs
show_ids
Bool
false—

Show region id labels on the inspector preview

Overview

Reassigns RegionMap ID numbers in a meaningful order. Freshly generated IDs follow a mechanical order; sorting them from top-left or by largest area makes downstream ID selection in nodes such as region_mask intuitive.

  • Category: Generate / Region / Edit
  • Uses: arranging IDs so ID and ID-range selections in Region Mask are easier to use

Usage tips

  • Area order (AreaAsc / AreaDesc) is practical. It stabilizes ID-range selections such as the three largest faces while preserving their meaning when the seed changes.
  • After remapping IDs, always review the numbers with Show IDs or region_debug_preview; they no longer match the upstream IDs.
  • Remapping does not separate disconnected islands. Use region_split_islands when each island needs its own ID.

Related nodes

  • region_mask — primary consumer of selected IDs
  • region_split_islands — separates IDs by island
  • region_debug_preview — reviews the numbering
  • region_pattern_assign — assignment where ID order has meaning

ID order

Value Description
Current Keep the current IDs
TopLeft Assign lower IDs to regions nearest the top-left
BottomRight Assign lower IDs to regions nearest the bottom-right
AreaAsc Assign lower IDs to smaller regions
AreaDesc Assign lower IDs to larger regions
Random Assign IDs in a stable random order

How to use

Connect nodes such as Region Cells.regions -> Region Remap.regions -> Region Mask.regions.

For example, with ID Order set to AreaAsc, IDs 0, 1, 2... are assigned from the smallest region upward. A downstream IdRange in Region Mask can then reveal progressively larger regions.

Remapping changes the relationship to IDs inspected upstream. Before specifying IDs in Region Mask or Region Distance, review them with this node's Show IDs option or Region Debug Preview.

If disconnected islands still share one ID, reordering alone will not separate them. Use Region Split Islands before or after this node to assign IDs per visible island.

Back to Node List