How to automate svg path simplification across large icon libraries
- Step 1Call the batch simplification endpoint — POST up to 50 SVGs to /api/svg/optimize-paths with tolerance=1.0. The API returns a ZIP with simplified files and a JSON report showing node count before/after for each file.
- Step 2Integrate into your build pipeline — Add a npm script: 'simplify': 'node scripts/simplify-icons.js ./src/icons --tolerance=1.0'. Run this after new icons are added from the design team.
- Step 3Validate with visual regression — After batch simplification, run your visual regression suite. Any icons where simplification caused visible distortion will appear as diffs. Increase their tolerance individually.
Frequently asked questions
Can I set different tolerances for different icon categories?+
Yes. Run the API separately for each category: geometric icons at tolerance=0.5, auto-traced illustrations at tolerance=1.5. Use separate directory paths to target each.
Does path simplification interact badly with CSS transitions?+
CSS transitions on SVG fill and stroke properties are fine. CSS transitions on the d attribute (path morphing) may show angular interpolation if tolerance is too high. Test morphing icons at tolerance=0.5.
How do I batch-process SVGs from npm?+
Install svgo and configure a custom plugin for RDP simplification, or use the JAD API. For a self-hosted Node.js pipeline, the simplify-js npm package provides the RDP implementation directly.
What is the API rate limit for batch simplification?+
Pro plan: 100 API calls per hour, up to 50 files per call (5,000 files/hour). Developer plan: 500 calls per hour with no file count limit per call.
Privacy first
Every JAD SVG tool runs entirely in your browser using the DOM API and Canvas. Your SVG files never leave your device — verified by zero outbound network requests during processing.