Back to TILs.

Calmcode TIL

SVG compression logoSVG compression

In the short on tldraw.com we mentioned how delightful it is to use svg's instead of images. It turns out though that if you use lot's of freehand drawing instead of proper svg text, that the size of the svg really can grow bigger than an image.

Lucky for us though, there are online SVG compression tools available for these moments that really can make a huge difference.

Original

This was the original image, which is 163Kb.

Compressed via SVGOMG

This images has been compressed via the free svgomg project. This comes in at 88Kb. That's a nice improvement.

Compressed via Vecta

This image has been compressed via vecta.io/nano. This app has a free manual option but also comes with a paid version. This comes in at an impressive 31Kb.

Conclusion

I don't know about you, but we don't see a difference between these images.

In general, svgs seem to be lighter than images but this isn't always the case. When in doubt, it makes sense to use an svg compressor and there's plenty of free options these days found online.


Back to TILs.