Studio Yotsuba
Back to Node List

Shape-preserving Path Smooth

path_smooth

Reduce small path wobble while keeping endpoints, sharp corners, topology, and metadata safe

Reviewed
Guide available

Input Ports

NameTypeDescription
Path
path
Path
Required
Hand-drawn, traced, or generated path to clean up

Output Ports

NameTypeDescription
Path
path
Path
Smoothed path with the original sub-path structure and metadata

Parameters

NameTypeDefaultRangeDescription / Options
Scope
scope
Enum
All—

Use All after tracing a complete outline; use Selected Sub-path when only one cable, hole, or branch needs cleanup.

  • AllAll
    Smooth every usable sub-path while preserving their order and roles
  • SubPathSubPath
    Smooth only one selected sub-path
Sub-path
sub_path_index
Int
00–255

Sub-path index to smooth (0 = first)

Strength
strength
Float
0.50–1 / step 0.05

How far anchors move toward the local average on each pass. Start at 0.3–0.5 for traced pixel outlines; raise it only when wobble remains.

Neighbor Radius
radius
Int
21–8

Number of anchors to inspect on each side. Use 1 for small pixel stair-steps, 2–3 for hand wobble, and larger values only for broad curves.

Passes
iterations
Int
21–8

How many smoothing passes to apply. One or two passes usually remove tracing noise; use more only with a strict Maximum Move limit.

Maximum Move
max_displacement
Float
20–64 / step 0.25

Maximum total anchor movement from the input, in pixels. Use 0.5–1px for silhouette cleanup and 2px for rough traced paths.

Protect Corners Up To
corner_angle
Float
1000–180 / step 5

Anchors with an inside angle at or below this value stay fixed. Use about 100° to keep right angles, lower it toward 45° when only sharp tips should survive.

Keep Open Endpoints
lock_endpoints
Bool
true—

Keep the first and last anchor of open paths in place. Leave this on for cables, strokes, and traced outlines that must still meet neighboring parts.

Overview

Reduces small back-and-forth irregularities in hand-drawn paths, traced image/Region outlines, and generated lines. It preserves subpath count, closure, roles, holes, and A30 curves. If smoothing would cause a dangerous self-intersection or hole escape, only that shape is restored. This is finishing cleanup, not a general reshaping tool.

Usage tips

  • A common chain is trace or multi_path_editor → path_smooth → path_stroke / path_fill. Start with strength 0.3–0.5, 1–2 neighbors, 1–2 iterations, and 0.5–1px maximum movement.
  • For a rough automatic trace, try up to 2px movement, but increase strength, neighbors, iterations, and movement one at a time.
  • Use about 100° corner protection for buildings and machinery, about 45° to preserve only sharp leaf or lightning tips, or 0° when corners should round.
  • Keep Lock Open Endpoints enabled for cables or lines that meet other parts. Disabling it can pull endpoints inward and shorten the whole path.
  • Closed paths are processed cyclically without depending on the starting anchor. Hole containment is checked, and unsafe parent/hole candidates are restored with a warning.
  • Maximum Movement is the total displacement from the input position, not a per-iteration limit.

Common mistakes

  • Almost nothing changes: lower corner protection from 100° to 60° to 0°, then raise Maximum Movement slightly.
  • The result is too round: reduce neighbors or iterations, return movement to 0.5–1px, and raise corner protection toward 100° for right angles.
  • A warning appears and the original shape remains: fix upstream self-intersections, collapsed/reversed area, holes leaving their parent, or discontinuous segments.
  • Point count does not decrease: this node safely smooths shape and metadata; it does not simplify path data.

Related nodes

  • path_connect — join split paths before smoothing
  • path_extend — extend only an endpoint after smoothing
  • path_deform — intentionally add waves, bulges, or squash instead of removing noise
  • path_stroke — inspect the smoothed result as a line
  • path_fill — inspect closed-outline and hole preservation
Back to Node List