Generating Favicons using ImageMagick on the Command-Line

Featured image for sharing metadata for article

Last week I took a new profile photo, and as such I needed to update my favicon so it would match the new look.

As it's something I very infrequently do, I would usually reach for an online tool to do this, but I wanted to see if I could use the ever handy ImageMagick to do this for me, especially as it's good to not rely on online tools.

Following this (slightly rude) reply, we can see that we can run the following command to produce a .ico file, with all the relevant sizes, in a single file:

convert profile.png -bordercolor white -border 0 \
      \( -clone 0 -resize 16x16 \) \
      \( -clone 0 -resize 32x32 \) \
      \( -clone 0 -resize 48x48 \) \
      \( -clone 0 -resize 64x64 \) \
      -delete 0 -alpha off -colors 256 favicon.ico

Written by Jamie Tanna's profile image Jamie Tanna on , and last updated on .

Content for this article is shared under the terms of the Creative Commons Attribution Non Commercial Share Alike 4.0 International, and code is shared under the Apache License 2.0.

#blogumentation #command-line #imagemagick.

Also on:

This post was filed under articles.

Interactions with this post

Interactions with this post

Below you can find the interactions that this page has had using WebMention.

Have you written a response to this post? Let me know the URL:

Do you not have a website set up with WebMention capabilities? You can use Comment Parade.