Using "icoutils" on Linux to create a Windows Icon

What is "icoutils"?

Recently I had a project that required that I have a Windows icon associated with it. This didn't seem too daunting to me at first, because I know that the image editor I was using could save images in the "ico" format I needed. .ico files are used for things like websites (favicon.ico) and program executables. In my case, I was creating a program executable, and I needed to create an icon for it once it was compiled.

The "icoutils" is a free project that can be used to both create ico files or it can be used to extract images from ico files. The "icoutils" home page can be found over here:
http://www.nongnu.org/icoutils/

While I am personally okay with compiling things, I did find that "icoutils" was in my local software repository, (I'm currently using Linux Mint), so you can probably find it in other repositories as well (I haven't checked).

"icoutils" Online Documentation (or Lack Thereof)

While I was happy to find that there was a free utility to create ico files, I was disappointed because I couldn't find online documentation *anywhere* about how to use it. I ended up looking at the source package and seeing that the source creates 3 utilities, none of which are actually named "icoutils". Instead, the three utilities that are created are "icotool", "extresso", and "wrestool".

Since I installed "icoutils" via my repository, I could run each command followed by a "--help", which was nice because it provided me with some basic usage information. I also found that "info" worked, so "info icotool" provided some good documentation on how to use it. There were no actual command examples, so I had to figure out the hard way which command sequence was necessary to create an actual ico file, but eventually I was able to figure it out. So... I thought I'd document the process here.

Using "icoutils" to Create a .ico File

icoutils create icon

After reading a bit about .ico files, I found that .ico files are actually a grouping of several different files at various resolutions and color depths. bundling up all the image files into a single "ico" file allows that file to become larger and smaller depending on how it's used. For example, the favicon.ico has a smaller image that is used in a browser's favorites list, and a larger version that is used as a desktop icon. The same rule applies to an executable file. If the executable is shown in Windows Explorer's "list" view, the small icon is shown, where if you use "tile" view, the larger icon is shown.

With this in mind, I had to create several iamges in order to create my icon. I chose to create the following resolutions: 16x16, 32x32, and 48x48. I created each image and saved each one as a .png file. I did this using The Gimp, which is a free image editor that I use on my Linux Desktop. Next, I used the "icoutils" tool called "icotool", to bundle the images together using the following command:

  • $ icotool -c viv-16-16.png viv-32-32.png viv-48-48.png -o viv.ico

After that, I was immediately provided with my "viv.ico" file which had each image nicely bundled together.

Thanks to the makers of Gimp and "icoutils" for their hard work and for letting folks like me from the community benefit from it!

Comments

Write your comment

(it will not be displayed)

Leave this field empty: