Project: What's In A GIF

The Internet is filled with GIF image files. It's a wildly popular raster image format. I found the need to explore exactly what makes up these images so that I might be able to programmatically read and create my own though code. I found these simple files to be quite interesting. I thought I would share what I learned. I've broken up the information into the following 4 parts:

  1. Bits and Bytes - first we look at the file format that makes up a GIF file
  2. LZW Image Data - a closer look at how image data is compressed within a GIF file
  3. Transparency and Animation - how some of the more "advanced" features of GIF files work
  4. GIF Explorer - decode a GIF file in your browser to see the different pieces
  5. GIF Image Encoder - an interactive GIF Image Data encoder to see the compression steps in action

NOTE: Throughout this guide, I'll be looking at the bytes that make up a GIF file. If you would like to follow along at home, you'll probably need some sort of hex editor. I had success using XVI32 on my Windows machine and HexFiend on my Mac. Both apps are free.

home - github - me@matthewflickinger.com