JPG to SVG: convert a JPEG to clean vector paths
Updated October 25, 2026 · Rasterklar
Short answer
Trace it: tracing finds the edges of each flat area of the JPEG and redraws them as smooth vector paths (the Potrace algorithm, Selinger 2003). Raise despeckle to drop the compression specks along the edges, and choose as many colours as the design has inks plus one for the paper. Logos, lettering and scanned line art convert cleanly; photographs become flat colour regions.
A JPG is a grid of pixels saved with lossy compression; an SVG is a set of shapes. Converting one into the other means tracing: finding the edges of each flat area and drawing smooth paths along them. JPEG compression adds noise right at those edges, so a good JPG-to-SVG conversion is mostly about ignoring the noise.
2 free images a day without one. Lost your code?
What happens to a JPG when it is traced
The tracer first reduces the image to layers. In black and white mode every pixel is compared with a brightness threshold, chosen automatically with Otsu’s method from the image’s histogram unless you set it. In colour mode the colours are grouped into the number of clusters you choose (k-means), and every pixel joins its nearest cluster.
Each layer is then traced with the Potrace algorithm: the outline of every area is turned into an optimal polygon, the polygon’s corners are kept or rounded according to the corner threshold, and neighbouring curves are merged according to the smoothing setting.
Getting rid of JPEG noise
- Raise despeckle (8 to 20) until the specks around letters disappear from the preview.
- In colour mode, choose exactly the number of inks in the artwork plus one for the paper; extra clusters catch the halos and become thin slivers.
- If edges look jagged, raise smoothing; if corners of lettering are rounded off, lower the corner threshold.
- A larger source always traces better than a sharpened small one: scan at 300 DPI or more if you can.
Scans, logos and photos
Scanned drawings and stamps: black and white mode, automatic threshold, despeckle 4 to 10. Logos saved as JPG: colour mode with the logo’s number of colours plus the background. Photos: try colour mode with 3 to 5 colours for a poster effect, but expect flat areas rather than a likeness; an AI tracer is the better tool for photographs.
Questions
Is a JPG converted differently from a PNG?
The tracing is the same. A PNG has no compression noise and can be transparent, so it usually needs less despeckle; a JPG never has transparency, so its background is the paper colour, left out in colour mode.
Will the SVG be editable?
Yes. Each colour is a group holding a path you can edit node by node in Inkscape, Illustrator, Affinity Designer or any vector editor.
Can I get an EPS or PDF?
Not today: the tracer writes SVG and DXF. Any vector editor opens the SVG and exports EPS or PDF.
Read next
Sources
- Potrace — Peter Selinger, "Potrace: a polygon-based tracing algorithm" (the algorithm; GPL-2.0) (dated September 20, 2003)
- Otsu, N. — "A threshold selection method from gray-level histograms", IEEE SMC-9 (1979) (dated January 1, 1979)
- W3C — Scalable Vector Graphics (SVG) 1.1, coordinate systems, units and viewBox (dated August 16, 2011)