Last active
April 25, 2021 11:12
-
-
Save ataias/9454734cdf9a759b203b68ac7cde9ee5 to your computer and use it in GitHub Desktop.
Generate png app icons in multiple formats from an SVG image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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