| name | svgo |
| description | Use this skill when the user wants to optimize SVG files, reduce SVG file size, clean up SVG code, or process SVG images. |
svgo Plugin
Node.js tool for optimizing SVG files. Remove redundant information, optimize paths, and reduce file size.
Commands
SVG Optimization
svgo optimize svg — Optimize SVG files
Utility
svgo _ _ — Passthrough to svgo CLI
Usage Examples
- "Optimize this SVG"
- "Reduce SVG file size"
- "Clean up SVG code"
- "Optimize all SVGs in a folder"
Installation
npm install -g svgo
Or via yarn:
yarn global add svgo
Or via pnpm:
pnpm add -g svgo
Examples
svgo optimize svg input.svg -o output.svg
svgo optimize svg input.svg
svgo optimize svg -rf path/to/svgs -o path/to/output
svgo optimize svg input.svg -p 2
svgo optimize svg input.svg --multipass
svgo optimize svg input.svg --config svgo.config.mjs
svgo optimize svg one.svg two.svg -o one.min.svg two.min.svg
svgo _ _ input.svg --precision 3
svgo _ _ -rf ./svgs -o ./optimized
Key Features
- Size reduction - Remove redundant metadata and comments
- Path optimization - Simplify and optimize SVG paths
- Precision control - Adjust numeric precision
- Plugin architecture - Extensible with custom plugins
- Recursive processing - Process entire directories
- Config support - JSON/MJS configuration files
- Multipass mode - Multiple optimization passes
- Batch processing - Handle multiple files at once
Notes
- Default precision is 3 decimal places
- Preserves rendering while reducing size
- Can remove editor metadata and hidden elements
- Supports custom plugin configurations
- Great for web optimization
- Safe for production use