← Back

Learning Vectorization

Vectorization converts raster images — grids of pixels — into resolution-independent vector paths made of lines and curves.

The process typically has three stages: edge detection (find where shapes begin and end), contour tracing (follow those edges into connected point sequences), and path simplification (reduce thousands of sampled points to a minimal set of control points without losing shape fidelity). Different algorithms make different trade-offs between accuracy, smoothness, and output file size.

📉

Ramer–Douglas–Peucker

Recursive farthest-point polyline simplification. Removes redundant points while preserving shape within a tolerance threshold.

Simplification · Recursive · Tolerance
🔲

Marching Squares

16-case lookup table that extracts iso-contours from a binary grid. Foundation of most bitmap-to-outline converters.

Contour Tracing · Grid · Lookup Table
〰️

Visvalingam–Whyatt

Area-based simplification — removes the point that forms the triangle of smallest area with its neighbours. Produces smoother results than RDP at low tolerances.

Simplification · Area · Smooth
🖊️

Bézier Curve Fitting

Least-squares fitting of cubic Bézier segments to a point sequence. Used by Potrace and Inkscape to convert traced outlines into smooth curves.

Bézier · Least Squares · Smooth
🔍

Canny Edge Detection

Multi-stage filter: Gaussian blur → gradient magnitude → non-maximum suppression → hysteresis thresholding. The standard preprocessing step before contour tracing.

Edges · Gradient · Hysteresis
🔗

Freeman Chain Code

Encodes a boundary as a sequence of 8-directional steps. Compact representation used as input to higher-level shape analysis and simplification.

Boundary · Encoding · 8-Connected