Skip to content

Instantly share code, notes, and snippets.

@afknapping
Last active December 28, 2015 10:29
Show Gist options
  • Save afknapping/7486199 to your computer and use it in GitHub Desktop.
Save afknapping/7486199 to your computer and use it in GitHub Desktop.
Batch convert all SVG files in current directory to PNGs with 512 pixels width. Needs svg2png (install with brew).
#!/bin/sh
# TODO test for svg2png
DIRECTORY=`pwd`
WIDTH=512 # TODO add command line parameter
for svg in $DIRECTORY/*.svg
do
png=$svg".png"
svg2png $svg $png -w $WIDTH
echo $png
done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment