Blinksale: Easy, painless, online invoicing for small businesses

how to combine ico 16, 24, and 32 into one file with the gimp

windown icon (.ico) files are capable of containing multiple sizes as well as multiple color depths at each size. the iconbuffet icon sets already have both 32- and 8-bit color in each .ico file, but they come in 3 different files — one for each size of 16x16, 24x24, and 32x32.

since one .ico file can hold all 6 images for a single icon (3 sizes times 2 color depths is 6), i combine the 3 separate .ico files for each icon into one file using the gimp. i find this easier on windows than on linux (though it works in both) because of how windows decides where to put newly-opened windows (it cascades them in the upper-left quadrant of my screen, while linux tries to find there’s the most uncovered desktop space and put new windows there).

so here’s how i easily combine 3 ico files into one using the gimp. i suspect there is also a way to automate this sort of thing, so if somebody posts how to do that i’m interested!

1. start up the gimp.

2. unzip the file downloaded from the set page. i unzip the entire thing even though i only want the .ico files. for example, i unzipped ib-anniversary.zip to U:\ib-anniversary\

3. open the folder where you unzipped the icons, and browse down to Win ICOs\32x32\.

4. select some of the 32x32 .ico files (the maximum number you should select depends on the size of your screen — i can fit 9 on my 1600x1200 screen comfortably). drag them to the main gimp window and drop them on the toolbar so the gimp will open them all.

5. rearrange the gimp windows so that the layers window and all of the icon image windows are available. i have my 9 icon image windows down the right side of my screen (i overlap the titlebar/toolbar of one with the scrollbar/statusbar of the one above it), and the layers window just to the left of the image windows. it’s important to not cover up the image itself in the image windows or the layers that show in the layers window with any other windows in order to make this as easy as possible.

6. browse into the 24x24 folder instead of the 32x32. select the same files as in step 4 (but the 24x24 versions) and drag-and-drop them onto the gimp tool pallet to open them. for me, windows opens them in the area of the screen such that they don’t cover the layers window or the 32x32 icon windows — that's what you want.

7. work through the 24x24 image windows. note that the layers window shows icon #1 and icon #2 as the two layers for the selected icon image window (#1 is the 8-bit and #2 is the 32-bit color). with a 24x24 icon image window selected, drag the #2 layer onto the corresponding 32x32 image window and drop it on the image part of the window. this copies the layer to the 32x32 image. select the 24x24 window again, and repeat with the #1 layer, then close the 24x24 window.

8. once you’ve worked through all the 24x24 windows, open up the 16x16 files and repeat what you did with the 24x24 files.

9. for each 32x32 window you have open (they should all have 6 layers), choose file > save as from the menu. back up out of the 32x32 directory, delete the _32 part of the file name, and click save. the save as windows icon window pops up. you should see one 8 bpp and one 32 bpp for each size. click save and your combined .ico file is saved! close the 32x32 window and finish up with the rest.

10. you can now delete the 16x16, 24x24, and 32x32 directories because all three sizes are now combined in one file per icon.

11. enjoy! note that you can later for example open up one of these .ico files in the gimp, delete all but the 32-bit 16x16 layer, select image > fit canvas to layers from the menu, and then save as a png should you need a 16x16 png for a website...

Posted by misterhaan on Mar 21, 2008 in Blab | 1 comments

gswd on Mar 21, 2008

great info. Good to see some people are using Gimp for the greater good.