How to Copy-Paste Text from Inkscape into Krita

Share
In this tutorial, we'll learn how to copy text and other vector graphics from Inkscape (version 1.3) and paste them in Krita (version 5.2), so that we can quickly create text using Inkscape's powerful text editing and shape-editing tools.

This tutorial is meant to simple projects. If your project is complex and the text or vector graphics need to be adjusted a lot, it's recommended to use a file layer so you don't need to keep copy-pasting every change.

Foreword

If you copy and paste Inkscape objects into Krita normally, with Ctrl+C and Ctrl+V, they can look completely different from how they look in Inkscape. That's because you're pasting SVG code into Krita, which makes Krita create a vector layer to display the SVG.

SVG is an open format and many programs can display SVG—but in order to do that, an algorithm needs to render the vector graphics. Different programs will have different rendering algorithms (different implementations), and so they can look subtly or completely different. In particular, because Inkscape is a program made for editing SVG, it has some features that are proprietary of Inkscape, that aren't part of the SVG standard. Normally, you are supposed to use "File -> Save a Copy..." with the "Plain SVG" format if you intend to use that SVG in a web browser, for example, because this method uses only saves the commonly available in SVG renderers. As we're copy-pasting, we can't do that, so the solution is to rasterize the vector instead..

Tutorial

When we copy something from Inkscape, it stores in the clipboard a SVG version and a rasterized version of what was copied. The application where we paste it, in this case, Krita, normally selects only the version it supports, but in this case Krita supports both vector and raster graphics, which means we need a way to make it ignore the vector and use only the raster image the way that Inkscape is capable of rendering it.

Let's see how to do that.

1: create a new document in Krita.

2: switch to Inkscape, and create a new document in Inkscape by selecting the "Video" template so that our units will be pixels. By default, they will be in millimeters. If you can't figure out how to do that: create a new document any way you can; click on File -> Document Properties on the menubar; on the "Front page" section, click on the "Format" button to change the format to something in pixels; or manually change the units in "Front page" and "Display" to px; finally, change the scale to 1.0.

3: in Inkscape, use the text tool (keyboard shortcut: T) to write some text. On the toolbar, change the font, font size, text alignment, and other text properties as you wish. Note that you can select parts of the text and change its color by left-clicking on the palette at the bottom, and change the stroke color by Shift+Left Clicking on the palette.

4: switch to the selector tool (S) and select the text object. You should see 8 arrows on its sides and corners that let you scale the text if you did this correctly.

5: click on Edit -> Make a Bitmap Copy on the menubar (Alt+B). This will create a raster image inside Inkscape that looks exactly like the copied text.

You can use the arrow keys to move it around or drag it with the selector tool. You should see two objects that look like text. You can tell which one is the SVG text and which one is the raster bitmap by trying to click on them with the text tool: only the SVG text has editable text. Alternatively, you can click on Object -> Layers and Objects... to view all objects in the document in a panel. The text and the bitmap will have different icons in this panel.

6: with the "bitmap copy" object selected, click on Edit -> Copy on the menubar to copy the text (Ctrl+C).

7: switch to Krita.

8: create a new paint layer and select it. This is the normal type of layer that gets created when you simply click the "+" button on the "Layers" docker.

9: click on Edit -> Paste into Active Layer. This will paste the rasterized bitmap from the clipboard instead of the SVG, because the selected layer is a paint layer, so it doesn't support pasting SVGs into it.

Note: let's hope that Krita never adds the ability to automatically rasterize SVGs itself because such improvement would break our workflow.

Note: if you select a vector layer instead, it will paste the SVG code, which will render incorrectly in Krita.

Note: this action doesn't have a default keyboard shortcut, so if you plan to do it a lot, it may be a good idea to customize Krita's keyboard shortcuts and set a custom one for it.

10: switch to the move tool (T) and move the text to where you want.

11: if you did something complicated in Inkscape that you might want to change the in the future, make sure to save your Inkscape file as well so you can edit it later.

The advantage of this method is that it's fast, so if you only want to add a few pieces of text to the image, or even a few vector shapes like rectangles, stars, triangles, hexagons, etc., it's very convenient.

You can also use filter effects in Krita on your text, although Inkscape has its own effects too. For example, you can add strokes and drop shadows in Krita using layer styles (in Layer Style... in their layer's context menu).

The disadvantage is that if you need edit the text, you'll need to repeat this process every time, both copy-pasting AND moving the text to its correct location.

Aligning Text Precisely

If you don't want to guesstimate where to place the text layer in Krita, it's possible to place it at exactly the same coordinates as it was in Inkscape using two techniques.

First, copy the canvas from Krita to Inkscape so you can align the text properly in Inkscape.

1: in Krita, click on Select -> Select All.

2: then click on Edit -> Copy Merged.

3: in Inkscape, click on Edit -> Paste.

4: use Object -> Lower to Bottom to place the image under the text if you have added any already.

5: change the coordinates of the image on the toolbar to X: 0, Y: 0. You can do this by enabling snapping and dragging it.

6: place the text where it should be on the image.

If you have lots of text, it's a good idea to separate the background and image in two layers in Inkscape.

7: copy the text as explained in the technique above.

After you paste the text in Krita, follow the following steps to position it on the exact coordinates as they were in Inkscape:

1: on Inkscape, select the text object you had pasted so that its X, Y coordinates appear on the toolbar.

2: copy the value of the X coordinate.

3: on Krita, select the paint layer where you pasted the text, and select the move tool.

4: in the tool options docker, you'll find the position of the layer as a pair of X, Y coordinates. In both Krita and Inkscape, this value refers to the top-left coordinate of the bounding box. If you draw something on the paint layer, it's going to change, so in order for this to work you must not edit the layer where you pasted the text from Inkscape. Paste the X coordinate you copied from Inkscape in Krita's move tool options.

5: repeat for the Y coordinate.

If you are doing many small adjustments to text like this, it might be useful to use the file layer method instead.

Creating Curved Text

As a bonus, you can create curved text in Inkscape by drawing a path first and then selecting both the text and the path and using Text -> Put on Path. If you do this, the path will stay visible, so you need to go to Layers and Objects... and hide the path by clicking on its eye icon.

Video

Observations

For the record: as of writing, if you copy and paste a text with fill and stroke in Inkscape and paste it in Krita, the entire text becomes the stroke color, and the fill color is nowhere to be seen.

Originally this tutorial didn't have the step to convert to a bitmap in Inkscape, because I assumed that happened automatically if you tried to paste into a paint layer. However, when I tried to copy and paste curved text, it wasn't curved in Krita even though I was pasting into a paint layer, so the bitmap step is necessary. On top of that, the "paint into active layer" step is also necessary even when copying a bitmap from Inkscape.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *