Skip to content

Instantly share code, notes, and snippets.

@sugumura
Created May 16, 2017 05:42
Show Gist options
  • Save sugumura/03a783064858c7b89ae3324f642c0454 to your computer and use it in GitHub Desktop.
Save sugumura/03a783064858c7b89ae3324f642c0454 to your computer and use it in GitHub Desktop.
Mac OS X用のアイコンファイル(.icns)を生成するスクリプトです。[email protected](解像度が1024x1024)のファイルを実行フォルダに設置して実行してください。
#!/bin/sh
# for Mac OS X
# required sips command
cd `dirname $0`
outdir="icon.iconset"
mkdir -p $outdir
if [ -e "[email protected]" ]; then
BASE_FILE="[email protected]"
else
echo "Not Found file [email protected]..."
exit 1
fi
sips -Z 1024 ${BASE_FILE} --out ${outdir}/[email protected]
sips -Z 512 ${BASE_FILE} --out ${outdir}/icon_512x512.png
sips -Z 512 ${BASE_FILE} --out ${outdir}/[email protected]
sips -Z 256 ${BASE_FILE} --out ${outdir}/icon_256x256.png
sips -Z 256 ${BASE_FILE} --out ${outdir}/[email protected]
sips -Z 128 ${BASE_FILE} --out ${outdir}/icon_128x128.png
sips -Z 64 ${BASE_FILE} --out ${outdir}/[email protected]
sips -Z 32 ${BASE_FILE} --out ${outdir}/icon_32x32.png
sips -Z 32 ${BASE_FILE} --out ${outdir}/[email protected]
sips -Z 16 ${BASE_FILE} --out ${outdir}/icon_16x16.png
iconutil -c icns ${outdir}
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment