Skip to content

Instantly share code, notes, and snippets.

@pulimento
Forked from donnywals/app_icons.sh
Created December 11, 2020 08:45
Show Gist options
  • Select an option

  • Save pulimento/95fae1b8eba20c7b3e0f64d99eb4241f to your computer and use it in GitHub Desktop.

Select an option

Save pulimento/95fae1b8eba20c7b3e0f64d99eb4241f to your computer and use it in GitHub Desktop.
#!/bin/sh
# make sure you have imagemagick installed: brew install imagemagick
# your app_icons.sh file should have the correct permissions: run `chmod 775 app_icons.sh` in your terminal from where you put this file
# put your `my_icon.png` next to this file and run ./app_icons.sh to export your app icons
x=my_icon.png
y=${x%.*}
# delete the export directory so we start clean
rm -r converted/$y
# create a fresh export firectory
mkdir converted/$y
# export all images
convert $x -resize 20x20 converted/$y/$y-20x20@1x.png
convert $x -resize 40x40 converted/$y/$y-20x20@2x.png
convert $x -resize 60x60 converted/$y/$y-20x20@3x.png
convert $x -resize 29x29 converted/$y/$y-29x29@1x.png
convert $x -resize 58x58 converted/$y/$y-29x29@2x.png
convert $x -resize 87x87 converted/$y/$y-29x29@3x.png
convert $x -resize 40x40 converted/$y/$y-40x40@1x.png
convert $x -resize 80x80 converted/$y/$y-40x40@2x.png
convert $x -resize 120x120 converted/$y/$y-40x40@3x.png
convert $x -resize 60x60 converted/$y/$y-60x60@1x.png
convert $x -resize 120x120 converted/$y/$y-60x60@2x.png
convert $x -resize 180x180 converted/$y/$y-60x60@3x.png
convert $x -resize 76x76 converted/$y/$y-76x76@1x.png
convert $x -resize 152x152 converted/$y/$y-76x76@2x.png
convert $x -resize 228x228 converted/$y/$y-76x76@3x.png
convert $x -resize 167x167 converted/$y/$y-83_5x83_5@2x.png
# copy input file as the 1024x1024 icon
cp $x converted/$y/$y-1024x1024@1x.png
@pulimento
Copy link
Author

Falla si no existe la carpeta converted /

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment