-
-
Save smowtion/0b284b0b4989db7bf4b19f758c4eecbb to your computer and use it in GitHub Desktop.
covert svg to icns (with imagemagick)
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/bash | |
echo "*** SVG 2 ICNS ***" | |
if [ $# -ne 1 ]; then | |
echo "Usage: svg2icns filename.svg" | |
exit 100 | |
fi | |
filename="$1" | |
name=${filename%.*} | |
ext=${filename##*.} | |
echo "processing: $name" | |
dest="$name".iconset | |
mkdir "$dest" | |
convert -background none -resize '!16x16' "$1" "$dest/icon_16x16.png" | |
convert -background none -resize '!32x32' "$1" "$dest/[email protected]" | |
cp "$dest/[email protected]" "$dest/icon_32x32.png" | |
convert -background none -resize '!64x64' "$1" "$dest/[email protected]" | |
convert -background none -resize '!128x128' "$1" "$dest/icon_128x128.png" | |
convert -background none -resize '!256x256' "$1" "$dest/[email protected]" | |
cp "$dest/[email protected]" "$dest/icon_256x256.png" | |
convert -background none -resize '!512x512' "$1" "$dest/[email protected]" | |
cp "$dest/[email protected]" "$dest/icon_512x512.png" | |
convert -background none -resize '!1024x1024' "$1" "$dest/[email protected]" | |
iconutil -c icns "$dest" | |
rm -R "$dest" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment