Dev.to WebDev 🛠 Dev 👁 0 📖 2 min read

I ran SVGO on a traced logo at four precisions. Here is where it breaks.

Every answer to "how do I make my SVG smaller" says the same thing: run SVGO, lower the precision. Nobody shows the numbers, or says when the precision is too low. So I measured it on a real file. The file: a trace of a

I ran SVGO on a traced logo at four precisions. Here is where it breaks.

Every answer to "how do I make my SVG smaller" says the same thing: run SVGO, lower the precision. Nobody shows the numbers, or says when the precision is too low. So I measured it on a real file.

The file: a trace of a 716-byte eagle logo, made with VTracer using SVG Lab's Auto-trace settings. The trace came back at 5,647 bytes.

The same traced logo at four sizes: 5,647, 2,721, 1,866 and 996 bytes, looking the same

The command

npx svgo logo.svg -o logo.min.svg --multipass -p 2

-p is the precision: how many decimals SVGO keeps. I ran SVGO 4.0.0 with the default preset at 3, 2, 1 and 0.

Version Bytes Gzipped
As traced 5,647 2,531
Precision 3 3,703 1,749
Precision 2 2,721 1,375
Precision 1 1,866 960
Precision 0 996 551

What it removed

The first shape before and after SVGO

The XML header, a generator comment, a version tag, a transform written as 253.75001525878906, and a command letter repeated before every curve. None of it shows on screen.

Where precision breaks

Precision counts decimals in the drawing's own units. On a 512-unit logo shown at 512 pixels, one decimal is a tenth of a pixel. On a 24-unit icon the same decimal is far coarser, so do not copy one setting across files.

I rendered each version at 2x and counted pixels that differ from the trace: 311 at precision 1, 4,078 at precision 0. Zoomed in, precision 0 closes up the thin feather tips.

6x zoom of the feather tips: precision 0 narrows the gap

My rule: start at 2, drop to 1 if it still looks right at 400 percent, use 0 only for shapes on whole numbers.

Gzip is a second, separate win

Gzip shrinks the download, not the file: 5,647 bytes travel as 2,531. Optimize first, then check the response has Content-Encoding: gzip or br in the network tab.

Raw and gzipped bytes for each version

The limit of optimizing

The best SVGO result, 996 bytes, is still bigger than the 716-byte hand-made original, and already damaged. Optimizing cleans a trace up; it does not turn it back into a drawing. If the tracer has a detail setting, lower it first (SVG Lab's Auto-trace shows the path count and KB in its preview). If you need a new icon, draw it as vector shapes from the start: the SVG Lab MCP lets the AI you already use draw icons and illustrations through SVG Lab's Design Engine.

SVG Lab itself has no optimizer today, so for the file, use SVGO or SVGOMG (svgomg.net).

Full write-up with the FAQ: https://svglab.app/blog/how-to-make-an-svg-file-smaller

📰 Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.