Minify Your SVGs
victorzhou.com
Minify Your SVGs
1–10 of 66 posts
Re: Minify Your SVGs
#2Re: Minify Your SVGs
#3Nice work, svgo is awesome. I'd love to adapt this to a non-gatsby post-build tool that also runs image compression on any jpg/png files.
Big advantage to running post-build besides convenience is that sometimes Inkscape doesn't render optimized svg's correctly. So I have to keep originals elsewhere.
Re: Minify Your SVGs
#4Illustrator has an export SVG function (as opposed to just saving as an SVG, which I was doing and then using a minifer for a long time) that will minify it for you.
That said, it currently appears unable to reopen those minified SVGs (go figure).
Re: Minify Your SVGs
#5Related: https://jakearchibald.github.io/svgomg/
I used this tool just the other day; very comprehensive, and very fantastic.
Re: Minify Your SVGs
#6This is an excellent post!
It does a fantastic job of defining the problem and walking the reader through the process of solving it. The language is so succinct and clear that even if the reader had never heard of SVGs before, they would understand this post.
Well done, Victor!
Re: Minify Your SVGs
#7There's also https://vecta.io/nano, which I've found to sometimes give better results than SVGOMG
Re: Minify Your SVGs
#8Related: https://jakearchibald.github.io/svgomg/
Hardly a day goes by that I don't use svgomg. If you need a one-off SVG minified, this is the tool for you.
Re: Minify Your SVGs
#9Pro tip for people with SVGs that have an image inside. You can pull that base64 image out of the svg, convert to image, compress it (tinypng, pngcrush etc) then convert back to base64 and out back in the SVG. We automated this with a slackbot but it’s often overlooked with all SVG optimization scripts.
Re: Minify Your SVGs
#10Don’t forget to also use GZip or another transport compression on them as well. Text tends to compress well, and can net additional benefits on top of minification.