Last active
February 2, 2016 01:39
-
-
Save dardo82/23fc11174b550074a739 to your computer and use it in GitHub Desktop.
Make ICNS from PNG
This file contains hidden or 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
#!/bin/zsh | |
#mkicns.sh | |
FN=${1##*/} | |
DN=${1%/**} | |
BN=${FN%.*} | |
IS=iconset | |
ID=$BN.$IS | |
mkdir $ID | |
chdir $ID | |
i=\../$FN | |
for m r in 'n' '' '((n+1))' '@2x';do | |
for n in $(seq 4 9|grep -v 6);do | |
p=$((2**$m));q=$((2**$n)) | |
o=icon_${q}x${q}${r}\.png | |
sips -z $p $p $i --out $o | |
done | |
done | |
iconutil -c icns $PWD | |
cd $OLDPWD;rm -fr $ID |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment