iconify — Windows and Mac Icons from PNG Images

New: as of June 2017, iconify 2.0 can now create both Windows ".ico" icon files and Mac OS X ".icns" icon files, from presized images—and on either Windows or Macs (plus Linux). Check out the new script's main docstring for details; this is mostly a one-script program, and all its usage documentation is at the top of its code file.

You may also be interested in this new 2.0 utility that displays the structure of ".icns" files; this older 1.0 utility that does the same for ".ico" files; and this 2.0 tool that resizes a 1024 PNG file as a prestep to iconify. Or, fetch the new version's zipfile with all these items here. iconify is used to build icons of the major programs here, and also ships in their source-code package build folders.

The rest of this page is now somewhat redundant with the update above, but its note about Pillow requirements still applies.

This basic Python 3.X/2.X program creates both ".ico" Windows-style and ".icns" Mac OS-style icon files from presized image files in a folder. It requires Python and the Pillow (PIL) image library (available here), and demonstrates low-level binary data processing with the struct module. See the main script's docstring and other items below for more details.




Download/view all:

This program was last changed June 2017.

For more code examples, see the programs page.

[Python Logo] Home Books Programs Blog Python Author Training Email Search ©M.Lutz