How to get curved text from Inkscape to Gimp without fuzz?
November 6, 2021 7:39 PM   Subscribe

I'm working on a weaving draft that has some woven text. I need to make my smallish (10 pixel or 18 pixel high) text follow a (customized) curvy line, and I need the whole image to only have black and white pixels. I've got Inkscape and Gimp. Please help!

So I can make my text and put it on a curve in Inkscape. And I can save that file as an SVG and open in it in GIMP as a 90x700 pixel image where it's full of gray antialiasing on a transparent background. Sigh.

My procedure for the Inkscape part:
1. Open a new file
2. Set the document properties to make the size and display units = px
3. Use the Text tool, set the font size using px rather than points (and set to 12 or 18). Type my text.
4. Draw the line I want my text to follow with the Bezier pen. Futz with the nodes to make it nice.
5. Select both the text and the curve, then in Text menu choose "put on path"
6. (revisit steps 4/5 until I like it)
7. Select just the text (using the Objects list) and choose Object to Path
8. Copy my new objects to a new clean document with the same properties settings. Save it.

On the Gimp side, all I have to do to see the issue is Open the .svg image. The image size in preview has the right dimensions. I've been accepting the defaults in the Open dialog (image size, X ratio/Y-ratio locked and = 1.0000, resolution 90.000 px/in, and the Import Paths box is unchecked. (the Merge imported paths box is grayed out).

Can you help me figure out what I need to do differently to do this Inkscape > Gimp move constructively?
Alternately, how would I manipulate the text gracefully entirely within Gimp?

Finally, let me reiterate that the end use of this file is part of a weaving draft/instructions for a loom. Threads are either up or down, like black or white pixels, so I can't settle for grayscale (or vector) images. And most scenarios will need to eventually decorate the black and white areas with actual thread-by-thread interlacement, which is straightforward with Gimp pattern fills.

Thanks!
posted by janell to Computers & Internet (8 answers total)
 
The term for the “fuzziness” is anti-aliasing. You should be able to export a raster file directly from Inkscape with anti-aliasing off. I am unsure if gimp has this option for imports, but photoshop does.
posted by q*ben at 7:48 PM on November 6, 2021


Response by poster: My question is *how*
posted by janell at 7:54 PM on November 6, 2021


Try applying the threshold tool to the imported image in Gimp. You may need to flatten the image first to remove the transparency and get a grayscale image.
posted by whatnotever at 8:17 PM on November 6, 2021


Best answer: Export a png from Inkscape. At the bottom of the dialog box there is a checkbox next to the word “anti-aliasing”. Uncheck that box.
posted by q*ben at 8:41 PM on November 6, 2021 [1 favorite]


Best answer: the Import Paths box is unchecked

I second q*ben's approach, but I'd also be curious whether checking this option would import the svg as an actual vector image instead of doing whatever raster conversion it's doing.
posted by trig at 8:53 PM on November 6, 2021


Response by poster: Exporting a PNG with the antialiasing set to NONE seems to have done the trick. Thank you for saving me from hours of youtube GIMP tutorials!
posted by janell at 9:53 PM on November 6, 2021


Best answer: Here's a non-YouTube GIMP tutorial that will show you how to do whole thing inside GIMP and avoid the import step altogether.

The key is knowing that GIMP text layers have a Text Along Path option that converts the text into a set of outline paths for each of the characters and then warps that to make its baseline run along the currently selected path.

You can tweak the character path as much as you like, then use its Fill option to lay down pixels into the currently selected layer. You'll want to have both Layers and Paths dialogs exposed so you can keep track of which of each is currently selected.

To avoid anti-aliasing you can either turn it off at the step where you fill the curved text path with a colour, or use Colors->Threshold to get rid of it after it happenes, or use Image->Mode->Indexed with a 1-bit (black and white) color palette to make sure it can never happen in the first place. Threshold gives you more scope to tweak the look of it than the other methods.
posted by flabdablet at 1:06 AM on November 7, 2021 [2 favorites]


Afterthought: if you're going the 1-bit color palette route, make sure you turn dithering off as well, or the code will attempt to dither the antialiasing on its way to converting it to black and white, which will make the edges of your text look horribly rough. With dithering turned off, it should do the equivalent of clean thresholding automatically.

That said, I still recommend using Grayscale (no palette) mode and doing the thresholding step explicitly, nudging the threshold either side of 50% to get the text looking the best it can.
posted by flabdablet at 9:10 AM on November 7, 2021


« Older Recommendations for bars with heated patios in...   |   What toy did I have? Newer »
This thread is closed to new comments.