How to convert ink lines to vector paths?

Post questions on how to use or achieve an effect in Inkscape.
Akir
Posts: 2
Joined: Mon Aug 01, 2016 11:03 pm

How to convert ink lines to vector paths?

Postby Akir » Mon Aug 01, 2016 11:15 pm

Hello everybody,
I'm new around here, and I hope I'm not making a fool of myself by asking something that's been already answered a million times, in that case I apologize - the problem is the following: I would like to convert a scanned ink (or pencil) line into a vector path, as shown here (done by hand in GIMP):
Clipboard-1.jpg
Clipboard-1.jpg (20.78 KiB) Viewed 4792 times

With "Trace bitmap" in Inkscape the result is something completely different, that I can't use (and all searches for answers have led me back to Trace bitmap, without giving me a solution). What am I doing wrong?
Thanks,
AKir

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: How to convert ink lines to vector paths?

Postby Lazur » Tue Aug 02, 2016 1:25 am

Welcome aboad!

Inkscape doesn't offer a centerline trace as per se, you need an autotrace-based vectorizing for that (inkscape uses potrace).
Or you can try manual editing with interpolating.

No worry, it is a frequently asked questions, there are more topics on it here.

Akir
Posts: 2
Joined: Mon Aug 01, 2016 11:03 pm

Re: How to convert ink lines to vector paths?

Postby Akir » Tue Aug 02, 2016 2:23 am

Thanks a lot, "centerline trace" was indeed the search term I was missing!
Found this via here, and it seems to work so far, brilliant!

Edit: Since it's not completely straightforward for some reason, here's my workflow: Export drawing as .png in GIMP, use the online-tool to "centerline"-convert to svg, which shows the picture in Firefox. "View page source", then "Save page as", save with .svg extension (instead of .php Firefox suggests). Then import the svg as path in GIMP into the original image. Doesn't work with big, complex images though, but for small bits it's fine. Will have to experiment some with dividing up bigger images...

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: How to convert ink lines to vector paths?

Postby Moini » Sat Sep 10, 2016 10:16 am

Additional info for Linux users:
EDIT: also confirmed to work on a Mac (thanks, @cleversomeday for testing! Instructions / links a few posts below)

You can use the centerline trace extension from here:
https://github.com/fablabnbg/inkscape-centerline-trace (works with Inkscape 0.91)

For 0.48.x, you need to make the changes suggested here:
https://github.com/fablabnbg/inkscape-c ... e/issues/1

This version does not crash as often as the other one:
https://github.com/Moini/inkscape-centerline-trace

You need to install 'autotrace' to make it work (if you don't have autotrace installed, and use the first linked version, you will get a full-blown Inkscape crash).
It's also available as a Debian / Ubuntu package, but then without the fixes.
Last edited by Moini on Sun Sep 18, 2016 8:36 am, edited 1 time in total.
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

cleversomeday
Posts: 62
Joined: Tue Jan 19, 2010 6:52 am

Re: How to convert ink lines to vector paths?

Postby cleversomeday » Tue Sep 13, 2016 12:11 am

Is there any way to run this extension on the MacOS version, Moini. And is this in line to become a standard feature in the future?

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: How to convert ink lines to vector paths?

Postby Moini » Tue Sep 13, 2016 12:48 am

@cleversomeday: I have no clue as to both questions, sorry. To find out yourself, you need to find out if
'autotrace' is available for OSX, to install it, and to see what kind of error messages you may get (if you get any).

Inside the .py file, there is a comment by the author, asking if it works on Windows. I don't think they had OS X in mind when writing the extension, but I guess that it might work (but might need some tweaking, and I can't help there).
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

cleversomeday
Posts: 62
Joined: Tue Jan 19, 2010 6:52 am

Re: How to convert ink lines to vector paths?

Postby cleversomeday » Tue Sep 13, 2016 9:56 am

I was able to install autotrace on my Mac, and the extension doesn't crash, but it doesn't yield a result either, unfortunately.

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: How to convert ink lines to vector paths?

Postby Moini » Tue Sep 13, 2016 10:28 am

Mmh. That's not so bad. Can you do the following:

- Trace your image using the extension
- After this, do a 'Select all' (on Win/Linux that would be Ctrl+A, not sure what it's for you) or drag a lasso selection around the image, so you would select all objects that are created in the area of the image
- Check if there are invisible lines (new objects) where the image is

If so:
- Congrats, it works :)
- Seriously: check your picture for transparencies. If the image you are trying to trace does contain any transparencies, remove them by adding a layer of white below in a raster editing software of your choice (or make a bitmap copy of the image with a white rectangle beneath it in Inkscape).

If not:
not even error messages? :/
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

cleversomeday
Posts: 62
Joined: Tue Jan 19, 2010 6:52 am

Re: How to convert ink lines to vector paths?

Postby cleversomeday » Sun Sep 18, 2016 8:16 am

That worked! I added a white background before making a bitmap copy and the centerline trace was successful. Thanks so much!

cleversomeday
Posts: 62
Joined: Tue Jan 19, 2010 6:52 am

Re: How to convert ink lines to vector paths?

Postby cleversomeday » Sun Sep 18, 2016 8:18 am

For any of you Mac folks, here are the instrux I followed to install autotrace. http://www.getmacapps.info/install-autotrace-on-macos

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: How to convert ink lines to vector paths?

Postby Moini » Sun Sep 18, 2016 8:35 am

Cool :) Thanks for reporting back, @cleversomeday!
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)


Return to “Help with using Inkscape”