Skip to content
Documentation

Optimizations

SVGM runs 34 optimization passes in a fixed-point loop until the document stabilizes. The default preset enables all 34. The safe preset excludes structure and geometry passes. Passes are grouped into five categories and execute in the order listed below.

Removal

16 passes

Strips dead weight: metadata, editor artifacts, empty elements, deprecated attributes, and provably invisible content.

Normalization

4 passes

Tightens values: collapses whitespace, rounds numbers, shortens colors, and removes spec defaults.

Structure

5 passes

Simplifies the tree: inlines styles, collapses unnecessary groups, cleans up IDs, and redistributes attributes between groups and children.

Geometry

5 passes

Compresses path and shape data: converts shapes, simplifies transforms, optimizes path commands, and merges adjacent paths.

Output

4 passes

Final minification: sorts attributes and defs for compression, minifies styles, and strips formatting whitespace.