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.


Remotely transferring images from the Pi

Read article All articles
regnans-leaf-1-2016-06-08 Play

Eucalyptus regnans leaf
Eucalyptus Regnans P50 ~2.5MPa. A selection of images from the full sequence.