Skip to content
Documentation

Optimizations

SVGM runs 24 optimization passes in a fixed-point loop until the document stabilizes. The balanced preset (default) enables all 24. The safe preset runs only removal, normalization, and output passes (17 total). The aggressive preset enables all 24 with lower numeric precision. Passes are grouped into five categories and execute in the order listed below.

Removal

10 passes

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

Normalization

4 passes

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

Structure

3 passes

Simplifies the tree: inlines styles, collapses unnecessary groups, and cleans up IDs.

Geometry

4 passes

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

Output

3 passes

Final minification: sorts attributes for compression and strips formatting whitespace.

Opt-in passes

One pass exists but is not included in the default set: