Curve Fitting and Region Filtering
Once color segmentation defines each region, the vectorizer simplifies its boundaries, fits cubic Bézier curves, and runs Potrace contour tracing. Region filtering controls then merge or remove tiny color patches, stray contours, and interior pinholes before writing the final SVG.
Curve Fitting
Curve Fit Error
Ranges from 0.1–5 px, with a default of 0.8 px. Sets the maximum pixel error allowed during Schneider Bézier curve fitting:
- Smaller values hug the source boundary more tightly using more control points.
- Larger values generate smoother curves with fewer control points, softening fine detail.
Contour Simplification
Ranges from 0–2, with a default of 0.45. Raising this value prunes raw boundary vertices before Bézier fitting begins, reducing overall path complexity, whereas Curve Fit Error governs how closely the fitted curves track those simplified vertices.
Merge Segment Tolerance
Ranges from 0–0.5, with a default of 0.05. Merges adjacent, nearly collinear Bézier segments whose control-point deviation falls within this threshold. Raising it cleans up redundant nodes along straight edges; setting it too high can flatten subtle bends.
Region Filtering
Min Region Area and Max Merge Color Dist
- Min Region Area: ranges from
0–1000 px², with a default of50 px². Segmented color regions smaller than this area become candidates to merge into a neighboring region. - Max Merge Color Dist: ranges from
0–500, with a default of200(measured in LAB ΔE²). Caps how different a neighbor's color may be when absorbing a small region—higher values allow higher-contrast speckles to merge.
Min Contour Area
Ranges from 0–500 px², with a default of 10 px². Discards standalone shapes smaller than this area after contour tracing. Because it runs after Min Region Area, it catches isolated fragments that could not merge into an adjacent color.
Min Hole Area
Ranges from 0–100 px², with a default of 4 px². Fills enclosed interior pinholes smaller than this area while preserving larger cutouts as open holes in the SVG path.
When cleaning up artifacts, zoom in first to see whether the unwanted specks are adjacent segmented patches, isolated contours, or tiny interior pinholes, then raise the matching threshold.
Submit feedback
Your feedback is sent privately to the Wiki maintainers and is not displayed publicly on this page.