Graphics Muse vlink="#fa3333" alink="#33CC33" link="#0000FA">

More...


Musings

indent

Creating GIF Animations

indent Recently, while working on a text on Unix web servers, I was tasked with writing about multimedia applications. During my research on this subject I discovered a little known fact about the GIF image file format: it supports multiple images in a single file which can be used to create animations. Creating GIF images is fairly simple. There a number of tools available for Linux systems that can either create new GIF images or convert image files in other formats to the GIF format. Tools such as the Gimp or XPaint can be used to create images while xv or the NetPBM tools can be used to convert images from other formats.
indent In order to create a GIF animation you must first create a series of GIF images. These images make up the frames of the animation, much like cell animations make up a cartoon (although there is no reason why your GIF files can't be converted from 3D images such as those created with POV-Ray or BMRT). The animation only plays as fast the the host machines ability to read, decode and display the individual frames. On older 486 systems this might be a problem so its wise to keep your images small. For GIF images this means keeping the dimensions (height and width) of the animation small. You should also consider how jumpy you want the animation to be. Small amounts of movement of objects from frame to frame will reduce the jumpiness of the overall animation, but it also can significantly increase the overall size of the GIF file. Since Netscape (the only browser that I know of that currently supports this type of animation) tries to load the entire GIF file before it begins playing the animation it would be wise to consider keeping the file size small.
indent Once you have the individual frames created, you'll need to put them all into a single GIF file. You can use a nifty little tool called WhirlGIF to do this. WhirlGIF is a command line tool (no GUI) that concatenates the series of GIF images into a single GIF image and configures the GIF header so that Netscape will know how to play the animation. The GIF header allows for a number of options, including some that are Netscape specific (Netscape didn't create their own format - the GIF format allows for application specific extensions). You can provide the number of times to loop the animation and the delay time to use between frames (which can be used to slow down and animation if so desired).
indent There is a terrific page devoted to GIF animations at http://members.aol.com/royalef/gifanim.htm. This page is not Linux (or Unix) specific, but it does include pointers to WhirlGIF and the information in a number of the pages there are very applicable to creating GIF animations on Linux systems.
indent


Copyright © 1996, Michael J. Hammel
Published in Issue 12 of the Linux Gazette