Raster to Vector: The Complete Vectorization Guide

Vectorization converts a pixel-based raster image into a mathematical vector representation. Instead of a grid of colored squares, the result is a set of Bézier curves and paths that scale to any size without quality loss. This guide covers our potrace pipeline, what makes a good source image, how to optimize settings, and practical use cases from logo upscaling to laser cutting.

Vectorize Your Image

Upload a PNG and get a scalable SVG

PNG SVG

Tap to choose your file

or

Supports M4A, WAV, FLAC, OGG, AAC, WMA, AIFF, OPUS • Max 100 MB

Encrypted upload via HTTPS. Files auto-deleted within 2 hours.

What Is Vectorization?

Vectorization (also called tracing) is the process of converting a raster image — a grid of colored pixels — into a vector image — a set of mathematical curves and shapes. The two representations are fundamentally different:

  • Raster (PNG, JPG, BMP): Each pixel stores a color value. The image has a fixed resolution. Enlarging it beyond that resolution produces blurry, interpolated results.
  • Vector (SVG, AI, EPS): Shapes are defined by mathematical equations — Bézier curves, lines, arcs. The rendering engine recalculates the math at any target size, producing perfect sharpness from a 16-pixel favicon to a 10-meter billboard.

Vectorization is not a simple format conversion like PNG to JPEG. It is a reconstruction: the software analyzes pixel boundaries, detects edges, and builds an entirely new mathematical representation that approximates the original image. The quality of this approximation depends heavily on the source image characteristics.

Our Conversion Pipeline

When you upload a PNG (or JPG, BMP, WebP, TIFF) to Convertio and convert to SVG, the file passes through a multi-stage pipeline. Understanding each stage explains why certain images vectorize beautifully and others produce unexpected results.

Stage 1: Input Decoding (ImageMagick)

The uploaded file is decoded by ImageMagick, which handles virtually every raster format. The image is converted to an uncompressed BMP bitmap — a raw pixel grid with no compression artifacts, no metadata, and no format-specific features. This ensures potrace receives clean, consistent input regardless of the original file format.

Stage 2: Binarization (Thresholding)

Potrace works exclusively with two-tone (binary) images — every pixel is either black or white. The grayscale bitmap is converted to binary using a brightness threshold. Each pixel's brightness is compared against the threshold value (0.0 to 1.0, default 0.5):

  • Pixels darker than the threshold become black (foreground — will be traced)
  • Pixels lighter than the threshold become white (background — ignored)

For color images, potrace first converts to grayscale using the luminance formula (0.2126R + 0.7152G + 0.0722B), then applies the threshold. This is the most critical step — the threshold determines which parts of the image are captured in the vector output.

Stage 3: Edge Tracing

Potrace scans the binary bitmap and identifies boundaries between black and white regions. It follows these boundaries pixel by pixel, building raw contours of each shape. The algorithm correctly handles nested shapes — a white region inside a black region inside another white region — by tracking the hierarchy of inside/outside relationships.

Stage 4: Curve Fitting

The raw pixel contours are jagged staircase shapes (because pixels are squares). Potrace fits smooth Bézier curves to these contours, replacing staircase edges with clean mathematical curves. The algorithm minimizes the error between the original pixel boundary and the fitted curve while keeping the path description compact.

Stage 5: SVG Output

The fitted curves are written as SVG <path> elements — standard XML that any browser, design tool, or cutting machine can render and manipulate.

Full pipeline command: convert input.png BMP:- | potrace -s --opaque -o output.svg
ImageMagick converts the input to BMP and pipes it directly to potrace. The -s flag requests SVG output. --opaque fills the background with white.

What Vectorizes Well

The binary thresholding step is the key to understanding which images produce excellent SVG output. Images that naturally divide into clear light and dark regions with strong edges map perfectly to potrace's processing model.

Source Type Quality Why It Works
Logos on white backgroundExcellentHigh contrast, clean edges, solid fill colors
Line art and sketchesExcellentStrong ink/pencil lines on white paper
Icons (flat design)ExcellentGeometric shapes, uniform colors, clean boundaries
Text and typographyExcellentSharp edges, uniform black on white
SilhouettesExcellentPure black/white, clean outlines, no internal detail
Stamps and sealsVery goodHigh contrast, but may need threshold tuning for faded areas
Technical diagramsVery goodClean lines, but very thin lines may need lower threshold
Hand-drawn designsGoodStrong ink lines work; light pencil strokes may drop out

The common thread: high contrast, clear edges, limited tonal range. If the image looks recognizable when reduced to pure black and white, it will vectorize well.

What Vectorizes Poorly

