Skip to content

Instantly share code, notes, and snippets.

@ruthenium
Forked from dgraham/make-icns
Created February 2, 2016 01:39
Show Gist options
  • Save ruthenium/5da70464ee14f3d95401 to your computer and use it in GitHub Desktop.
Save ruthenium/5da70464ee14f3d95401 to your computer and use it in GitHub Desktop.
png -> icns
if [ $# -ne 1 ]; then
echo "Usage: make-icns icon.png"
exit 1
fi
IMAGE=$1
OUT=`basename ${IMAGE%\.*}`.iconset
mkdir $OUT
sizes=(16 32 128 256 512)
for size in ${sizes[@]}; do
let "double = $size * 2"
sips -z $size $size $IMAGE --out $OUT/icon_${size}x${size}.png > /dev/null
sips -z $double $double $IMAGE --out $OUT/icon_${size}x${size}@2x.png > /dev/null
done
iconutil -c icns $OUT
rm -r $OUT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment