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

  1. 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.
  2. 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.
  3. Open the dialog. Choose Path, Trace Bitmap. The shortcut is Shift+Alt+B.
  4. Choose a mode. On the Single scan tab, pick a detection mode. Brightness cutoff is the one for most jobs.
  5. Preview. Press Update preview, or tick Live updates, and adjust the threshold until the preview shows the shapes you want in black.
  6. Press Apply. The traced paths appear on the canvas, exactly on top of the picture, so it can look as though nothing has happened.
  7. Separate the two. Drag the top object aside. That is the trace. Click what remains, the original picture, and delete it.
  8. 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 modeWhat it tracesUse it for
Brightness cutoffEverything darker than the threshold becomes the shapeMost pictures: dark artwork on a light background
Edge detectionThin outlines along the edges between light and darkOutlines of areas, when the areas themselves are not wanted
Color quantizationThe borders between areas of different colourColoured artwork where brightness alone does not separate the parts
AutotraceOutlines, found by a different tracing engineAn alternative when the others give a poor result. It is slower
Centerline tracingA single line down the middle of each strokeLine 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.

OptionWhat it doesWhen to change it
SpecklesIgnores spots smaller than the size setRaise 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 cornersRounds off sharp cornersLower it to keep corners crisp on geometric artwork
OptimizeJoins curve segments to reduce the number of nodesRaise 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 seeCauseFix
Nothing happens, or the preview is emptyNo picture is selectedClick the picture with the Selector tool, then open Trace Bitmap
Apply seems to do nothingThe trace is lying exactly over the pictureDrag the top object aside
The trace is a solid black rectangleThe threshold is too high, or the picture is darkLower the threshold, or tick Invert image
The trace is empty or nearly soThe threshold is too lowRaise it
Fine lines break up or vanishThe threshold is cutting through them, or Speckles is removing themRaise the threshold; lower Speckles
Edges are lumpyThe picture is too smallUse a larger picture
Hundreds of tiny blobsNoise in a JPG or scanRaise Speckles; on the Multicolor tab, tick Smooth
Inkscape freezes or takes minutesThe picture is very large, or the mode is AutotraceShrink the picture first; use Brightness cutoff
Every line has become two linesAn outline mode traced both sides of each strokeUse Centerline tracing
The saved SVG is still blurry when enlargedThe picture was not deleted, or was saved without tracingDelete 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.