Minify Your SVGs
21–30 of 66 posts
Re: Minify Your SVGs
#22We provide hosted service for optimising SVG. If anyone is interested for image optimisation as a service, take a look here: https://www.gumlet.com
https://www.gumlet.com/how-it-works
I think you mean "images" not "imags"
edit:
Also the link to the docs doesn't work.
Re: Minify Your SVGs
#23Related: https://jakearchibald.github.io/svgomg/
I use it every time I'm using SVG for the web. My only problem is that when pasting SVG directly from Illustrator it finds an invalid character at the end and refuses to use it. I have to paste the SVG into an editor, remove some invisible character at the end, and then paste to svgomg. I reported this and offered to PR but never got an answer: https://github.com/jakearchibald/svgomg/issues/145
1. Just fork it and use your own version until the PR is accepted
2. Directly email the maintainer if you think your PR is worthwhile
3. If you have a bunch of PR's that are pretty useful to others, consider making it a real distributable (and not just a personal) fork if the maintainer still doesn't respond
Re: Minify Your SVGs
#24Don't SVGs have to have an XML declaration? I think that magic will fail to identify the content type of an SVG if it's not a valid XML file.
Re: Minify Your SVGs
#25The TXR logo SVG is cleaned with a TXR script:
http://www.kylheku.com/cgit/txr/tree/win/cleansvg.txr
The original looks like this:
http://www.kylheku.com/cgit/txr/tree/win/txr.svg
The cleaned one is not in the repo. It's obtained by "txr cleansvg.txr txr.svg":
Re: Minify Your SVGs
#26Don’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.
The reality is that while text compresses well, gzip doesn't know what data is relevant. It keeps it all. So for this example, the original long svg contains things like inkscape configuration (the window height, the current layer name, etc.) while the shorter one omits all that. So not emitting that information will always be more efficient than emitting that information and compressing it.
Re: Minify Your SVGs
#27Re: Minify Your SVGs
#28Don’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.
I ran the examples in the article through gzip. The long one is 789 bytes compressed, and the short one is 266 bytes compressed. The reality is that while text compresses well, gzip doesn't know what data is relevant. It keeps it all. So for this example, the original long svg contains things like inkscape configuration (the window height, the current layer name, etc.) while the shorter one omits all that. So not emi…
Re: Minify Your SVGs
#29Don’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.
I ran the examples in the article through gzip. The long one is 789 bytes compressed, and the short one is 266 bytes compressed. The reality is that while text compresses well, gzip doesn't know what data is relevant. It keeps it all. So for this example, the original long svg contains things like inkscape configuration (the window height, the current layer name, etc.) while the shorter one omits all that. So not emi…