Next: , Previous: Showing Images, Up: Images

38.16.12 Animated Images

Some image files can contain more than one image. This can be used to create animation. Currently, Emacs only supports animated GIF files. The following functions related to animated images are available.

— Function: image-animated-p image

This function returns non-nil if image can be animated. The actual return value is a cons (nimages . delay), where nimages is the number of frames and delay is the delay in seconds between them.

— Function: image-animate image &optional index limit

This function animates image. The optional integer index specifies the frame from which to start (default 0). The optional argument limit controls the length of the animation. If omitted or nil, the image animates once only; if t it loops forever; if a number animation stops after that many seconds.

Animation operates by means of a timer. Note that Emacs imposes a minimum frame delay of 0.01 seconds.

— Function: image-animate-timer image

This function returns the timer responsible for animating image, if there is one.