Home / Alt manpages / animate-im6.q16(1)

  • animate-im6.q16(1)
  • User command
  • linux

Preview an Image Sequence with ImageMagick animate

ImageMagick's animate pops an X window and plays back one image, a numbered set of frames, or an existing GIF. This guide gets that working, plus the speed, size and troubleshooting controls that make it actually useful. Allow about ten minutes for a first test.

You need ImageMagick 6, readable image files, and access to an X server. This guide uses the installed imagemagick-6.q16 package, version 8:6.9.12.98+dfsg1-5.2ubuntu0.1~esm13, whose executable reports ImageMagick 6.9.12-98 Q16. The command is normally unprivileged: do not reach for sudo to open somebody else's display or paper over a bad file path.

1. Check the installed command and display

Confirm which executable will actually run, and whether the shell even has an X display selected:

$ command -v animate-im6.q16
/usr/bin/animate-im6.q16
$ animate-im6.q16 -version
Version: ImageMagick 6.9.12-98 Q16 x86_64 18038 https://legacy.imagemagick.org
$ printf 'DISPLAY=%s\n' "$DISPLAY"
DISPLAY=:0

The exact version line will drift after a package update. What matters is that the executable exists and DISPLAY names a reachable X server. The installed manpage calls the program animate-im6.q16; the local animate and animate-im6 manpages describe the same command. Use the fully qualified name in scripts so an ImageMagick 7 installation or a different wrapper does not silently change the behaviour underneath you.

Checkpoint

If DISPLAY is empty, stop here and connect to the intended graphical session first. A remote shell may need X forwarding, and a scheduled job may have no display at all. Never copy another user's DISPLAY value or authentication files without understanding what access that actually grants.

2. Check the input without opening it

Use identify, a separate ImageMagick command, to check names, formats and dimensions before you ever ask animate to open a window:

$ identify /path/to/frame-01.png /path/to/frame-02.png
/path/to/frame-01.png PNG 640x480 640x480+0+0 8-bit sRGB 2c 163B 0.000u 0:00.000
/path/to/frame-02.png PNG 640x480 640x480+0+0 8-bit sRGB 2c 163B 0.000u 0:00.000

Your metadata will differ. Check that each path is readable, the format is recognised, and the dimensions match what you expect. It is a useful split of jobs: identify proves the files are actually images, while animate is the one that needs an X server to show them.

Numbered frames? Let the shell expand them in the order you actually intend:

$ printf '%s\n' /path/to/frames/frame-*.png
/path/to/frames/frame-01.png
/path/to/frames/frame-02.png
/path/to/frames/frame-03.png

Never assume a wildcard sorts numerically. Names such as frame-1.png and frame-10.png can put frame 10 before frame 2. Rename or explicitly list files when order matters. Keep the original frames: animate just displays them and has no reason to rewrite anything.

3. Open one image or an existing animation

Start with one known-good image. The command stays glued to the display until you close its window or interrupt it:

$ animate-im6.q16 /path/to/preview.png

For an animated GIF, pass the GIF as one input; its image sequence and saved animation settings come along as part of the input:

$ animate-im6.q16 /path/to/example.gif

To animate separate frames, pass all of them in order:

$ animate-im6.q16 /path/to/frames/frame-01.png /path/to/frames/frame-02.png /path/to/frames/frame-03.png

When the window appears, click it to expose the ImageMagick command widget. The installed manual documents button 1 as the control that maps or unmaps that widget. Command immediately complains it cannot open the X server? Back to step 1. Opens fine but chokes on one frame? Run identify on each input and test the frames individually.

4. Set a useful playback speed

The -delay image setting is measured in centiseconds, an ImageMagick quirk worth remembering. For a tenth of a second per frame, use 10:

$ animate-im6.q16 -delay 10 /path/to/frames/frame-*.png

A larger value plays slower; -delay 50 requests half a second. This is applied while the sequence is read, not a change to the source files sitting on disk. If a GIF already carries frame delays that are too quick to inspect, an explicit command-line setting is a handy way to test a slower value without touching the file.

The -loop setting controls how many times the images cycle before the command exits. Combine it with a deliberately short test sequence whenever you need a bounded run:

$ animate-im6.q16 -delay 25 -loop 2 /path/to/frames/frame-01.png /path/to/frames/frame-02.png

Warning

Do not put an unbounded display command in an unattended job and expect it to ever finish. This is an interactive viewer, not a video encoder or a service. Press the terminal interrupt key, normally Ctrl-C, to stop the foreground process, or just close the window: both are normal ways to end an interactive preview.

5. Fit large images to the window

Use -resize when the source images are too large for the display. The geometry 1200x800> means shrink any image that exceeds either bound, while keeping its aspect ratio intact:

$ animate-im6.q16 -resize '1200x800>' /path/to/frames/frame-*.png

The quotes protect the geometry from shell metacharacter handling. The greater-than sign is part of ImageMagick's geometry syntax, so it shows here as > in the HTML but appears as > once copied out of the code block. This only affects the displayed image sequence, never the files on disk.

Need a fixed window position or preferred size instead? -geometry sets the Image window geometry. It is a separate knob from -resize: one concerns the X window, the other changes the image presented to it.

6. Diagnose the common failures

Unable to open X server: check DISPLAY, the session you are logged into, and whether your connection has X authorisation. This is not an image-format error, whatever the wording suggests. On a headless machine, reach for identify or another non-graphical workflow instead of guessing at display values.

Unable to open image: inspect the exact path and permissions:

$ ls -l /path/to/preview.png
$ test -r /path/to/preview.png && echo readable
readable

The order looks wrong: print the shell-expanded arguments, then use zero-padded names or an explicit list. The sequence is too fast: add a larger -delay. One frame is corrupt: find it with identify and drop it from the preview list, rather than touching the source archive.

Warning

Never treat -authenticate or -decipher as ordinary viewing options for untrusted files. They involve protected image data and a password or cipher file. Keep secrets out of shell history and process listings, and only reach for those options once the input and the key material have been verified.

Done means

  • animate-im6.q16 -version reports the expected ImageMagick 6 installation.
  • DISPLAY points to an X server you are authorised to use.
  • identify confirms that the intended inputs are readable images.
  • The frames are passed in a deliberate order, with zero-padded names where needed.
  • -delay, -loop and -resize are used only for the current preview.
  • No source image, persistent configuration or service was changed.