Friday, March 2, 2012

Making an animation GIF from the Tango icon


The task is to generate a spinner animation GIF. The Tango icons have the PNG format process-working.png.

To make an animation GIF out of it, I tried these commands on Linux (Ref: http://en.wikipedia.org/wiki/File:Spinning_wheel_throbber.gif):

$ composite -compose Dst_Over -tile xc:white process-working.png process-working-white.png
$ convert process-working-white.png -crop 32x32 -repage 0x0+0+0 tiles_%02d.png
$ rm tiles_00.png
$ convert -size 32x32 -delay 5 tiles_*.png -loop 0 process-working.gif

However, I found that they had converted the background color to white -- the original background color is transparent. That was done by the first command (composite ...). After some research, I found out that convert the background back to transparent is not difficult, just add a command line parameter *-transparent white* to the last command. It makes the white color transparent within the image. So the commands we should use are:

$ composite -compose Dst_Over -tile xc:white process-working.png process-working-white.png
$ convert process-working-white.png -crop 32x32 -repage 0x0+0+0 tiles_%02d.png

$ rm tiles_00.png

$ convert -size 32x32 -delay 5 tiles_*.png -loop 0 -transparent white process-working.gif



1 comment:

Guncel Blog said...

Thank you for post.

 
Get This <