Last week I wrote about converting MOV files to MP4. This week I had to bulk convert some SVG files to PNG. Of course, doing this manually takes way too much time so I looked for other ways to accomplish this.
SVGExport
There’s this neat NPM package called SVGExport that we can use for this task;npm install svgexport -g
Once we got that installed, we can execute this command in the directory where the SVG’s live;for i in *.svg; do svgexport "$i" "${i%.*}.png" 12x; done
The ’12x’ defines the resolution of the PNG. You can test it first by running svgexport logo.svg logo.png 12x
to see which resolution suits you best.
Happy coding!
– Marinus
Leave a Reply