In this short article we want to show how to reduce
*.svg file size using
svgo command (SVG Optimizer) in Bash or Windows Command Prompt. Motivation to optimize svg files is web development where we need to provide small file sizes to speed up page loading.
Quick solution (use following command):
logo.svg: Done in 60 ms! 6.365 KiB - 25% = 4.771 KiB
25%indicates how much file size was reduced,
6.365 KiBis file size before optimization,
4.771 KiBis file size after optimization.
Note: by default
svgooverwrites exiting file with optimal version.
svgo instalation example
svgo it is necessary to do few steps:
- be sure that NodeJS is installed (instalation instruction for Windows is avaialble here),
svgowith following command:
npm install -g svgo
- now we can use
svgocommand (go back to Quick solution).