4

I have an img that it is a black line. I try to convert to vector: Inkscape > Path > Trace Bitmap. Even the img is just a fine line, it makes two vector lines: one for the outside border of the original shape and another for the inside border.

If I select the shape with the arrow it seems just one line. But if I select with the Edit path tool seems like two parallel lines.

Do you know how to make the vector conversion with just one line? Or perhaps, is there a way to make the two lines into one, later?

The shape is very complex, but as an example, I show you a simple circle. It has two lines and I need just one:

enter image description here

  • Do you mean "Trace Bitmap"? There is no "convert bitmap" in Inkscape. There is a centre line trace extension for Inskcape, however I've never been able to get it to work. – Billy Kerr Aug 7 '18 at 10:36
  • @Billy: Yes, Trace Bitmap, I have corrected it – Nrc Aug 7 '18 at 10:59
2
  1. Set the fill color to transparent and apply a stroke to your shape.

  2. In the menu, go to Path > Break Apart to separate the shape into multiple individual paths.

  3. Delete the extra paths you don't need.

This might not preserve the exact shape of the original object but might be good enough depending on what kind of shape you are working with.

| improve this answer | |
1

I guess you want so called centerline tracing or a way to convert normal Inkscape tracing result to it.

If your curve happens to be uniformly wide and do not cross itself, you can get a good result:

enter image description here

  1. A bitmap curve, about 5 mm wide, high contrast, high resolution, sharp, no JPG compression artifacts (=easily traceable)

  2. Traced bitmap, fill removed, 0.5mm stroke

  3. Divided with the node tool to 2 separate curves, end segments are deleted. Remember to confirm all divisions with Path > Break apart. If your original was a closed shape like a circle, no divisions at nodes are needed, only Break apart.

New colors are selected to make this explanation clearer

  1. Deleted the red curve, the blue curve got 5 mm wide stroke. In Inkscape the edge will be 2,5mm aside from the path => one of the edges shoud be the wanted centerline trace.

  2. Stroke is outlined (Path > Stroke to Path), removed the fill, new stroke width = 0.5 mm

  3. Divided again like in step 3. Tested, how well the result fits in the original traced curve

Conclusion: quite as good as the original tracing

One can ask "why all this complexity, why do you not simply use Path > Dynamic offset?"

Answer:

  • there's no easy to input numeric offset value, it must be adjusted by eye
  • it goes bust with open paths and when the curve is near itself.
| improve this answer | |
  • Can you please explain point 3? What exactly do you click? I tried F2 > [Break path at selected nodes] or Path > [Break Path]. No success. For example I would like to get the outer part of the letter G, without bothering for center line. – Przemyslaw Remin May 28 at 11:23
  • If you break path at 2 simultaneously selected nodes you must in addition apply Path Break Apart to make the parts separate objects. The latter is not needed if you select 2 adjacent nodes and delete a segment between the selected nodes. – user287001 May 28 at 12:55
0

An extension for doing centerline tracing is available here: https://github.com/fablabnbg/inkscape-centerline-trace

Depending on your drawing (a circle?), sometimes it may be more exact and just as quick to redraw the shapes, though.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.