Skip to content

Comment on Ask HN: Is SVG Dying?parent

Comments

Such format isn't really necessary, because http has protocol level compression that can get rid of text-based format inefficiencies. And in case you need it precompressed there is a compressed svg format - svgz.

I agree that svg is not dying, it's still growing.

Gzip isn't going to compress as well as a binary format would. SVG is XML and while it has text components that can be compressed, it will reach limits. Plus, if you compress the binary, it could be reduced even further.

Using a byte encoding for element types and numeric values over strings would likely dramatically reduce sizes. For example:

<z:rect x="0" y="0" width="10" height="10"/>

Could be binary encoded as something like:

00 00000000 00000000 00000110 00000110

(shape, x, y, width, height)

Total size of compress XML is probably 30-40 bytes. Final binary size is 16-18 bytes.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.