How to create a favicon from an image

Quickly create a favicon with imagemagick from an image (png, jpg etc).
I just released stup, a tool for easily keeping organized daily notes in the terminal. You can find it on GitHub here.

I wanted to update the icon of this blog (to become what else? a cat) and I didn’t remember how I had created the previous one but I do remember I did it via GIMP.

This time though, I found a pretty simple imagemagick command and it worked like a charm.

convert <your-image-here> -define icon:auto-resize=256,64,48,32,16 favicon.ico

Here are all the available options for the imagemagick convert command.