In the simple case when Animation is passed a GIF89 style GIF with
multiple frames, it will build an internal array of Photo images.
The add_frame method adds images to the sequence. It is provided
to allow animations to be constructed from separate images.
All images must be Photos and should all be the same size.
start_animation($period) then initiates a repeat with specified
$period to sequence through these images. As for raw repeat
$period is in milliseconds, for a 50Hz monitor it should be at
least 20ms. If $period is omitted it is determined from the GIF
metadata (see below), or if this is not possible it defaults to 100
stop_animation cancels the repeat and resets the image to the first
image in the sequence.
For fine-grained control next_image and prev_image move one frame forward
or backward. set_image randomly positions the animation to a particular frame.
pause_animation pauses the movie and resume_animation continues from the
fast_forward and fast_reverse speed through the movie either
forwards or backwards. $multiplier specifies how much faster the
If Image::Info is installed, then the repeat period time and
disposal method of GIF animations are determined from the GIF metadata
directly. Otherwise the disposal method must be set manually by using
set_disposal_method (1 for blanking the previous images, 0 for
leaving the previous images as is). The repeat period time may be
given in the start_animation method.
set_disposal_method was formerly known as blank method, but the
naming of this method was a mistake.
If the disposal method is not set correctly, either by
set_disposal_method or by determining from the GIF metadata, then
the following may happen: By default Animation leaves the previous
movie frame in the animation photo. Many times overlaying subsequent
frames produces a composite that looks blurred.