Unfortunately the reference to the actual minifier, SVGO ( https://github.com/svg/svgo ), is buried in the middle of the post. SVGO is an incredible project driven by a single volunteer in spare time (originally Kir Belevich https://twitter.com/deepsweet , and for the last few years Lev Solntsev https://twitter.com/ruGreLI ). It's the type of project you probably use regularly behind another tool like Sketch or SVGOM…
Minify Your SVGs
41–50 of 66 posts
Re: Minify Your SVGs
#42Why? Why minify everything? It all gets gzipped at the HTTP layer anyway! I truly cannot understand this need to minify everything (JS included)
Re: Minify Your SVGs
#43Nevertheless the kind of minification demonstrated in the example (removing Inkscape bloat) feels really great and actually makes the file more human-readable. This reminds me of HTML files generated by MS Word and other WYSIWG editors which included tons of bloat code that actually harmed rendering (needless to say human readability).
Re: Minify Your SVGs
#44I make it a habit of running images through ImageOptim before sending them via Messages or Slack, as a courtesy for people on slow connections.
https://imageoptim.com (by HN user pornel)
Bonus round: When it comes to optimizing SVGs, nothing beats hand-editing the SVG source. I've done a fair bit of that optimizing the artwork for https://www.lunchboxsessions.com and it's been totally worth the effort. Taking a detailed 10k SVG down to 500 bytes with no perceptual difference is a huge win when you have hundreds of those SVGs on the page and you serve people who still use dialup.
Re: Minify Your SVGs
#45I absolutely love ImageOptim for manually optimizing SVGs, JPGs, PNGs, and GIFs. It's a simple GUI that wraps some excellent compression libs (including SVGO), which I find much faster to use for one-off image optimization than the CLI. It does a clever job of trying multiple compressors and picking whichever one creates the smallest file for each image. You can run it in a lossless or lossy mode, and tune various co…
Re: Minify Your SVGs
#46Why? Why minify everything? It all gets gzipped at the HTTP layer anyway! I truly cannot understand this need to minify everything (JS included)
The short answer is that 99% of the time no purpose is being served by that cruft except to be bloat. Minifiers remove that cruft and optimize for the intended audience, which is machines.
The longer answer is that in optimizing for machines, you're also optimizing for humans in the long run. Anyone stuck with a 2G connection, dial-up, or Bluetooth tethered device, or a new ultra low powered device on a different CPU architecture, will appreciate not having to operate solely in the world of gigabit+ connections, 8GB mobile devices, or 8 core hyperfast CPUs. Realize that such use cases still exist, and for very legitimate, not truly edge cases.
Think of pages with hundreds or thousands of vector images. Not everyone can afford to run a Blink-powered browser or have CPU cycles for days. Every little bit helps.
Edit to fix typo and add further clarity.
Re: Minify Your SVGs
#47Why? Why minify everything? It all gets gzipped at the HTTP layer anyway! I truly cannot understand this need to minify everything (JS included)
If your SVG files are < ~1kb, it's usually faster to just not gzip them. If they're < ~150b, gzipping will probably make both slower _and_ bigger.
Re: Minify Your SVGs
#48Re: Minify Your SVGs
#49Re: Minify Your SVGs
#50I absolutely love ImageOptim for manually optimizing SVGs, JPGs, PNGs, and GIFs. It's a simple GUI that wraps some excellent compression libs (including SVGO), which I find much faster to use for one-off image optimization than the CLI. It does a clever job of trying multiple compressors and picking whichever one creates the smallest file for each image. You can run it in a lossless or lossy mode, and tune various co…