Created
January 26, 2019 10:50
-
-
Save Jim-Holmstroem/2efa6a01df1d5fee21be820f61e0a02a to your computer and use it in GitHub Desktop.
convert image file to .ico icon favicon in linux (perhaps works on mac as well) with imagemagick convert
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
#!/usr/bin/env bash | |
set -ex | |
input_image=$1 | |
output_image=$2 | |
## Example usage: ./convert_to_favicon.sh icon.svg favicon.ico | |
for d in 16 32; do | |
convert -resize ${d}x${d} -flatten -colors 256 ${input_image} /tmp/favicon-${d}.ico | |
done | |
convert /tmp/favicon-{16,32}.ico favicon.ico |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment