23

I can use ImageMagick to convert png to ico but (I think, not sure) it will create one image per ico file for the size I specify.

convert favicon.png -resize 32 favicon.ico

An ico file can contain 2 or 3 images for 16x16 32x32 and 64x64 pixels.

Is it possible to create such icon maybe with ImageMagick or other tool?

Luce
  • 55
  • 2
  • 8
jcubic
  • 9,612
  • 16
  • 54
  • 75

2 Answers2

25

Newer versions have an easier command:

convert -background transparent image.png -define icon:auto-resize=16,32,48,64,256 favicon.ico

-background transparent is of course optional.

Tobias Kienzler
  • 9,184
  • 13
  • 65
  • 106
18

Found it on imagemagick.org site:

convert image.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
jcubic
  • 9,612
  • 16
  • 54
  • 75