Krita and SVG: open, import and save as SVG
Krita opens SVG files and saves vector layers as SVG, but a painting on paint layers is pixels. What works, the menu to use, and how to trace a painting.
Published
Krita can open an SVG, and it can save one, with a condition that explains most of the confusion: only vector layers are saved as SVG. The command is Layer, Import/Export, Save Vector Layer as SVG. Anything painted with a brush lives on a paint layer, which is made of pixels, and no menu turns those pixels into shapes. A painting has to be traced to become an SVG.
The facts about Krita here are from the Krita Manual, version 5.3.0.
What Krita can and cannot do
The manual describes Krita as “primarily a raster graphics editing tool, which means that most of the editing changes the values of the pixels on the raster that makes up the image”. Its vector tools are an addition to that, and since version 4.0 they are built on SVG.
| Task | In Krita |
|---|---|
| Open an SVG file | Yes, as a new document with a vector layer |
| Paste shapes copied from Inkscape | Yes |
| Edit the shapes of an SVG | Yes, on a vector layer |
| Save a vector layer as an SVG | Yes: Layer, Import/Export, Save Vector Layer as SVG |
| Save brush strokes on a paint layer as vector shapes | No. They are pixels |
| Turn a vector layer into pixels | Yes: Convert to Paint Layer, or Rasterize Layer |
| Use SVG symbols as a library | Yes, in the Symbol Libraries docker |
Opening and importing an SVG
The manual gives two ways to bring an SVG in:
- “Open a SVG file in a new document, edit Vector Layer content, copy/paste it or copy/paste shapes from it.”
- “Paste a SVG content copied from another software like Inkscape for example.”
So an SVG opens as its own document, with the drawing on a vector layer. To use it in a painting you already have, open the SVG, copy the shapes, and paste them into the other document. Copy and paste also works directly between the two programs: “You can copy and paste vectors from Krita to Inkscape, or from Inkscape to Krita.”
Not everything in an SVG is understood. The manual says “only the SVG 1.1 features are supported, with exception of smaller features like the mesh gradients”. If a file looks different in Krita, open it in the SVG viewer to see how a browser draws it and what it holds. Text set in a font you do not have is the usual difference in any program.
Older versions were more limited. The manual notes that “Krita 2.9 to 3.3 supports importing SVG via the add shape docker” and that “since Krita 4.0, SVGs can be properly imported”.
Drawing vectors in Krita
To end up with an SVG, the drawing has to be on a vector layer from the start.
- In the Layers docker, click the drop-down arrow beside the Add layer button and choose Add Vector Layer. The manual gives the default shortcut as Shift + Ins.
- Draw with the shape tools. On a vector layer, the manual says, “all the usual drawing tools outside the Freehand, Dynamic and the Multibrush tool can be used to draw shapes”. Its page on vector layers lists the Bezier Curve, Freehand Path, Straight Line, Polygon and Polyline tools, the Ellipse and Rectangle tools, the Calligraphy tool and the Text tool.
- Adjust the shapes with the Select Shapes tool and the Edit Shapes tool. Double-clicking a selected shape opens the right one.
Shapes take “the current brush size to determine stroke thickness, as well as the current foreground and background color”. A fill can be “a solid color, a gradient or a pattern”, and a stroke can also have dashes and markers.
The catch for painters is in step 2. The Freehand Brush is one of the tools the manual leaves out, so it does not make vector shapes: a sketch drawn with it is pixels. For a hand-drawn line that stays a vector, the tool in the manual’s list is Freehand Path.
Saving a vector layer as SVG
- Select the vector layer in the Layers docker.
- Choose Layer, Import/Export, Save Vector Layer as SVG.
- Name the file and save it.
The manual describes the command as “save the currently selected vector layer as an SVG”, and its page on the SVG format says the same menu item exports single vector layers. It saves one layer at a time. A document with three vector layers gives three files, or you can gather the shapes onto one layer first.
Paint layers are not part of the file. If the saved SVG is missing most of the picture, that is why.
Krita’s own .kra files hold vector layers as SVG inside them. The manual says Krita “saves as SVG inside KRA files”, so vector work is kept as vectors when you save the document normally.
Check what was saved by opening the file in the SVG viewer. It shows the size and counts the paths and text elements. Text saved as text depends on the font being present wherever the file is opened next.
Turning a painting into an SVG
For a painting on paint layers, the route is tracing: a program looks at the pixels and draws shapes round the areas of colour.
- Export the painting from Krita as a PNG.
- Open PNG to SVG and choose the file.
- Pick black and white for line art and cut files, or colours for flat-colour artwork, and move the threshold or the number of colours until the preview looks right.
- Download the SVG.
Tracing suits some pictures and not others. Flat colours, clean inked lines, silhouettes and logos trace into a small number of tidy shapes. A soft, painterly picture with gradients and texture comes out in at most twelve flat colours and looks like a poster of the original. Convert a picture to SVG goes through what to expect and how to prepare a picture, and raster vs vector explains why the two kinds of image do not convert freely.
To make tracing easier, work in Krita with that end in mind: ink on its own layer in solid black, use a hard-edged brush for the line work, and export large. From about 800 pixels across, a trace is hard to tell from the original, and the tracer scales anything over 2,000 pixels on its longer side down to that.
To turn a painting or photo into hatching, stippling or dots instead of outlines, for a pen plotter or a laser, use the Plotcaster editor, which saves those drawings as SVG.
Making a cut file from Krita
A laser cutter or a cutting machine follows the outlines in an SVG, so it needs real shapes.
- If you can, draw the cut lines on a vector layer with the Path or shape tools, and save that layer as SVG. The lines are exact, and they stay editable.
- If the design is already painted, trace it as above. Use a black and white version: one colour traces most cleanly.
- Convert text to shapes before sending the file to a machine, so that it does not depend on a font.
- Set the real size. Resize SVG writes the width and height in millimetres or inches without changing the drawing.
SVG for Cricut and vinyl cutters covers what a cutting program expects from the file.
Symbol libraries
Krita uses SVG in one more place. The Symbol Libraries docker “loads the symbol libraries in SVG files, when those SVG files are put into the symbols folder in the resource folder”, which you reach through Settings, Manage Resources, Open Resource Folder. The symbols “can then be dragged and dropped onto the canvas”. The manual adds that “you cannot make symbol libraries with Krita yet”, but they can be written by hand or made in Inkscape.
Vector to pixels
Going the other way is one command. The Layer menu has Convert to Paint Layer, which will “convert a mask or vector layer to a paint layer”, and Rasterize Layer, “for making vectors into raster layers”. After that the shapes are pixels and can be painted on, and they can no longer be saved as SVG, so keep a copy of the vector layer if you might need it.
Questions
Can Krita export the whole image as one SVG? The manual documents saving single vector layers. To get several layers into one file, combine the shapes on one vector layer first, or join the saved files in a vector editor such as Inkscape.
Why is my saved SVG empty? The selected layer held no vector shapes. Brush strokes are on paint layers and are not saved.
Is Krita a good SVG editor? For adding shapes and text to a painting, yes. The manual calls Krita “primarily a raster graphics editing tool”, and where its page on the SVG format talks about editing SVG files, the program it names is “a vector program like Inkscape”. For quick changes without installing anything, see how to edit an SVG.