[View source on GitHub](https://github.com/microlinkhq/optimo)

To optimize SVG images, run `npx optimo icon.svg`. Optimo applies format-specific ImageMagick-powered compression that typically reduces SVG file size by 15–40% without visible quality loss. The original file is kept if the output is not smaller.

## Command

Start here. Run optimo on an image file:

```
npx optimo icon.svg
```

Tip: add `--dry-run` to preview changes.

## When to use SVG

- icons
- logos
- illustrations
- UI

### Trade-offs

- Not for photos
- Can contain complex/unsafe constructs if untrusted

## Related formats

[PNG\ Lossless image format with sharp edges and great support for transparency.](/content/optimize/png/index.html) 
[JPEG\ The classic photo format: widely supported, good quality-to-size for photographs.](/content/optimize/jpeg/index.html) 
[WebP\ Modern image format with great compression and broad browser support.](/content/optimize/webp/index.html) 
[AVIF\ High-compression modern image format that can beat WebP on size at similar quality.](/content/optimize/avif/index.html) 
[HEIC\ A common camera output format (especially Apple devices) with efficient compression.](/content/optimize/heic/index.html) 
[JPEG XL\ Next-gen image format designed for high quality and efficient compression.](/content/optimize/jxl/index.html) 
[GIF\ Legacy animated image format that is still widely used for simple loops.](/content/optimize/gif/index.html)

## Related conversions

[Convert SVG to PNG](/content/convert/svg-to-png/index.html) 
[Convert SVG to WebP](/content/convert/svg-to-webp/index.html) 
[Convert SVG to JPEG](/content/convert/svg-to-jpeg/index.html) 
[Convert SVG to AVIF](/content/convert/svg-to-avif/index.html) 
[Convert SVG to GIF](/content/convert/svg-to-gif/index.html)

## More for SVG

[Compress SVG](/content/compress/svg/index.html) 
[Resize SVG](/content/resize/svg/index.html) 
[What is SVG?](/content/formats/svg/index.html)

## Compare formats

If you're picking a delivery format, comparisons can help.

[SVG vs PNG](/content/compare/svg-vs-png/index.html)

## Frequently asked questions

**How do I optimize SVG files?** Run "npx optimo icon.svg" in your terminal. Optimo applies format-specific ImageMagick-powered compression that reduces SVG file size while preserving quality. The original file is kept if the optimized output is not smaller.

**Is SVG optimization lossless?** By default, optimo uses lossless optimization for SVG. For additional compression, add the --lossy flag to allow minor quality trade-offs for significantly smaller files.

**What tools does optimo use for SVG?** Optimo uses ImageMagick, MozJPEG, and SVGO (depending on format) under the hood with format-specific settings tuned for SVG files.
