-
-
Save keot/5541675 to your computer and use it in GitHub Desktop.
Now cleans itself up after conversion.
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
#!/bin/sh | |
# originally from | |
# http://bergamini.org/computers/creating-favicon.ico-icon-files-with-imagemagick-convert.html | |
input=$1 | |
working=`mktemp -d -t mkfavicon-XXXX` | |
convert $1 -resize 256x256 -filter Gaussian -transparent white ${working}/favicon-256.png | |
convert ${working}/favicon-256.png -filter Gaussian -resize 16x16 ${working}/favicon-16.png | |
convert ${working}/favicon-256.png -filter Gaussian -resize 32x32 ${working}/favicon-32.png | |
convert ${working}/favicon-256.png -filter Gaussian -resize 64x64 ${working}/favicon-64.png | |
convert ${working}/favicon-256.png -filter Gaussian -resize 128x128 ${working}/favicon-128.png | |
convert ${working}/favicon-16.png ${working}/favicon-32.png ${working}/favicon-64.png ${working}/favicon-128.png ${working}/favicon-256.png -colors 256 favicon.ico | |
rm -r ${working} | |
echo "Image file ${input} successfully converted to favicon.ico." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment