Skip to content

Instantly share code, notes, and snippets.

@guruguruman
Last active December 18, 2015 09:39
Show Gist options
  • Save guruguruman/5763373 to your computer and use it in GitHub Desktop.
Save guruguruman/5763373 to your computer and use it in GitHub Desktop.
Create icons necessary for submitting the app to AppStore.
#!/bin/sh
################################################################################
#
# iTunes Icon Generator v 0.3
#
#
# This script requires ImageMagick.
# See link below for more defailed information:
#
# ImageMagick: Command-line Tools Convert
# http://www.imagemagick.org/script/convert.php
################################################################################
# Prepare the paths.
slash='/'
dirPathPrefix='Icons_'
dirPath=${dirPathPrefix}${1}${slash}
# Prepare the name of each icons.
iconName='Icon'
icon40Name='Icon-40'
icon60Name='Icon-60'
icon72Name='Icon-72'
icon76Name='Icon-76'
iconSmallName='Icon-Small'
iconSmall40Name='Icon-Small-40'
iconSmall50Name='Icon-Small-50'
iTunesArtworkName='iTunesArtwork'
extentionName='.png'
retina2Symbol='@2x'
retina3Symbol='@3x'
retina2ExtentionName=${retina2Symbol}${extentionName}
retina3ExtentionName=${retina3Symbol}${extentionName}
# Create directory for icons.
mkdir -p ${dirPath}
# Converting icons necessary
convert -resize 57x57 ${1} ${dirPath}${iconName}${extentionName}
convert -resize 114x114 ${1} ${dirPath}${iconName}${retina2ExtentionName}
convert -resize 171x171 ${1} ${dirPath}${iconName}${retina3ExtentionName}
convert -resize 40x40 ${1} ${dirPath}${icon40Name}${extentionName}
convert -resize 80x80 ${1} ${dirPath}${icon40Name}${retina2ExtentionName}
convert -resize 120x120 ${1} ${dirPath}${icon40Name}${retina3ExtentionName}
convert -resize 60x60 ${1} ${dirPath}${icon60Name}${extentionName}
convert -resize 120x120 ${1} ${dirPath}${icon60Name}${retina2ExtentionName}
convert -resize 180x180 ${1} ${dirPath}${icon60Name}${retina3ExtentionName}
convert -resize 72x72 ${1} ${dirPath}${icon72Name}${extentionName}
convert -resize 144x144 ${1} ${dirPath}${icon72Name}${retina2ExtentionName}
convert -resize 216x216 ${1} ${dirPath}${icon72Name}${retina3ExtentionName}
convert -resize 76x76 ${1} ${dirPath}${icon76Name}${extentionName}
convert -resize 152x152 ${1} ${dirPath}${icon76Name}${retina2ExtentionName}
convert -resize 228x228 ${1} ${dirPath}${icon76Name}${retina3ExtentionName}
convert -resize 29x29 ${1} ${dirPath}${iconSmallName}${extentionName}
convert -resize 58x58 ${1} ${dirPath}${iconSmallName}${retina2ExtentionName}
convert -resize 87x87 ${1} ${dirPath}${iconSmallName}${retina3ExtentionName}
convert -resize 40x40 ${1} ${dirPath}${iconSmall50Name}${extentionName}
convert -resize 80x80 ${1} ${dirPath}${iconSmall50Name}${retina2ExtentionName}
convert -resize 120x120 ${1} ${dirPath}${iconSmall50Name}${retina3ExtentionName}
convert -resize 50x50 ${1} ${dirPath}${iconSmall50Name}${extentionName}
convert -resize 100x100 ${1} ${dirPath}${iconSmall50Name}${retina2ExtentionName}
convert -resize 150x150 ${1} ${dirPath}${iconSmall50Name}${retina3ExtentionName}
convert -resize 512x512 ${1} -format png ${dirPath}${iTunesArtworkName}
convert -resize 1024x1024 ${1} -format png ${dirPath}${iTunesArtworkName}${retina2Symbol}
@guruguruman
Copy link
Author

アイコンを実機でテストするときとかに、適当にiTunesArtworkから必要なアイコンを作るスクリプト。

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