It would be very useful to be able to simplify line vectors, meaning weed out redundant points (a.k.a nodes, anchor points, vertices).
On the right is a line created using bezier curves. It only has 8 nodes and is easy to edit and tweak. On the left is the same shape after using a subtractlogical operation with another line. Now there are so many nodes it’s essentially uneditable.
Much to my surprise and delight, copy a selected vector shape in Krita and pasting it into Inkscape works! No need to shuttle through the file system first. That’s a great unexpected bonus. Unfortunately coming back the other way doesn’t work, at least not well enough for this scenario. Krita does accept the paste, and the object is shape instead of a paint object, but the nodes aren’t accessible and fill/stroke can’t be changed.
So this a viable path for my current project because the end result is svg anyway so I’m happy to simplify/weed lines in Inkscape and finish things off, but it’s a one way trip.
I thought about this too but couldn’t even figure out if this is doable. You can not simply delete some nodes automatically because the nodes in right example would have different properties than the exact same nodes on the left.
You need to find a curve that goes through exactly the same points as the other one. I’m not an expert on bezier curves maybe it’s even easier than I think. It’s been a while since I did this kind of math.
I’m not sure but I think it’s exactly what one of our GSOC students is planning to fix/implement better this summer? Tomorrow there will be an announcement so there will be something to link.
For inspiration on weeding redundant points without losing the essential object shapes have a look at https://mapshaper.org/. Here’s some map line work you can throw at it. No need to unzip, just drag and drop into the web page.
Disclaimer: I’m only a happy user and don’t know anything about implementing the algorithms. However they are used all over the geospatial software world so I imagine (hopefully) you could find a library in your preferred tongue. Line simplification algorithms – Martin Fleischmann is a nice explanation about a python implementation.
@mhw Hi! I’m working on solving this issue this summer. The problem actually lies with the way Qt handles intersection of curves. It is very much doable, and I do have a plan to get it done with less intersection points and no loss in data. I guess it’ll be mostly done by the end of July, although it’d need testing after that. I’ll notify about my progress over here, and tell you all when it is ready for testing!
Anyone knows how this is going?
I’m finding Krita much better at many things, but I cannot figure out why the shape becomes soooo different after having been merged with other shapes.
I dont want/know how to use a second program to simplify the paths before exporting to svg?
mapshaper the application introduced by mhw is for converting shipshape files.
The shp format often used for Geographic Information System(GIS),not used Graphic design…
Currently,The Krita’s GSOC 2021 article page is moved to here
I would also like to know what happened after that about the project.
By the way,I’m in trouble too similar issue,
Make selection (freeform) and apply
“Select > Convert to shape…”
Then,generate enormous points as not editable by manually…
So need simplify feature.
I have uploaded a screenshot to make these issue more clear.
My previous post was just an draw image of the ideal functionality I wanted.
Even if I waited, things wouldn’t progress at all, so I decided to try it myself.
Recently,I investigated some libraries possibility usuful for simplify vector path.
It can try simplify-js online Demo https://mourner.github.io/simplify-js/
And I also found the python port of script Simplify.py(Unlicense licensed)
It can download from a following URL(Note:Sadly,it archived in 2019)
As a demonstration experiment…,I successd to make this work on Krita.
I need to clean up the part of the code that works with Krita.
I uploaded the screencast here
What I found out,the simplified path consists of straight lines.
It did not produce a smooth curve like a Bezier curve.
But I thought that simplify-js’s algorithm seems to be useful.