05-16-2021, 09:20 AM
A new plugin. My try on simplifying paths. If Gimp already has a tool for that job, I hope somebody tells me.
The problem is hard, and all I can say is that mostly the plugin works all right though sometimes its decisions seem strange. Anyway, this is the first published version, and we can think the plugin to be still just experimental, so there is room for improvements. To get the plugin, go to
http://kmarkku.arkku.net/Path_modify_fil...aster.html
scroll to the bottom, and click the download button. You get a zip file. Unzip it and place the one file it contains (simplify_path.py) in your user's plug-ins folder. Then (re)start Gimp. To use the plugin: in the Paths tab, right-click the path you want to simplify and follow the links Tools > Modify path > Simplify.
The plugin takes a path and tries to diminish the number of anchors, doing some smoothing but hopefully not too much. An example: On the left you see a path and on the right its anchors:
With default input values the plugin did the following: Below, on the left you see the original path (blue) and the simplified version (red) on top of each other. It may be difficult to see from that picture but there are small differences: many small bends were smoothed out. On the right you see the anchors of the simplified path.
The GUI looks as follows:
I hope the meanings of the inputs are clear enough.
Of the inputs the last one (about selection) may be the most important in practice. It enables the user to restrict the effect to some subset of the anchors. I shall give examples in another post.
The plugin is based on a neat mathematical idea (I think), but unfortunately, when one starts to implement a neat idea, it usually happens that soon one is in the middle of a mess. The plugin is full of my own ad hoc solutions to various problems. Please report if you find it doing something too odd.
The problem is hard, and all I can say is that mostly the plugin works all right though sometimes its decisions seem strange. Anyway, this is the first published version, and we can think the plugin to be still just experimental, so there is room for improvements. To get the plugin, go to
http://kmarkku.arkku.net/Path_modify_fil...aster.html
scroll to the bottom, and click the download button. You get a zip file. Unzip it and place the one file it contains (simplify_path.py) in your user's plug-ins folder. Then (re)start Gimp. To use the plugin: in the Paths tab, right-click the path you want to simplify and follow the links Tools > Modify path > Simplify.
The plugin takes a path and tries to diminish the number of anchors, doing some smoothing but hopefully not too much. An example: On the left you see a path and on the right its anchors:
With default input values the plugin did the following: Below, on the left you see the original path (blue) and the simplified version (red) on top of each other. It may be difficult to see from that picture but there are small differences: many small bends were smoothed out. On the right you see the anchors of the simplified path.
The GUI looks as follows:
I hope the meanings of the inputs are clear enough.
Of the inputs the last one (about selection) may be the most important in practice. It enables the user to restrict the effect to some subset of the anchors. I shall give examples in another post.
The plugin is based on a neat mathematical idea (I think), but unfortunately, when one starts to implement a neat idea, it usually happens that soon one is in the middle of a mess. The plugin is full of my own ad hoc solutions to various problems. Please report if you find it doing something too odd.