Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use SVGO to compress paths #183

Open
spatialillusions opened this issue Apr 11, 2018 · 2 comments
Open

Use SVGO to compress paths #183

spatialillusions opened this issue Apr 11, 2018 · 2 comments

Comments

@spatialillusions
Copy link
Owner

Might be interesting to see if it would be possible to use SVGO https://github.com/svg/svgo to compress paths even more. Or at least in a more controlled way than I have been doing it.

@dehmer
Copy link

dehmer commented Nov 15, 2024

@spatialillusions I just played with svgo to optimize a set of 28 selected symbols with varying complexity.
With default svgo options, the reduction in (file) size lies between 14% and 48% with an average of 30%.
That's way more than I expected. Downside is that symbol creation time roughly doubles.
It would be interesting to know how the optimization affects rendering performance.

If you're curious you might want to look at the test in an experimental branch of our library: https://github.com/syncpoint/signs/tree/svgo/test

Screenshot 2024-11-15 at 10 52 03

@spatialillusions
Copy link
Owner Author

The generated symbols might not be the most efficient SVGs because of how the symbols are generated, and that all paths are specified with a limited function set to be able to output them both to SVG and Canvas. So looking at optimizing them at the end of the code might just be a waste of time.

However, if things are found in assvg.js or in any of the symbolfunctions that might optimize the output that would be really good.

My idea was to use SVGO to go over all defined paths in iconparts and see if they can be optimized to reduce the size of the library. So if anyone can automate that, or do tie manually and submit a pull, it would be much appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants