Chapter 9. Moving Pictures: Programming GIF Animation

This chapter will tell you how to program GIF animations. GIF animation should be thought of as flip book animation. Just as a flip book is not an appropriate format for Fantasia, GIF animation is not an appropriate format for long works, large images, or sequences that require many frames per second to be effective. Also, any sort of presentation that necessitates interaction with the user will require another solution based in Java, JavaScript, or some other language or plug-in. GIF animation does have strengths, however, the foremost of which include:

  • No plug-ins needed. The user looking at your web page will not be required to have a specially configured browser or download a plug-in to view your animation.

  • Independent of server configuration. GIF animation requires nothing fancy on the server-side either. Animations are served just like every other image because they are just regular GIF files.

  • Quick feedback for the user. GIF animations are streaming animations and as a multimedia format are as efficient as you can get. Contrast the response time of a GIF animation with an animation done in Java and you will understand their appeal.

This chapter starts with a brief discussion of the general concepts behind GIF animation, and then presents seven common problems and solutions. The last section in the chapter details the implementation of GIFscript, a language for describing the construction of animated GIF files as an alternative ...

Get Programming Web Graphics with Perl and GNU Softwar now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.