Vectorising an Image: How Tracing Works and How to Tune It
Vectorisation is often described as converting an image to a scalable format, which makes it sound like a format change. It is not. It is an interpretation: an algorithm looks at a grid of pixels and tries to guess what shapes a human would have drawn to produce them. On a logo made of three flat colours the guess is nearly perfect. On a photograph of a forest it is hopeless, and understanding why saves a lot of wasted effort.
What the tracer is actually doing
- Colour quantisation. The image is reduced to a small palette, mapping thousands of similar shades to a handful of representative colours.
- Region detection. Adjacent pixels sharing a palette colour are grouped into connected regions.
- Boundary extraction. The outline of each region is traced as a sequence of pixel-edge steps, which at this point is a jagged staircase.
- Curve fitting. The staircase is approximated with straight segments and Bezier curves, trading exactness for a far smaller number of control points.
- Output. Each region becomes a filled path in the SVG, stacked so that overlapping regions render correctly.
Every stage loses information deliberately. That is the point: an SVG that reproduced every pixel exactly would be larger and slower than the original bitmap and would gain nothing. The parameters you adjust are all controls on how much is lost at each stage.
Which images vectorise well
| Source | Result | Why |
|---|---|---|
| Logo, flat colour, sharp edges | Excellent | Few regions, clean boundaries, exactly what tracing models |
| Black and white line art or signature | Excellent | Two-colour problem with well-defined strokes |
| Clean scanned drawing | Good with preparation | Needs contrast adjustment and despeckling first |
| Icon or flat illustration | Good | Limited palette by design |
| Photograph of an object on plain ground | Stylised, not faithful | Continuous tone collapses into visible colour bands |
| Landscape, foliage, crowd, texture | Poor | Effectively no flat regions, producing thousands of tiny paths |
| Gradient or soft shadow | Poor | Becomes hard-edged bands regardless of settings |
The parameters that matter
Number of colours
The dominant control. It sets the palette size before tracing begins. For a two-tone logo, set it to two or three and the output will be clean and tiny. Raising it to 32 on the same logo invents dozens of near-identical shades from anti-aliased edge pixels and litters the file with slivers. Start at the number of colours you can actually count in the source and raise it only if something is missing.
Threshold
On monochrome tracing, this is the brightness cut-off between foreground and background. Too high and thin strokes break up; too low and separate strokes bleed into one another. For scanned line art this is usually the parameter that needs the most attention, because scanner exposure varies across the page.
Noise filtering or minimum area
Discards regions below a size threshold. This removes dust, scanner speckle and compression artefacts that would otherwise each become a path. Raise it until the specks disappear, then stop, because it will happily eat dots on letters and fine detail if pushed further.
Path smoothing and simplification
Controls how aggressively the staircase boundary is approximated with curves. Higher smoothing gives fewer control points, smaller files and softer corners. On organic shapes this is an improvement. On anything with deliberate sharp corners, such as type or geometric marks, too much smoothing rounds them off and the result looks subtly wrong without an obvious reason.
Preparing the source, which matters more than the settings
Most disappointing traces are caused by the input, not the parameters. Ten minutes of preparation beats an hour of parameter tweaking.
- Work from the largest, cleanest version you have. Tracing a 200 pixel logo pulled from a web page reproduces its compression artefacts faithfully.
- If the source is a JPEG, the artefacts around edges will become real shapes. A lossless source is worth chasing.
- Increase contrast so that what should be one colour actually is one colour. Anti-aliased edges are the main source of spurious intermediate shades.
- Crop away everything you do not need before tracing rather than deleting paths afterwards.
- For scans, correct rotation first. A slightly skewed scan produces stepped diagonal edges that the tracer dutifully reproduces.
Cleaning up the output
A trace is a starting point. Expect to open the result in a vector editor and tidy it.
- Delete stray paths. There are almost always a few tiny shapes left along edges.
- Merge paths that should be a single shape but were split by a colour boundary running through them.
- Check corners on any lettering. Smoothing rounds them and it is the most common giveaway that a logo was traced rather than redrawn.
- Reduce the node count where the tracer was over-generous. Fewer points render faster and are far easier to edit later.
- Verify at small sizes as well as large. Detail that looks fine at 400 percent can turn into mush at icon size.
For a logo you will use repeatedly, tracing is best treated as a reference layer for a manual redraw rather than as a finished asset. The redraw takes longer once and is correct forever.
Common questions
Why is my traced SVG larger than the original PNG?
Too many colours, or too little smoothing, or a photographic source. Each of these multiplies the number of paths. Reduce the palette first, since it usually cuts file size by an order of magnitude.
Can I recover an original vector logo by tracing a bitmap of it?
You can recover something that looks similar, not the original. Curve positions will differ, corners will be approximated and the layer structure is gone. For a brand asset, ask the owner for the source file before tracing.
Why do traced edges look slightly soft?
Anti-aliasing in the source created intermediate pixels that became their own thin regions between the main shapes. Raise contrast before tracing, or lower the colour count so those intermediates merge into their neighbours.
Is SVG always better than PNG?
No. SVG wins for shapes: logos, icons, diagrams. PNG wins for anything with photographic detail, where an SVG would be larger, slower to render and less accurate. Choose by content type, not by a general preference.
Try it yourself
The settings described above are all adjustable in the tool. Files stay on your device; nothing is uploaded to a server.
Open the vector tracerRelated guides
- Making a Video File Smaller Without Making It Look BadVideo size is governed by four settings that interact. Change them in the right order and you can often cut a file by three quarters with no visible difference.
- Audio Formats and Bitrates: Choosing Settings That Are Not GuessworkBitrate, sample rate and bit depth get confused constantly. Here is what each one controls, and the settings that make sense for speech, music and archiving.
- Image Optimisation for Core Web Vitals: A Working ChecklistImages are usually the largest thing on a page and the most common cause of a poor Largest Contentful Paint score. This is the sequence of fixes that actually moves the number.