Skip to content

Instantly share code, notes, and snippets.

@keuv-grvl
Last active December 8, 2016 16:28
Show Gist options
  • Save keuv-grvl/fdcd44da467640d03f81 to your computer and use it in GitHub Desktop.
Save keuv-grvl/fdcd44da467640d03f81 to your computer and use it in GitHub Desktop.
Convert ./svg/*.svg to ./png/*.png
#!/usr/bin/env bash
command -v inkscape >/dev/null 2>&1 || { echo >&2 "Inkscape is not installed. Aborting."; exit 1; }
# SVG files must be in "./svg/" and PNG files will be outputed in './png/'
echo "starting..."
mkdir -p ./png/
rm ./png/*png
## ./svg/ can contain links to SVG files.
for F in $(find -L ./svg/ -maxdepth 1 -name "*.svg" -type f); do
FF=$(basename $F)
inkscape -z -e ./png/$FF.png -d 300 -b white ./svg/$FF
done;
notify-send -i emblem-photos "Done" "Conversions are finished"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment