Skip to content

Instantly share code, notes, and snippets.

@raoulwegat
Created February 16, 2017 19:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raoulwegat/ff9ab3c2e348d3f3fc42e6c425662a2a to your computer and use it in GitHub Desktop.
Save raoulwegat/ff9ab3c2e348d3f3fc42e6c425662a2a to your computer and use it in GitHub Desktop.
Convert SVG to PNG
#!/bin/bash
# Batch convert SVG to PNG. Useful for creating new sizes of twemoji.
# Uses https://wiki.gnome.org/Projects/LibRsvg. On macOS install with 'brew install librsvg'
for file in svg/*.svg
do
filename="$(basename $file)"
name=$(echo $filename | cut -f 1 -d '.')
echo "Converting $file to $name.png"
rsvg-convert -h 36 -w 36 $file > 36x36/$name.png
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment