How to manually create icns files using iconutil?

前端 未结 18 2064
无人共我
无人共我 2020-11-29 15:08

When I\'m validating my app I get this error:

the application bundle does not contain an icon in ICNS format, containing both a 512x512

18条回答
  •  孤独总比滥情好
    2020-11-29 15:23

    While using all kinds of scripts to convert hi-res PNG image to a pleiad of different low-resolution copies may seem handy (and it really is), one should not forget that this kind of automatic resizing will render perceptibly imperfect images.

    Lesser the resolution — blurrier the icon!

    I mean, I love imagemagick too, but it is not the right tool for this task!

    Instead, you should always request a logo in some vector format from your designer, for example in SVG. With this on hand, you can manually prepare perfect PNG files in all required resolutions and then make a single .icns file, which will make your app icon look beautiful on every single screen, from a cheap iPhone SE to some high-end Retina display of the latest iMac. You can use Photoshop, GIMP or any other tool of your choice to generate these PNGs.

    From the latest Apple's Human Interface Guidelines as of 2020, you should prepare the following PNG files:

    +---------------------+--------------------+--------------+
    |      filename       | resolution, pixels | density, PPI |
    +---------------------+--------------------+--------------+
    | icon_16x16.png      | 16x16              |           72 |
    | icon_16x16@2x.png   | 32x32              |          144 |
    | icon_32x32.png      | 32x32              |           72 |
    | icon_32x32@2x.png   | 64x64              |          144 |
    | icon_128x128.png    | 128x128            |           72 |
    | icon_128x128@2x.png | 256x256            |          144 |
    | icon_256x256.png    | 256x256            |           72 |
    | icon_256x256@2x.png | 512x512            |          144 |
    | icon_512x512.png    | 512x512            |           72 |
    | icon_512x512@2x.png | 1024x1024          |          144 |
    +---------------------+--------------------+--------------+
    

    After all the PNG files are prepared, place them into some directory with .iconset extension (Logos.iconset for example) and execute the following from the Terminal:

    iconutil --convert icns Logos.iconset
    

    If there were no errors after executing this command, then all the files were processed properly, and you got the Logos.icns file in the same directory, containing all the beautiful crisp logos for your app which will suit any modern screen.

提交回复
热议问题