Creating animated GIFs using ImageJ

By Chris Lucani -

There are a number of ways of creating animated GIFs for upload to the OpenSourceOV gallery. Aside from online tools such as there are also desktop applications like GIF Toaster for mac or GIF Maker for windows, as well as Adobe Photoshop, but the easiest way is to use ImageJ which you’ll already have installed for processing the images.

1. Load the sequence of images into a stack using the Import > Image Sequence… option from the File menu. More instructions for importing captured sequences can be found in the Processing Instructions.


2. Scroll through the stack using the left and right cursor keys and make a note of the slice number (shown at the top of the stack window) for slices you want to include in the animated GIF. From the Image menu then select Stacks > Tools > Make Substack…

Untitled 2

3. Enter the slice numbers noted from step 2. Can be comma separated or a range. Press OK to create the substack.

Untitled 3

4. Press the play button ‘>’ at the bottom left of the new stack to check the speed of the animation. If you want the animation slower or faster select Stacks > Animation > Animation Options… from the Image menu and change the frame rate.

Untitled 4

Untitled 5

5. Resize the stack size if required – should be less than 1200px. Select Adjust > Size from the Image menu.

Untitled 6

6. Save the stack as an animated GIF. Simply select Save As > Gif… from the file menu.

Untitled 7

7. Use an image optimisation tool to optimise the size of the GIF. For mac users ImageOptim is excellent and free. For windows users FileOptimizer is good if a bit clunky. For an online optimisation tool use

8. If the file size is more than 10MB consider removing slices or reducing the stack dimensions even further (step 5).


Help improve these resources by contributing to the project.


Sample selection and preparation

Read article All articles
eregnans-stem Play

Eucalyptus regnans stem
Captured by Chris @ the Brodribb Lab. This is the sequence before processing. Large sequence (~9MB) - may need to wait for it to load to run smoothly.