The same binary thresholding that works brilliantly for logos and line art fails for images with continuous tonal variation. When every pixel has a unique brightness value, forcing them all into black or white destroys the visual information that makes the image meaningful.

  • Photographs: Portraits, landscapes, and product photos contain smooth gradients across skin, sky, foliage, and fabric. Thresholding collapses everything into stark black and white blobs, producing an abstract or posterized appearance. The SVG file may also be enormous — thousands of tiny paths attempting to approximate smooth tonal variation.
  • Soft gradients: Sunset skies, color fades, vignette effects, and shadows cannot be represented as binary. The gradient gets chopped into discrete bands with jagged boundaries.
  • Complex textures: Fabric weave, wood grain, fur, paper texture — these generate vast numbers of tiny vector paths that look noisy and serve no practical purpose.
  • Low-resolution sources: A 100×100 pixel thumbnail provides so few data points that the Bézier curve fitting produces rough, blocky paths. The output looks angular and crude regardless of the source content.
  • Heavily compressed JPEGs: JPEG compression creates blocky 8×8 pixel artifacts around edges. Potrace traces these compression artifacts instead of the actual image edges, producing noisy, jagged vector paths.

Rule of thumb: If the image's essential meaning survives in pure black and white — no grays, no gradients — it will vectorize well. If the image depends on tonal subtlety or photographic detail, vectorization is the wrong approach.

Quality Optimization Tips

The biggest improvements come from preparing the source image before uploading, not from tuning potrace parameters. These steps work in any image editor.

Use the Highest Resolution Available

Potrace fits Bézier curves to pixel boundaries. More pixels means more data points for the curve-fitting algorithm, which produces smoother, more accurate output. A 2000×2000 pixel image produces noticeably better curves than a 500×500 version of the same content. Always upload the largest version available — the SVG output is resolution-independent, but its quality depends on input resolution.

Clean Up the Source

For scanned images, remove background noise and artifacts before uploading. Use a Levels or Curves adjustment to push the background toward pure white and the foreground toward pure black. Remove dust specks, paper texture, and scanning artifacts with a light blur or despeckle filter. Crop tightly to eliminate edge shadows.

Increase Contrast

Push the contrast slider up. Stronger contrast means a wider gap between foreground and background brightness values, which gives the threshold a cleaner separation to work with. For B&W images, the ideal input has only two tones: pure black and pure white, with nothing in between.

Use PNG, Not JPEG

JPEG compression creates visible blocky artifacts around sharp edges — exactly the areas potrace analyzes for edge tracing. These artifacts produce jagged, noisy vector paths that trace compression boundaries rather than actual image edges. If you have the choice, always use PNG. If only JPEG is available, use the highest quality (least compressed) version.

Adjust the Threshold

The default threshold of 0.5 works for most high-contrast images. For light-colored sources (faded documents, light pencil sketches), increase to 0.6–0.7 to capture more content. For dark or heavy images where the background picks up unwanted noise, decrease to 0.3–0.4 to capture only the darkest elements.

Potrace Settings Explained

Beyond the threshold, potrace offers several parameters that fine-tune the output character.

Parameter Flag Range Default Effect
Threshold -k 0.0–1.0 0.5 Brightness cutoff for binary conversion. Lower = lighter output, higher = heavier
Corner smoothing -a 0–1.334 1 0 = all sharp corners. 1.334 = maximum smoothing. Controls curve vs angle at corners.
Optimization -O 0–5 2 How aggressively curves are simplified. Higher = fewer points, smaller file, less accuracy
Noise removal -t 0–100+ 2 Max pixel area of isolated regions to discard. Higher = removes larger specks

Recommended Settings by Source Type

Source Image Threshold Corners Turdsize Notes
Clean B&W logo0.51 (smooth)2Defaults work perfectly for high-contrast logos
Pencil sketch0.35–0.451.334 (max)0Lower threshold avoids paper texture; max smooth for fluid lines
Ink stamp / seal0.55–0.651 (smooth)10–20Higher threshold captures full stamp; high turdsize removes spatter
Scanned document0.5–0.60 (sharp)5–15Sharp corners for text; moderate noise removal for paper dust
Faded / light source0.65–0.81 (smooth)2–5Higher threshold captures content lost at 0.5
Pixel art / QR code0.50 (sharp)0Sharp corners preserve geometry; no noise removal

Multi-Color Vectorization

Potrace produces black-and-white output only. It converts the image to a single binary layer (black foreground, white background) and traces the boundary. This is by design — potrace optimizes for clean, accurate B&W tracing.

