Gimp-Forum.net
converting selection to a single line path - Printable Version

+- Gimp-Forum.net (https://www.gimp-forum.net)
+-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP)
+--- Forum: General questions (https://www.gimp-forum.net/Forum-General-questions)
+--- Thread: converting selection to a single line path (/Thread-converting-selection-to-a-single-line-path)



converting selection to a single line path - pavikpeter - 03-06-2020

I have the same issue than described here by ringo.r81

Is that possible that there is no option to save a single line path fom a one pixel wide selection in gimp?


RE: converting selection to a single line path - Ofnuts - 03-06-2020

Some solutions offered on the thread you link to... What didn't work? Better pursue the discussion over there/


RE: converting selection to a single line path - pavikpeter - 03-06-2020

(03-06-2020, 04:28 PM)Ofnuts Wrote: Some solutions offered on the thread you link to...  What didn't work?

Most of the solutions mentioned there, were Inkscape related rather than Gimp. My question was if there is a solution using Gimp.

The problem:
I create a jigsaw pattern, convert it into svg format and translate this format into G-code (using another application) that is capable to control a laser engraver. When I insert the jigsaw net and select it by using "select by color" tool I get the outline of the selection instead of centerline.  Outline is useless for me I need centerline. My question is: how can I get the centerline of the selection or I may ask: How to select and what to select that results a single line svg picture of the jigsaw pattern.

I attach my file below.


RE: converting selection to a single line path - rich2005 - 03-06-2020

It is certainly possible in Gimp. A single pixel center line trace is not the easiest however:

Closely related to Inkscape in that autotrace is used. https://github.com/autotrace/autotrace/releases

That is called by a Gimp plugin, plugin-trace.py see:  http://gimpchat.com/viewtopic.php?f=9&t=17485

Easier to set up in linux than Windows, packing in for the night but a first try (in linux) gives the attached. Will see about Windows tomorrow Wink

Bottom line, you would be better off using Inkscape.


RE: converting selection to a single line path - pavikpeter - 03-06-2020

I tried Inkscape as well. I got a distorted output of my original file.

It was my original picture:
[attachment=4030]

After tracing:
[attachment=4031]

Telling the truth your Gimp solution also resulted a distorted trace.


RE: converting selection to a single line path - rich2005 - 03-07-2020

Quote:...Telling the truth your Gimp solution also resulted a distorted trace....

Good, if it is not going to work for you, that saves me having to set up autotrace in Windows, although telling the truth, it only traces what you give it.

[attachment=4032]

Maybe you should be making the path(s)  first, rather than raster -> selection -> path. 
Inkscape has a jigsaw extension. 
Gimp has a jigsaw plugin from here http://sourceforge.net/projects/gimp-path-tools/files/scripts/  Inkscape / Gimp look like this.

[attachment=4033]


RE: converting selection to a single line path - pavikpeter - 03-07-2020

(03-07-2020, 08:48 AM)rich2005 Wrote: Gimp has a jigsaw plugin from here http://sourceforge.net/projects/gimp-path-tools/files/scripts/

That is exactly what I needed. Thank you very much.