Created
January 10, 2022 20:49
-
-
Save 0x00dec0de/5f6e76b194610a579239e4167fe5e472 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
# https://stackoverflow.com/questions/52736877/how-can-i-create-app-icons-for-all-supported-ios-android-sizes | |
echo $1 | |
DIR=$(dirname $1) | |
echo $DIR | |
output="$DIR/$2" | |
echo $output | |
#20x20 | |
convert -resize 20x20! $1 "$DIR/Icon_20.png"; | |
convert -resize 40x40! $1 "$DIR/Icon_20@2x.png"; | |
convert -resize 60x60! $1 "$DIR/Icon_20@3x.png"; | |
#29*29 | |
convert -resize 29x29! $1 "$DIR/Icon_29.png"; | |
convert -resize 58x58! $1 "$DIR/Icon_29@2x.png"; | |
convert -resize 87x87! $1 "$DIR/Icon_29@3x.png"; | |
#40x40 | |
convert -resize 40x40! $1 "$DIR/Icon_40.png"; | |
convert -resize 80x80! $1 "$DIR/Icon_40@2x.png"; | |
convert -resize 120x120! $1 "$DIR/Icon_40@3x.png"; | |
#60x60 | |
convert -resize 60x60! $1 "$DIR/Icon_60.png"; | |
convert -resize 120x120! $1 "$DIR/Icon_60@2x.png"; | |
convert -resize 180x180! $1 "$DIR/Icon_60@3x.png"; | |
#76x76 | |
convert -resize 76x76! $1 "$DIR/Icon_76.png"; | |
convert -resize 152x152! $1 "$DIR/Icon_76@2x.png"; | |
convert -resize 228x228! $1 "$DIR/Icon_76@3x.png"; | |
#167x167 | |
convert -resize 167x167! $1 "$DIR/Icon_167.png"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment