GIMP animation - getting started
GIMP stands for GNU Image Manipulation Program and is an open source software application covered by the General Public License [GPL]. The GPL provides users with the freedom to access and alter the source code that makes up computer programs. The GIMP is suitable for a variety of image manipulation tasks, including photo retouching, but in this article we'll concentrate on some of the basic animation facilities. I am going to assume that you have a basic understanding of the GIMP, but if not I recommend you review the documentation found here and whatever your skill level the range of tutorials.
The GIMP is available in most if not all of the most popular Linux Distros, as well as being available for other platforms. If you haven't already installed the GIMP, then it can be installed, just like any other package in your Linux repositories. If your particular interest is animation then as well as the GIMP, you might also want to install GAP Plug-in (the GIMP animation Package) which provides some more advanced animation features. For this article though we'll stick to the functionality in a basic GIMP installation.
Note: You should also find GAP in your Linux repository. There are many links on the web, intended primarily for non Linux users, that provide detailed instructions for installing GAP. Linux users simply install it as you would any other package. The most obvious addition after installing GAP is, as the diagram below shows, the video menu.
Notice that in the diagram I have attached the layers dockable dialog to the toolbar. In case you don't know how to do that, this is a good page to start, and what better way to do that, since this is about animation, is to show you.
Slide show using an animated gif
See this tutorial on simple animations for more details, or follow the cut down version below.
- Simply drag images to GIMP main window. By default they should be added as new frames. Save the finished file with the GIMP .xcf extension.
- Optionally optimise the finished image for gif animation from the menu, i.e. filters->animation->Optimise(for GIF).
Alternatively change the image mode to indexed (image -> mode -> indexed) as the .gif format only uses 256 colours.
- Export image as GIF. Don't forget to click the as animation option (see diagram below). If all your images are opaque, then you can use the don't care option, but you should get into the habit of choosing either combine or replace. Set a suitable delay between frames. This is something you will need to experiment with, to get the result that you want. In this instance I used 2000ms (milliseconds or 2 seconds). For this simple example both the remaining two options can be ticked.
- Always check the resulting image, using an image browser (e.g. eye of gnome), or by simply adding the gif into a web page.
In version 2.8 of the GIMP the optimise process did not always work and maybe superfluous, at least for simple animations.
Here one I made earlier
Double clicking on the gif animation image will open and run the animation in the (Gnome) image viewer, ()assuming you are using a Gnome desktop). Alternatively you load the image into the GIMP and use the playback option for your animation. This can be found from the menu filters -> animation -> playback.
The file format MNG mentioned in the GIMP tutorial reference above, was dropped from Firefox in 2003. They now support an alternative format (APNG) via a plug-in instead
If you now load the gif animation back into the GIMP, notice that the layer names have been altered to include, in this case (2000ms) (combine), as a result of the options choosen above. You can manually add these values if you need to vary the times for example.
Animated GIF Options - combine or replace?
The easiest way to explain this is by example. Imagine that you have a choice of preparing your individual images either on transparencies, or on paper. In the first case you may lay several transparencies over one another, so the combined effect gives you the image you want. In the following example each letter was added to a single transparent layer, the combined effect of the animation is to spell the word HELLO.
In the next example each layer replaces the previous one, and so the animation behaves as if the layer had been drawn on paper. Consequently only one letter is displayed at a time.
The original .xcf file for both these examples was the same, if only difference is the of choice of combine or replace.
When this option is checked, the animation will play repeatedly until you stop it.
Delay between frames where unspecified
You can set the delay, in milliseconds, between frames if it has not been set before. In this case, you can modify every delay in the Layer Dialog.
Frame disposal where unspecified
If this has not been set before, you can set how frames will be superimposed. You can select among three options :
- I don't care: you can use this option if all your layers are opaque. Layers will overwrite what is beneath.
- Cumulative Layers (combine): previous frames will not be deleted when a new one is displayed.
- One frame per layer (replace): previous frames will be deleted before displaying a new frame.
Note: The combine option has the same effect as the layers -> merge down option on the menu bar.
In this example only two images are used to create the effect of the butterfly flapping its wings. Open the GIMP and select file -> new. Under the advanced options, make sure the fill option is set to transparency.
Next add the two butterfly images on alternate layers. (apart from the butterfly itself, the backgrounds are transparent). How you place the images and the subsequent timing you will need to experiment with. The next diagram shows the resulting onion skin effect; as it is known.
The next diagram shows the resulting effect when exported to a gif image using the replace option. Had you chosen combine instead you would see the onion skin as each (transparent) layer is revealed.
When the animation is added to a web page, the CSS background style was used to create the blue sky. E.g.
<img src="./graphics/butterfly_ani.gif" style="background:#48f"/>
Since the animation itself is transparent, you could place it over an image of a meadow for example, to give the final effect a bit more texture.
This short article has covered some of the basics, and explained the difference between combining and replacing layers, and is hopefully enough to get you started. Initially keep things simple, and don't been afraid to experiment; especially with the timing, because it takes practice to get things looking right. It's recommended you create a new folder when starting a project and save copies of every step among the way, so if necessary you can undo anything that goes wrong.
For more complex projects you will need to do some initial planning, i.e. create a storyboard showing the key steps in your animation sequence, and to help break the overall animation down into smaller sequences. You will need to prepare any images/drawing you plan to use in advance and above all you will need patience.
When you have mastered the basics you may want to take a look at the GIMP Animation Package (GAP) which you will find in your Linux repository. As well as providing more advanced features, the plug-in will help with some of the more tedious steps, making you more productive.
If you need any further inspiration try the Crestie Art site the FAQ page has some useful advice. One last cautionary note, animation is a creative process, only limited by your imagination. By all means look at other people's work for ideas, but make sure that you have been granted permission to use any images you find, and respect the time and effort the original artists have put in to create them.