Switch to full style
Ask all general Gimp related questions here
Post a reply

Path: reduce the number of nodes while keeping the shape

Fri Dec 20, 2019 5:30 am

GIMP Version: 2.10.14
Operating System: Windows
GIMP Experience: New User



:wvy
I cut a flower and then alpha to selection and edit / selection to path.
Then I want to act on the path, then I appear the nodes and there it is the horror because lots of nodes overlap.
How to have the same path with a minimum of nodes, without being obliged to delete the nodes 1 by 1 with ctrl + shift?
Example:
Image

Re: Path: reduce the number of nodes while keeping the shape

Fri Dec 20, 2019 6:19 am

Nothing that I know of in Gimp. You should really start creating paths by hand. It gets easier with experience and practice.

However, you can use Inkscape.
Export the path from Gimp as an svg then open that svg in Inkscape.

01-path.jpg
01-path.jpg (134.69 KiB) Viewed 5170 times


Simplify the path in Inkscape, one keypress ctrl-L, and then save the resultant svg

02-path.jpg
02-path.jpg (133.64 KiB) Viewed 5170 times


Import the Inkscape svg back into Gimp.

03-path.jpg
03-path.jpg (103 KiB) Viewed 5170 times

Re: Path: reduce the number of nodes while keeping the shape

Fri Dec 20, 2019 6:59 am

rich2005, :wvy
Not used Inkscape for several months .. (and I only learned a few basics) so by opening the way in Inkscape, I found only the solution to remove 1 by 1 the nodes ...So I'm putting off studying paths with Inkscape until later.
rich2005 wrote: You should really start creating paths by hand. It gets easier with experience and practice.

I started a long time ago, :) I just asked this question here because I asked myself it by testing the parameters of certain Gimp tools, which I have never used.

Re: Path: reduce the number of nodes while keeping the shape

Fri Dec 20, 2019 8:11 am

level_0 wrote:rich2005, :wvy
so by opening the way in Inkscape, I found only the solution to remove 1 by 1 the nodes


In Inkscape use Path > Simplify (or Ctrl-L). No more than that required.

Re: Path: reduce the number of nodes while keeping the shape

Fri Dec 20, 2019 8:34 am

level_0 wrote:there it is the horror because lots of nodes overlap.

The nodes do not overlap. The control points are just displayed as overly big.


rich2005 wrote:Simplify the path in Inkscape, one keypress ctrl-L, and then save the resultant svg

This is not really advisable.
To get a good reduction of nodes, you have to apply Simplify more than once, but this also results in reduction of resolution.
Meaning the path will loose its shape with each step.

Its even worse when you hit CTRL + L several times in a quick fashion, because that makes Inkscape apply the simplification in a more aggressive way.

http://tavmjong.free.fr/INKSCAPE/MANUAL ... iting.html
(bottom of page)

toosimplify.jpg
toosimplify.jpg (62.34 KiB) Viewed 5140 times

Re: Path: reduce the number of nodes while keeping the shape

Fri Dec 20, 2019 8:46 am

level_0 wrote:GIMP Version: 2.10.14
Operating System: Windows
GIMP Experience: New User



:wvy
I cut a flower and then alpha to selection and edit / selection to path.
Then I want to act on the path, then I appear the nodes and there it is the horror because lots of nodes overlap.
How to have the same path with a minimum of nodes, without being obliged to delete the nodes 1 by 1 with ctrl + shift?
Example:
[ Image ]


Nodes don't overlap, there are just many :) which is expected if you have a complex shape.

You can possibly get a simpler path by blurring slightly (a copy of) the layer before doing "Alpha to selection+Select to path" (in other words, simplify the shape before getting a path from it).

When the shape has sharp corners, "Select>To path" sometimes creates sub-pixel tangents that can be a nuisance when stroking the path. My ofn-remove-tangents script can fix these.

Re: Path: reduce the number of nodes while keeping the shape

Sat Dec 21, 2019 1:30 pm

Thank rich2005
Thank you Konstantin, I put the link in a folder "Inkscape tutorials" in my bookmarks.
Thanks ofnuts, I tried the first method with the blur and it is a little better. I downloaded your plugin "remove" but not yet tested. :)

Re: Path: reduce the number of nodes while keeping the shape

Sat Dec 21, 2019 1:56 pm

level_0 wrote:Thank you Konstantin, I put the link in a folder "Inkscape tutorials" in my bookmarks.

Its not a tutorial, just the Inkscape manual.
Was meant for rich2005, the busiest man in gimp world. :hehe

Re: Path: reduce the number of nodes while keeping the shape

Sat Dec 21, 2019 3:03 pm

@Konstantin
Not that busy, what is the hee-hee for

To get a good reduction of nodes, you have to apply Simplify more than once


I did not say apply more than once, the example I showed used Simplify Path applied once, of course repeated use will destroy anything and that applies to most things.

http://tavmjong.free.fr/INKSCAPE/MANUAL_v15/html/Paths-Editing.html


No need to point me to that, I do know about it. I also know that manual has not changed since Inkscape 0.48 (2010)

Going back to the example I posted, the simplified path is a good fit to the Image in Gimp. It is always up to the user to keep or reject.

I did recommend right at the beginning to get used to tracing a path by hand.

Re: Path: reduce the number of nodes while keeping the shape

Sat Dec 21, 2019 3:42 pm

Yes, tracing by hand is always the best strategy going forward. You can't expect a stupid computer to read your thoughts...........
Post a reply