For multi-color vectorization, alternative approaches exist:

  • Multi-pass tracing: Run potrace multiple times at different threshold levels, each capturing a different brightness band. Stack the resulting SVG layers with different fill colors. Inkscape's "Trace Bitmap" offers this as "Multiple Scans: Brightness Steps."
  • Color quantization + layer separation: Reduce the image to a limited color palette (4–16 colors), separate each color into a binary mask, and trace each mask independently. Tools like Inkscape's "Multiple Scans: Colors" automate this.
  • Adobe Illustrator Image Trace: AI-assisted tracing that handles multiple colors, gradients, and complex shapes. Produces cleaner multi-color output than layer stacking but requires a paid subscription.
  • AI-powered services: Tools like Vectorizer.AI use machine learning to identify shapes, separate colors, and generate clean multi-color SVG. Better results than algorithmic methods for complex images, but typically paid per-image.

For the most common vectorization use cases — logo conversion, line art tracing, cut file preparation — potrace's B&W output is exactly what is needed, and it runs instantly for free.

Practical Use Cases

Logo Upscaling

The most common reason to vectorize: your logo exists only as a small PNG or JPEG, and you need it at much larger sizes for printing, signage, or merchandise. Vectorizing converts the fixed-resolution raster into an infinitely scalable SVG. The SVG version can be printed on a billboard, embroidered on a hat, or displayed as a favicon — all from the same file.

SVG Icons for Web

If you have an icon set as PNG files, vectorizing them to SVG provides resolution independence (crisp on all screens), CSS styling (change colors on hover or dark mode), smaller file sizes, and the ability to inline them in HTML for zero extra HTTP requests.

Cutting Machines (Cricut, Silhouette, Laser)

Cricut, Silhouette, and laser cutters require vector input files to generate toolpaths. The machine follows the vector paths exactly — the cutter or laser traces the mathematical curves. If your design exists only as PNG, vectorization is the bridge between the raster design and the physical cutting operation. Clean, high-contrast source images produce the best cutting paths.

Embroidery

Embroidery machines need vector outlines to generate stitch paths. The vector shapes determine stitch direction, density, and fill patterns. Vectorizing a logo PNG to SVG is typically the first step in creating an embroidery file (.PES, .DST, .EXP). Simple shapes with clear boundaries produce the cleanest stitch output.

Web Performance Optimization

Replacing PNG icons and logos with SVG on a website reduces page weight (a single SVG replaces multiple resolution-specific PNGs), improves Retina display sharpness, and enables CSS-based theming. A typical website with 20 icons can save 200–400 KB by switching from PNG to SVG, directly improving Core Web Vitals scores.

Large-Format Printing

Trade show banners, vehicle wraps, building signage, and exhibition displays all require artwork that renders crisply at physical sizes measured in meters. Raster images that looked fine on screen become visibly blurry at large print sizes. Vectorizing the design ensures mathematical sharpness at any output size the print shop needs.

Ready to Vectorize?

Convert your PNG to a scalable SVG vector

PNG SVG

Tap to choose your file

or

Supports M4A, WAV, FLAC, OGG, AAC, WMA, AIFF, OPUS • Max 100 MB

Frequently Asked Questions

Technically yes, but the result will be a stylized, posterized interpretation — not a photorealistic copy. Photographs contain millions of subtle color transitions and gradients that vectorization converts into discrete solid-color regions. The output can be artistically interesting but will not look like the original photo. For photorealistic scaling, use an AI upscaler or serve responsive images at multiple resolutions.

Vectorization is a reconstruction, not a format conversion. The tool analyzes pixel edges and generates mathematical curves that approximate the original shapes. For simple graphics with solid colors and clean edges, the approximation is very close. For complex images with gradients, textures, and many colors, the difference is more pronounced because these features cannot be efficiently represented as vector paths.

The threshold (-k) controls the brightness cutoff that determines which pixels become black (foreground) and which become white (background). Range: 0.0 to 1.0, default 0.5. Lower values (0.2–0.4) capture only the darkest elements, producing lighter output. Higher values (0.6–0.8) capture more of the image, producing heavier output. Adjust based on your source image's brightness distribution.

Potrace produces black-and-white output from a single threshold pass. For multi-color vectorization, you need tools that run multiple passes at different color layers — such as Adobe Illustrator's Image Trace, Inkscape's multi-scan trace, or AI-powered services like Vectorizer.AI. These tools separate the image into color layers and trace each one independently.

Yes, significantly. Higher resolution means more pixels for the tracer to analyze, resulting in smoother, more accurate Bézier curves. A 2000×2000 pixel image produces noticeably better SVG output than a 500×500 version. Always upload the highest resolution available. The SVG output itself is resolution-independent, but its quality depends on the resolution of the input.

More PNG to SVG Guides

SVG vs PNG: Complete Comparison Guide
Vector vs raster: scaling, file size, transparency, web performance. When to use SVG and when PNG is better.
Back to PNG to SVG Converter