Created
August 19, 2018 10:41
-
-
Save dennisstritzke/7deff72da8dfb99d2ba3baa66d4980fc to your computer and use it in GitHub Desktop.
Scale a PNG to required sizes for iOS AppIcons using ImageMagick.
This file contains hidden or 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/local/bin/bash | |
TARGETS=(ipad-notif-1 ipad-notif-2 ipad-settings-1 ipad-settings-2 ipad-spotlight-1 ipad-spotlight-2 ipad-app-1 \ | |
ipad-app-2 ipad-pro-app-2 itunes) | |
declare -A NAME=( | |
[ipad-notif-1]="iPad Notifications 1x" | |
[ipad-notif-2]="iPad Notifications 2x" | |
[ipad-settings-1]="iPad Settings 1x" | |
[ipad-settings-2]="iPad Settings 1x" | |
[ipad-spotlight-1]="iPad Spotlight 1x" | |
[ipad-spotlight-2]="iPad Spotlight 2x" | |
[ipad-app-1]="iPad App 1x" | |
[ipad-app-2]="iPad App 2x" | |
[ipad-pro-app-2]="iPad Pro App 2x" | |
[itunes]="iTunes / AppStore" | |
) | |
declare -A SIZE=( | |
[ipad-notif-1]=20 | |
[ipad-notif-2]=40 | |
[ipad-settings-1]=29 | |
[ipad-settings-2]=58 | |
[ipad-spotlight-1]=40 | |
[ipad-spotlight-2]=80 | |
[ipad-app-1]=76 | |
[ipad-app-2]=152 | |
[ipad-pro-app-2]=167 | |
[itunes]=1024 | |
) | |
mkdir -p Icons | |
for target in "${TARGETS[@]}"; do | |
echo "Resizing to ${SIZE[$target]}x${SIZE[$target]} for ${NAME[$target]}" | |
magick convert $1 -resize ${SIZE[$target]}x${SIZE[$target]} Icons/Icon_${SIZE[$target]}.png | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment