-
-
Save ruthenium/5da70464ee14f3d95401 to your computer and use it in GitHub Desktop.
png -> icns
This file contains 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
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