Skip to content

Instantly share code, notes, and snippets.

@antonklava
Created April 11, 2012 08:18
Show Gist options
  • Save antonklava/2357834 to your computer and use it in GitHub Desktop.
Save antonklava/2357834 to your computer and use it in GitHub Desktop.
Super simple script to create a favicon.ico from specified png
#!/bin/bash
#
# Super simple script to create a favicon.ico from specified png.
# Requires imagemagick ( http://www.imagemagick.org )
#
# Usage:
# ./favicon-from-png.sh myimage.png
# ls
# myimage.png favicon.ico
#
# Writting by Anton Klava, antonklava@gmail.com, April 2012
#
mkdir tmp &>/dev/null
convert $1 -resize 256x256 tmp/favicon-256.png
convert tmp/favicon-256.png -resize 128x128 tmp/favicon-128.png
convert tmp/favicon-256.png -resize 64x64 tmp/favicon-64.png
convert tmp/favicon-256.png -resize 32x32 tmp/favicon-32.png
convert tmp/favicon-256.png -resize 16x16 tmp/favicon-16.png
convert tmp/favicon-16.png tmp/favicon-32.png tmp/favicon-64.png tmp/favicon-128.png tmp/favicon-256.png favicon.ico
rm -r tmp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment