A shell script to batch convert SVG images to PNG using the Inksacpe command line.
- Given a folder containing SVG files, each image is converted to a PNG.
- Original folder structure is maintained.
- Supports specification of the output image resolution
- Inkscape nust be installed and availble in the
$PATH
(check withinkscape --version
). - Download the script and change modify the permission, so that the file is executable
chmod +x svg2png_batch.sh
.
# convert the SVG files located in the <inout_folder> to PNG images
#!/bin/bash
./svg2png_batch.sh <input_folder> <output_folder> <resolution>
<input_folder> -- Folder where the SVG files are located
<output_folder> -- Folder where the outputs will be written
<resolution> -- Output image resolution