I would like to create .ico icon for my Windows application dynamically (from the SVG file) by using ImageMagick. The icon should be created according to the Microsoft recommendations [1] [2] regarding application icons (different sizes, depths, and an additional hi-res PNG icon for Vista+ in a single .ico). How do I do that? Does anyone has a ready-made recipe?
Microsoft lists various color depth and size requirements [1] for the icon. ImageMagick has the -depth and -colors options, but I'm not sure how to use them correctly in this case.
Additionally, it looks like Vista+ supports 256x256 hi-res icon [2] embedded into the very same .ico which can (should? must?) be a compressed PNG. How do I "join" the Windows XP icons and this new Vista icon into a single .ico file?
[1]: http://msdn.microsoft.com/en-us/library ... cons_step5
[2]: http://msdn.microsoft.com/en-us/library ... .aspx#size
Recipe for creating Windows ICO files with ImageMagick?
Re: Recipe for creating Windows ICO files with ImageMagick?
Assuming you've already got the images, this should do it:
There's a bug in ImageMagick-6.7.8-3 that causes it to not do PNG encoding
of the 256x256 image. That's fixed in the forthcoming ImageMagick-6.7.8-4.
- convert vista.ico image_256x256 combined.ico
There's a bug in ImageMagick-6.7.8-3 that causes it to not do PNG encoding
of the 256x256 image. That's fixed in the forthcoming ImageMagick-6.7.8-4.
Re: Recipe for creating Windows ICO files with ImageMagick?
Thanks!
However, how to I create those images with correct sizes and depths from a, say, PNG? Again, I've tried -depth option without much luck (for example, -depth 4 does not provide a 4-bit ICO as required by Windows XP).
I did a "correct" version of the icon with a proprietary application [1]. How do I reproduce that with IM?
[1]: http://stuff.pypt.lt/icon-win32.ico
However, how to I create those images with correct sizes and depths from a, say, PNG? Again, I've tried -depth option without much luck (for example, -depth 4 does not provide a 4-bit ICO as required by Windows XP).
I did a "correct" version of the icon with a proprietary application [1]. How do I reproduce that with IM?
[1]: http://stuff.pypt.lt/icon-win32.ico
Re: Recipe for creating Windows ICO files with ImageMagick?
Looking at the source for coders/icon.c, it appears that one can control the depth with the -colors option together with the -depth option (e.g., -colors 16 -depth 4 to get a 4-bit ICO). I tried that and identify -verbose tells me that it works.pypt wrote:Thanks!
However, how to I create those images with correct sizes and depths from a, say, PNG? Again, I've tried -depth option without much luck (for example, -depth 4 does not provide a 4-bit ICO as required by Windows XP).