Recipe for creating Windows ICO files with ImageMagick?

后端 未结 9 1259
长发绾君心
长发绾君心 2020-12-13 07:18

I would like to create .ico icon for my Windows application dynamically (from the SVG file) by using ImageMagick. How do I do that?

Microsoft lists vari

9条回答
  •  情话喂你
    2020-12-13 07:50

    To create an ICO file from a SVG while keeping aspect ratio:

    1. look for SVG proportions (eg. 1920x1080)
    2. for a max 256px wide icon, do the proportion: [1920:1080=256:x] -> x=(1080*256)/1920=144
    3. finally, use ImageMagick convert command:

      convert -background none -resize 256x144 -gravity center -extent 256x144 image.svg image.ico

提交回复
热议问题