Skip to main content

Creating animated GIFs on Windows the easy way

As a game developer you often want to show off parts of your work, for example on Twitter or Facebook. Sometimes plain images are enough, but other times you might have a cool game sequence that requires animation to come alive and get the proper attention. You could record video clips and share them with your followers on YouTube etcetera, but most of the times you're probably better off by just creating an animated GIF instead.

Creating animated GIFs is of course nothing new, and not only useful to game devs. From my experience it's an excellent way to quickly demonstrate new features and ideas no matter what you're developing, without the need to have a working prototype.

It took me a while to find my favorite tools that allow me to create GIFs of decent quality quickly and without hassle. Which tool to use depends on what you need to do. Basically, there are two different scenarios where animated GIFs come in handy.

1. Record an actual video sequence (e.g. gameplay) from your computer

Use GifCam:

GifCam is really great for recording short sequences directly from your computer screen. Just launch the program, resize the window to desired size, place it on top of the content you want to record and press the Rec button. For more details about how to use GifCam, check out the link provided above.

Be aware that GifCam works best with fairly low resolution and short recordings. Recording too large a window and/or too long a sequence will likely fail due to an out of memory error. Also note that GifCam is Windows only.

Here's an example of a GIF from Ice Trap created with GifCam:

2. Compile a number of images into an animated GIF

If you already have a number of images that you want to put together in an endless loop, I suggest using ImageMagick which is an excellent command line tool for tasks of this type. If you care about the frame order in the resulting GIF, either make sure to name your images accordingly or list them one by one as arguments to the convert command shown below. The following single command is all that is required to compile your images into an animated GIF:

> convert -delay 50 -loop 0 *.png animated.gif

The delay argument is in 1/100th of a second, so the example above will give each image 0.5s in the resulting GIF.

In case your images are of different sizes, you can resize them all to the same size first, once again with the convert command. For example, this resizes all images to a width of 640px:

> convert -resize 640x *.png

The convert command creates new image files, leaving the original files unchanged. If you want to just overwrite your images while resizing, use the mogrify command instead. This is an example where all images are forced into a specific resolution using the "!" operator (not maintaining aspect ratio) before overwriting the original images:

> mogrify -resize 640x480! *.png

And here's a GIF created with ImageMagick from a number of PNG images: