Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have seen .ico icons that have different images for multiple sizes, eg. 16x16, 32x32, 48x48, 128x128, 256x256. On Windows, how can I create an icon file that supports multiple sizes in this way, given I have existing .ico files for each size? Please note that I'm hoping to do this to 200+ files, so doing it from cmd would be ideal.

share|improve this question
add comment

4 Answers

up vote 5 down vote accepted

ImageMagick (Windows/Mac/Linux) contains a command-line tool called convert that can be used for many things, including packing multiple images in one icon:

convert 16.png 32.png 48.png 128.png 256.png -colors 256 icon.ico

The previous command takes 5 PNG images, and combines them into a single .ico file.

Unlike the other answers, this method can easily be used in batch scripts to automatically generate several icon files. In one of my projects, I have a single vector image (SVG), and use Inkscape to generate png's of various sizes, followed by convert to create a icon container. This is a reduced example (in a bash script):

#!/bin/bash
for size in 16 32 48 128 256; do
    inkscape -z -e $size.png -w $size -h $size icon.svg >/dev/null 2>/dev/null
done
convert 16.png 32.png 48.png 128.png 256.png -colors 256 icon.ico
share|improve this answer
    
Man, I feel like I learn a new way to use ImageMagick's convert every time I look into it. Thanks for the answer! –  Suchipi Dec 2 '13 at 23:33
add comment

You can do this for free in GIMP. There are brief instructions for doing this here.

To quote:

  1. Open your image in Gimp
  2. Make your canvas square
  3. Resize your layer to the image
  4. Scale the layer to the largest size in your .ico file like 64 pixels
  5. Duplicate the layer
  6. Scale the duplicate layer to the next size
  7. Keep duplicating / scaling for all the sizes you want in your .ico file
  8. Save as .ico

In your case, you could either start with the largest image and scale down for each duplicated image, or you could just add new layers and import the specific icon images you wanted into that layer.

share|improve this answer
    
How do you support multiple color depths by this method? –  Random832 Oct 22 '12 at 17:43
    
Can't say that I've had to do that personally, but this post says GIMP should pop up a color settings dialog for each layer upon saving. –  techturtle Oct 22 '12 at 17:50
add comment

It is my opinion that Axialis IconMaker is the best solution to icon problems. There's a 30 day trial that will probably solve the problem for you.

I have used Axialis for so many years and on so many projects, I can attest that it is a really worthwhile product. You won't need 30 days! Ha!

share|improve this answer
add comment

You must use a third-party icon-editing program because MSPaint only supports a single icon per file. There are a couple of threads here with recommendations for icon editors, some free, some commercial.

Once you settle on an icon editor, the method of adding icon formats will vary but generally be similar (you click a button or select a menu item to add a new format). Most programs will let you import an icon file when adding an icon format/size, but most also let you create a new format/size from the existing one by re-sizing it.

If you choose to use the create-from-existing option when adding a new format/size, make sure to create them from the largest icon format you have already available since it will have the most data for the re-sizing algorithm to work with. Also, make sure to use a version with transparency when creating an XP/Vista icon since most programs are not great at creating the alpha channel from scratch.

share|improve this answer
    
I need to do this to over 200 icons. Can any of those icon editors run things in batch? –  Suchipi Oct 22 '12 at 20:08
1  
I don’t recall ever seening an icon editor with batch mode. You could try using an image editor in batch mode, but I’m not sure if any image-editors have multi-format icon support (at least not from the command-line/batch-mode). If any do, it would be ImageMagick. Also, you should add the volume and batch-mode requirement to the question. –  Synetech Oct 22 '12 at 20:14
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.