GifMaker and Friends

This is a small set of platform-independent classes for creating GIF files. It is based on public-domain code written by Sverre H. Huseby ( -- many thanks, Sverre! Note: if you have any difficulty with this code, write to me, not Sverre.

GifMaker (which also requires the Color module) is the base class for any class which can save itself as a GIF (Graphics Interchange Format) file. You can derive from this class to make plots, graph data, or convert from other formats.

Also provided is a PixelMap class, which derives from GifMaker to give you a simple color-drawing canvass. It includes basic drawing methods for filling rectangular regions, drawing lines, etc. For more advanced drawing functions, use the Turtle class, which provides typical turtle graphics.

Class Name Purpose Requires
Color module defining RGB and Palette classes (nothing)
GifMaker Base class of objects which can SaveGif() Color
PixelMap A GifMaker implementing a 2D pixel array GifMaker, Color
Turtle Draws turtle graphics on a PixelMap PixelMap; math.h

Demo Program

The GIF at the top of this page was generated with this simple demo program. You'll need all four modules above for the demo, but keep in mind that for your own application, you may not need Turtle or even PixelMap.
Last Updated: 6/07/96 Joe Strout ( )