User Guide¶
{: .no_toc }
Complete guide to using Vexy SVGO for end users
Table of contents¶
{: .no_toc .text-delta }
- TOC
Welcome to Vexy SVGO¶
Vexy SVGO is a high-performance, native Rust port of the popular SVG optimizer SVGO. This guide will help you get started with optimizing your SVG files using our fast, reliable, and feature-complete optimizer.
What Makes Vexy SVGO Special¶
- 🚀 12x Faster: Native Rust performance beats Node.js implementations
- 🔄 Drop-in Compatible: Full SVGO API compatibility
- 🌐 Runs Everywhere: CLI, library, and WebAssembly support
- 🛡️ Production Ready: 353/353 tests passing, battle-tested
Quick Start¶
1. Try the Interactive Demo¶
The fastest way to experience Vexy SVGO is through our browser-based demo:
2. Install Locally¶
Choose your preferred installation method:
Pre-built Binaries (Recommended)¶
# macOS (Universal)
curl -sSL https://github.com/vexyart/vexy-svgo/releases/latest/download/vexy-svgo-macos.tar.gz | tar -xz
# Windows
curl -sSL https://github.com/vexyart/vexy-svgo/releases/latest/download/vexy-svgo-windows.zip -o vexy-svgo.zip && unzip vexy-svgo.zip
# Linux
curl -sSL https://github.com/vexyart/vexy-svgo/releases/latest/download/vexy-svgo-linux.tar.gz | tar -xz
From Source¶
git clone https://github.com/vexyart/vexy-svgo
cd vexy-svgo
cargo build --release
# Binary will be at ./target/release/vexy-svgo
3. Basic Usage¶
# Optimize a single file
vexy-svgo input.svg -o output.svg
# Process multiple files
vexy-svgo *.svg
# Use with pipes
cat input.svg | vexy-svgo > output.svg
# Process entire directories
vexy-svgo -f ./icons/ -r
User Guide Sections¶
📦 Installation
Complete installation guide for all platforms
Read more →💻 CLI Usage
Master the command-line interface
Read more →⚙️ Configuration
Configure plugins and optimization settings
Read more →🧩 Plugins
Complete plugin reference and usage
Read more →Common Tasks¶
Optimize for Web¶
# Standard web optimization
vexy-svgo input.svg -o output.svg --pretty
# Remove unnecessary precision
vexy-svgo input.svg -o output.svg -p 2
# Maximum compression
vexy-svgo input.svg -o output.svg --multipass
Batch Processing¶
# Process all SVGs in a directory
vexy-svgo -f ./assets/icons/ -r
# With specific plugins
vexy-svgo -f ./icons/ --disable removeViewBox --enable cleanupIds
# Custom output directory
vexy-svgo -f ./src/icons/ -o ./dist/icons/ -r
Integration Examples¶
# Build pipeline
npm run build && find dist -name "*.svg" -exec vexy-svgo {} \;
# Git pre-commit hook
git diff --cached --name-only --diff-filter=A | grep '\.svg$' | xargs vexy-svgo
# Watch mode (with external tool)
watchman-make -p '**/*.svg' -t optimize-svgs
Performance Tips¶
1. Use Native Binary¶
The native binary is always fastest. Avoid wrappers when possible.
2. Batch Processing¶
Process multiple files at once rather than one-by-one:
# ✅ Fast - batch processing
vexy-svgo *.svg
# ❌ Slow - individual processing
for file in *.svg; do vexy-svgo "$file"; done
3. Optimize Plugin Selection¶
Disable unnecessary plugins for faster processing:
# For build pipelines, focus on size reduction
vexy-svgo input.svg --disable removeTitle --disable removeDesc
# For icon sprites, keep structure
vexy-svgo input.svg --disable removeViewBox --disable removeDimensions
Migration from SVGO¶
Vexy SVGO is designed as a drop-in replacement for SVGO. Most existing workflows will work unchanged:
# Replace this
npx svgo input.svg -o output.svg
# With this
vexy-svgo input.svg -o output.svg
Key Differences¶
Feature | SVGO | Vexy SVGO |
---|---|---|
Performance | Baseline | 12x faster |
Installation | npm install | Single binary |
Config Files | .svgo.config.js | .svgo.config.json |
Plugin API | JavaScript | Rust (for custom plugins) |
Configuration Migration¶
Most SVGO configurations work directly:
# Your existing config works
vexy-svgo --config .svgo.config.js input.svg
Getting Help¶
- 📖 Documentation: Continue reading this guide
- 🎮 Demo: Try our interactive demo
- 🐛 Issues: Report problems on GitHub
- 💬 Discussions: Join GitHub Discussions
Ready to get started? Continue to Installation →