— Generator for @ocram’s picons

This script generates @ocram’s picons from the source images that are available at The resulting picons are as close to the originals as possible.


Because I wanted to produce the final versions of some of the TV channel logos I was developing before pushing the changes to @ocram. The script he uses to produce his original picons is not available so I wrote my own.


On Debian/Ubuntu based operating systems these can be installed by installing the packages

python-pgmagick python-progressbar


generatepicons home page is at and it can be downloaded by cloning the public Git repository at git:// Gitweb interface is available at

Also available at Github:


Just install the dependencies, clone the Git repo and put anywhere you want (or run directly from the cloned working directory).



/path/to/ --help

for full command line help.

Typical use case to generate all the picons and symlinks for them would be

git clone git://
cd picons
for dir in ocram-picons/*; do sh $dir; done

and under ocram-picons you would find subdirectories that contain the ready stuff.

During the execution of the script you might see a lot of lines like this in the terminal:

gx=0.321210, gy=0.597870, bx=0.155890, by=0.066040
wx=0.345750, wy=0.358550, rx=0.648500, ry=0.330880
gx=0.321210, gy=0.597870, bx=0.155890, by=0.066040
wx=0.345760, wy=0.358580, rx=0.648450, ry=0.330860

This is caused by warning printf’s in an older versions of libpng. It’s harmless though annoying. See


Thanks to @ocram for initiating his TV channel logo project and sharing some info how his script works so I was able to replicate the results of the original as closely as possible.

Also thanks to @tkurbad for his Some of the bulk code (args parsing, main function) was shamelessly stolen from his script. This is my first public Python script, after all :)

Copyright and licensing

Copyright © 2012 Tuomas Jormola

Licensed under the terms of the GNU General Public License Version 2.0.