2 ms·
I went ahead and used it yesterday to change the background image of my site to save a couple (426kb) of bytes on page load. While you recommend using smaller i
by Adamantcheese 9y ago
I went ahead and used it yesterday to change the background image of my site to save a couple (426kb) of bytes on page load. While you recommend using smaller image sizes, it still worked well on a 1920 x 1080 image and only took ~10 minutes to run in the background with n = 2500.
I did add an additional step (as lots of extra triangles are generated with a large n like this), which is to put it through SVGOMG[1] to optimize out some of those extra bits.
That cut the generated SVG image size about in half, which I think is an excellent amount of bytes saved for relatively little effort. You can see the result on my site linked in my profile, or compare the PNG and SVG files from the source on my GitHub in this commit[2].
[1]https://jakearchibald.github.io/svgomg/ https://jakearchibald.github.io/svgomg/
[2]https://github.com/Adamantcheese/adamantcheese.github.io/commit/2c524895b47491e7fc8191df1bf98e3bf622f9de https://github.com/Adamantcheese/adamantcheese.github.io/com...
- contingencies 9y agoI suppose someone would write one eventually, but I don't really see the motivation to build or use libraries like SVGO for most use cases. If you GZIP compress an SVG to SVGZ then you are going to save way more bytes, and if you have a half-decent webserver and a browser this side of 1999 it should do that automatically - https://en.wikipedia.org/wiki/HTTP_compression#Compression_scheme_negotiation https://en.wikipedia.org/wiki/HTTP_compression#Compression_s...