How to Vectorize an Image to SVG Curves (Potrace Guide)
Published November 28, 2026 · By SevenOneLabs
Have you ever needed to print a company logo on a large banner, laser-cut a custom stencil, or embed a website icon on a high-DPI retina display, only to discover the source file is a tiny, pixelated PNG?
Vectorizing (or tracing) converts static pixel grids into mathematical Bezier curves. In this guide, you will learn how the Potrace vector engine works, which graphics vectorize best, and how to convert raster images into clean SVG vectors directly in your browser.
On this page
What Is Vectorization (Raster to Vector)?
A raster image (JPEG, PNG, WebP) is a grid of colored pixels. When enlarged, individual pixels become visible as jagged squares (pixelation).
An SVG vector file contains mathematical coordinate instructions: "Start at point (10, 20), draw a cubic Bezier curve to (50, 80) with control handles at (30, 40), then fill with black." Because the computer calculates the curves dynamically on render, an SVG looks razor-sharp whether viewed at 16×16 pixels or printed across a 50-foot billboard.
How the Potrace Algorithm Traces Curves
Potrace, developed by mathematician Peter Selinger, is the gold standard for bitmap vector tracing. The process occurs in four phases:
- Binarization (Otsu Threshold): Converts colored pixels into pure foreground and background layers.
- Polygon Boundary Detection: Traverses pixel edges to discover closed loop paths and interior holes.
- Polygon Optimization: Reduces thousands of jagged pixel steps into clean polygon vertices.
- Bezier Curve Fitting: Calculates optimal smooth cubic splines and corners with minimal anchor points.
Silhouette vs Multi-Color Quantization
Standard Potrace is binary (monochrome). However, SquarePic integrates Median-Cut Color Quantization to extend vector tracing to multi-color illustrations:
- Silhouette / B&W Mode: Best for signatures, vinyl cutter decals, laser engraving, stamps, and high-contrast logos.
- Multi-Color Mode: Segments the raster image into 2, 4, 8, or 16 dominant palette colors. Each color layer is independently traced into a dedicated SVG path preserving its true hue.
Which Images Vectorize Best?
Vectorization delivers extraordinary results for graphics with defined edges:
- Logos and Brand Marks: Perfect for recreating lost vector assets from raster scans.
- Signatures and Calligraphy: Digitize handwritten signatures for PDF contracts or document stamps.
- Icons and Badges: Generate ultra-lightweight SVG code for website design systems.
- Stencils and Decals: Ready for Cricut cutters, laser engravers, vinyl plotters, and CNC machines.
Fine-Tuning Thresholds and Curve Smoothness
In SquarePic's SVG Vectorizer, you can fine-tune several key parameters:
- Brightness Threshold: Controls where the cutoff between foreground and background lies. Lower values produce thinner lines; higher values produce bolder silhouettes.
- Despeckle / Turdsize: Suppresses stray dust and compression artifacts smaller than the specified pixel radius.
- Corner Smoothness (Alphamax): Controls whether sharp corners are preserved (0.1) or rounded into flowing arcs (1.3).
How to Vectorize an Image Free with SquarePic
- Open the free SVG Vectorizer.
- Upload your PNG, JPG, or WebP image.
- Select a preset like Logo & Badge or switch to Multi-Color Palette.
- Adjust the threshold slider while inspecting the live vector preview.
- Click Download SVG Vector File, export a 4K PNG, or click Copy SVG Code / React JSX to paste directly into your workflow.