How to automate svg precision tuning across your entire icon library
- Step 1Configure precision in SVGO — In svgo.config.js, add: plugins: [{ name: 'convertPathData', params: { floatPrecision: 1 } }]. Run npx svgo --recursive --folder ./icons to apply to all files.
- Step 2Or use the JAD batch API — POST a multipart form with up to 50 SVG files to /api/svg/optimize-paths, passing precision=1 as a query parameter. The response is a ZIP of tuned files.
- Step 3Verify output with a diff — Run git diff on the processed files to confirm only coordinate values changed. Visual regression testing (Chromatic, Percy) can automate this for large icon sets.
Frequently asked questions
Can I set different precision levels for different icon types?+
Yes. Run the tuner twice: once on your geometric icons folder with precision=0, and once on your illustration folder with precision=2. Use glob patterns to target specific subdirectories.
Does SVGO's convertPathData plugin do the same thing?+
Yes. The JAD Precision Tuner uses the same SVGO convertPathData plugin under the hood with the floatPrecision parameter. The tool provides a no-config UI version of the same operation.
How do I integrate this into a Vite build?+
Use the vite-plugin-svgo package, which applies SVGO (with your config, including floatPrecision) to all SVG imports at build time. Zero runtime overhead.
Will the API preserve SVG IDs and class names?+
Yes. The precision tuning API only modifies numeric coordinate values. All IDs, class names, ARIA attributes, and other attributes are untouched.
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.