GIMP and SVG: open, export and convert PNG to SVG
What GIMP can do with SVG: open one as pixels, export paths as SVG, export vector layers in GIMP 3.2, and turn a PNG into an SVG outline by way of a path.
Published
GIMP is a pixel editor, so its support for SVG is partial. It can open an SVG, but it turns the drawing into pixels as it does so. It can save a path as an SVG file, which was for many years the only way to get vector shapes out of it. From version 3.2, GIMP’s own documentation describes an SVG export for whole images: vector layers are written as shapes, and ordinary pixel layers are either embedded as pictures or left out. What GIMP cannot do is turn a photograph or a PNG into clean vector shapes by saving it under a new name.
What GIMP can and cannot do
| Task | In GIMP |
|---|---|
| Open an SVG to look at it or paint on it | Yes. It is converted to pixels at a size you choose |
| Edit the shapes of an SVG and keep it a vector | No. Use a vector editor |
| Bring the outlines of an SVG in as paths | Yes, from the Paths dialog |
| Save a path as an SVG | Yes, from the Paths dialog |
| Export an image with vector layers as SVG | Yes, in GIMP 3.2 |
| Export a photo or PNG layer as real vector shapes | No. A pixel layer stays pixels inside the SVG |
| Turn a simple PNG shape into an SVG outline | Yes, roughly, by selection and path |
Opening an SVG in GIMP
Choose File, Open and pick the .svg file. GIMP asks what size to draw it at, then makes an ordinary image of pixels at that size. Choose a size as large as the work needs, because enlarging afterwards blurs it, as with any pixel image.
From that point the file is a picture. The shapes cannot be selected or reshaped one by one, and exporting to PNG or JPG gives what any SVG to PNG conversion gives. If that is all that is wanted, SVG to PNG does it without installing anything.
To keep the outlines as vectors inside GIMP, bring them in as paths instead. Open the Paths dialog (Windows, Dockable Dialogs, Paths), open its menu by right-clicking in the list, and choose Import Path. GIMP’s manual notes that SVG shapes such as rectangles and circles are loaded as paths too. Paths in GIMP are guides for selecting, stroking and filling. They are not drawn until you use them.
Saving a path as SVG
This works in GIMP 2.10, 3.0 and 3.2.
- Draw a path with the Paths tool, or make one from a selection with Select, To Path.
- Open the Paths dialog.
- Right-click the path and choose Export Paths (Export Path in older versions).
- Give the file a name ending in .svg and save.
GIMP’s manual says paths are stored in SVG files without losing any information, since SVG describes curves in almost the same way GIMP does. The file holds the outline only. Colours, fills and layers in the image are not part of a path, so they are not in the file. Open it in Inkscape or another vector editor to give the outline a fill.
Exporting an image as SVG in GIMP 3.2
GIMP 3.2 added vector layers: layers made from a path, with their own fill and stroke that stay editable. Its release notes say that with them GIMP can export SVG holding both vector and raster layers.
- Draw a path with the Paths tool.
- In the tool’s options, press Create Vector Layer from Path, and set the fill and stroke.
- Choose File, Export As, and give the file a name ending in .svg.
- In the SVG export dialog, choose how pixel layers are treated under Embed raster layers as.
The manual lists three choices:
| Choice | Result |
|---|---|
| PNG (always) | Every pixel layer is placed in the SVG as a PNG picture |
| JPEG (for opaque images, PNG otherwise) | Layers without transparency go in as JPEG, the rest as PNG |
| Do not export raster layers | Pixel layers are left out, and only vector content is written |
The first two are worth understanding before using them. An SVG that contains an embedded PNG is a picture inside a wrapper. It ends in .svg, but it blurs when enlarged, and a cutting machine or laser has no outline in it to follow. For a file made of shapes only, use vector layers and choose Do not export raster layers.
In GIMP 2.10 and 3.0 there is no SVG choice for exporting an image. Typing a name ending in .svg into the export box does not help there. Export the path instead, as above.
Converting a PNG to SVG in GIMP
GIMP has no tracing command like Inkscape’s Trace Bitmap. What it has is Selection to Path, which turns the edge of a selection into a path. For a simple shape in one colour, such as a silhouette or a bold logo, that is enough.
- Open the PNG.
- Choose the Select by Color tool and click the shape. Everything in that colour is selected. For one connected area, use Fuzzy Select instead.
- Check the selection edge follows the shape. Raise or lower the tool’s Threshold and click again if it does not.
- Choose Select, To Path.
- In the Paths dialog, right-click the new path and choose Export Paths. Save it as an .svg file.
In GIMP 3.2 you can instead make a vector layer from the path and export the image as SVG with raster layers left out, which keeps a fill.
Expect a rough result. The manual itself says a path made from a selection will not usually match it perfectly. The path follows the pixel edge of the selection, so a small or soft-edged PNG can give a lumpy outline with many points. Start from the largest image available.
For anything beyond a simple shape, a tracer does better:
- PNG to SVG on this site traces in the browser, in black and white or in up to twelve flat colours, and the result holds shapes only.
- Inkscape’s Trace Bitmap gives more control and is free: see Inkscape Trace Bitmap.
A common and sensible division of work is to clean the picture in GIMP (remove the background, raise the contrast, paint out specks), export a PNG, and trace that. How to convert a picture to SVG covers preparing a picture for tracing.
Common problems
| What you see | Cause | Fix |
|---|---|---|
| No SVG in the list of export formats | A version before 3.2 | Export a path from the Paths dialog, or update GIMP |
| The exported SVG is blurry when enlarged, or a cutting program finds no outlines in it | It holds an embedded picture, not shapes | Use vector layers and leave raster layers out, or trace the picture |
| The exported path file looks almost empty | GIMP writes a path as an outline, generally a thin stroke with no fill | Zoom in, or add a fill in a vector editor |
| The SVG opened in GIMP is blurry | It was drawn into pixels at a small size | Open it again and enter a larger size |
| The path from a selection is jagged | The source picture is small, or the selection edge is rough | Use a larger picture, or a tracer |
| The saved path is missing parts of the design | Only the selected colour became a path | Select and export each part, or trace in colours |
Questions
Can GIMP edit an SVG? Not as a vector. It can paint on the pixel version, and it can import the outlines as paths, but moving points and saving the drawing back as the same SVG is a job for a vector editor. How to edit an SVG file compares the options.
How can I tell whether an SVG holds shapes or a picture? Open it in the SVG viewer. It lists the commonest elements in the file and says when a picture is stored inside it. A file with one image and no paths is a picture in a wrapper.
Is GIMP the right program for making cut files? It is good for preparing a picture and poor for drawing shapes. Inkscape is the free program built for vector work.