Inkscape Trace Bitmap: convert a PNG or JPG to SVG
How to convert a PNG or JPG to SVG in Inkscape with Trace Bitmap: the steps, which mode and settings to use, and what to check when the trace does not work.
Published
To convert a PNG or JPG to SVG in Inkscape, import the picture, select it, open Path, Trace Bitmap, choose a mode, and press Apply. Inkscape draws vector paths over the picture. Delete the original picture from underneath, then save as SVG. Importing a picture and saving as SVG without tracing does not convert it: the file would only hold the same pixels inside an SVG wrapper.
The steps
- Import the picture. Choose File, Import and pick the PNG or JPG. Inkscape asks whether to embed or link it. Either will do, since the picture is deleted at the end.
- Select it. Click the picture with the Selector tool, the arrow at the top of the toolbox. Trace Bitmap works on the selected picture, and does nothing without one.
- Open the dialog. Choose Path, Trace Bitmap. The shortcut is Shift+Alt+B.
- Choose a mode. On the Single scan tab, pick a detection mode. Brightness cutoff is the one for most jobs.
- Preview. Press Update preview, or tick Live updates, and adjust the threshold until the preview shows the shapes you want in black.
- Press Apply. The traced paths appear on the canvas, exactly on top of the picture, so it can look as though nothing has happened.
- Separate the two. Drag the top object aside. That is the trace. Click what remains, the original picture, and delete it.
- Save. Choose File, Save As and the Plain SVG type.
Single scan: one colour
A single scan makes one path in one colour. It is the right choice for logos, silhouettes, line art, handwriting and anything going to a cutting machine.
| Detection mode | What it traces | Use it for |
|---|---|---|
| Brightness cutoff | Everything darker than the threshold becomes the shape | Most pictures: dark artwork on a light background |
| Edge detection | Thin outlines along the edges between light and dark | Outlines of areas, when the areas themselves are not wanted |
| Color quantization | The borders between areas of different colour | Coloured artwork where brightness alone does not separate the parts |
| Autotrace | Outlines, found by a different tracing engine | An alternative when the others give a poor result. It is slower |
| Centerline tracing | A single line down the middle of each stroke | Line drawings and handwriting for a pen or engraver |
Threshold is the setting that matters in Brightness cutoff. Raise it and more of the picture counts as dark, so shapes grow and thin lines thicken. Lower it and pale areas drop out. If the artwork is light on a dark background, tick Invert image.
The difference between the outline modes and centreline tracing is worth knowing. Traced normally, a pen line 2 mm wide becomes a long thin closed shape with two sides. A cutter cuts along both sides and a plotter draws both. Centreline tracing gives one open line in place of it.
Multicolor: several colours
The Multicolor tab, called Multiple scans in older versions, traces the picture several times and stacks the results. The modes are brightness steps, colours and greys, and Scans sets how many layers are made.
- Use as few scans as the artwork has colours. Extra scans only trace the soft blending between the real ones.
- Leave Stack ticked. Each layer then extends under those above it, so no gaps show between colours. Unticked, the layers sit side by side and hairline gaps usually appear.
- Tick Remove background to drop the bottom layer, which is normally the background of the picture.
- Smooth blurs the picture before tracing, which helps with photographs and noisy JPGs.
The result is a group with one path for each scan. Use Object, Ungroup to work on them separately.
The three options
These apply to both tabs.
| Option | What it does | When to change it |
|---|---|---|
| Speckles | Ignores spots smaller than the size set | Raise it for a JPG or a scan with dust and noise. Lower it if small dots, such as the dot of an i, go missing |
| Smooth corners | Rounds off sharp corners | Lower it to keep corners crisp on geometric artwork |
| Optimize | Joins curve segments to reduce the number of nodes | Raise it for a lighter file. Lower it if curves drift from the original |
Getting a clean trace
- Start with a large picture. A trace can only follow the pixels it is given. A logo 150 pixels wide gives lumpy curves. From around 800 pixels wide the result is usually hard to tell from the original.
- PNG traces better than JPG. JPG compression leaves faint speckle round every edge. For a JPG, raise Speckles.
- High contrast helps. Clean black on white needs almost no adjustment.
- Photographs trace badly. They have no clear shapes, and the result is a pile of ragged patches. Raster vs vector explains why.
After tracing
Remove the picture. Until the original is deleted, the saved file contains both the paths and the pixels. Cutting programs may reject it, and it stays as large as the picture.
Check the nodes. Choose the Node tool and click the trace to see its points. If there are far more than the shape needs, Path, Simplify removes some.
Split it up if needed. A single scan is one path even when it draws many separate shapes. Path, Break Apart turns it into separate objects. Holes become objects too, so the inside of a letter O turns solid until the pieces are recombined: select an outline and its hole and use Path, Exclusion to restore the hole.
Fit the page. Edit, Resize Page to Selection shrinks the page to the artwork, so the SVG has no empty margin.
When Trace Bitmap does not work
| What you see | Cause | Fix |
|---|---|---|
| Nothing happens, or the preview is empty | No picture is selected | Click the picture with the Selector tool, then open Trace Bitmap |
| Apply seems to do nothing | The trace is lying exactly over the picture | Drag the top object aside |
| The trace is a solid black rectangle | The threshold is too high, or the picture is dark | Lower the threshold, or tick Invert image |
| The trace is empty or nearly so | The threshold is too low | Raise it |
| Fine lines break up or vanish | The threshold is cutting through them, or Speckles is removing them | Raise the threshold; lower Speckles |
| Edges are lumpy | The picture is too small | Use a larger picture |
| Hundreds of tiny blobs | Noise in a JPG or scan | Raise Speckles; on the Multicolor tab, tick Smooth |
| Inkscape freezes or takes minutes | The picture is very large, or the mode is Autotrace | Shrink the picture first; use Brightness cutoff |
| Every line has become two lines | An outline mode traced both sides of each stroke | Use Centerline tracing |
| The saved SVG is still blurry when enlarged | The picture was not deleted, or was saved without tracing | Delete the picture and save again |
Without installing anything
For a quick conversion, PNG to SVG and JPG to SVG trace a picture in the browser, in black and white or flat colours, and the result opens in Inkscape for further editing. To confirm that a saved file holds paths and no leftover picture, open it in the SVG viewer, which counts both.
Questions
Is the result a real SVG? Yes, once the original picture is deleted. The file then holds only paths.
Can Inkscape convert a JPG to SVG in the same way? Yes. The steps are identical for PNG, JPG and any other picture Inkscape can import.
Which mode is best for Cricut? Brightness cutoff on the Single scan tab. It gives one closed outline in one colour, which is what a blade needs. How to make an SVG file lists the other checks for a cut file.