Skip to content

Instantly share code, notes, and snippets.

@ataias
Last active April 25, 2021 11:12
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 ataias/9454734cdf9a759b203b68ac7cde9ee5 to your computer and use it in GitHub Desktop.
Save ataias/9454734cdf9a759b203b68ac7cde9ee5 to your computer and use it in GitHub Desktop.
Generate png app icons in multiple formats from an SVG image
#!/usr/bin/env bash
# For this to work, you need imagemagick installed,
# which is the tool that provides "convert"
sizes='16 20 29 32 40 60 64 58 76 80 87 120 128 152 167 180 256 512 1024'
file=$1
for size in $sizes
do
convert $file -resize "${size}x${size}" `basename $file .svg`-${size}x${size}.png
done
echo All done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment