News for hackers. Stuff that matters.
Re:Open-source online SVG path editor by jhgb on Friday February 18, 2022 @04:20AM (#30383707)
Smart quantization of SVG paths sounds like a neat problem. Is there no existing tool for it already? Along the lines of pngcrush or similar.

This may be too-stupid-to-work but what immediately comes to my mind is normalizing all coordinates into an [0,1]x[0,1] interval and then finding an optimal N so that the maximum rounding error for quantizing all coordinates to the nearest K/N (where K is a non-negative integer up to N) is minimal (for some definition of "optimal", since you have two criteria now - resulting path string length AND maximum rounding error achieved for a given N). Then all your coordinate components should be integers in the range of [0,N].

Re:Open-source online SVG path editor by pilaf on Friday February 18, 2022 @05:52AM (#30384252)
Re:Open-source online SVG path editor by jhgb on Friday February 18, 2022 @08:43AM (#30385557)
I knew there was something I forgot about; SVGO was probably it. Thanks!
Re:Open-source online SVG path editor by zuzun on Friday February 18, 2022 @06:20AM (#30384402)
The problem is that the designers of small icons already work with pixel-snapping and for complex graphics, dumb quantization will look and compress no worse. If you want to work on path optimization, improve Inkscape's path simplification, because why bother with the alignment of a control point that isn't necessary in the first place!?
Re:Open-source online SVG path editor by jhgb on Friday February 18, 2022 @08:42AM (#30385548)
This algorithm should find that very pixel snapping if it exists. Path simplification seems like a more complicated issue, but also promising of course.