Imager can produce animated gifs, but there's a few steps involved.
First you need your images, here are mine, quickly built using the GIMP:
And the code:
#!/usr/bin/perl
use Imager;
my @files;
my $delay = 10;
for (@ARGV) {
/^-d(\d+)/ and do { $delay = $1; next };
push(@files, $_);
}
@files > 2
or die <<EOS;
Usage: $0 [options] images... output.gif
-ddelay - set delay between images in hundreths of a second
EOS
my $output = pop @files;
my @im;
for my $file (@files) {
my $im = Imager->new();
$im->read(file=>$file)
or die "$0: Cannot read image $file: ",$im->errstr,"\n";
push(@im, $im);
}
Imager->write_multi({ type=>'gif',
makemap=>'webmap', # makemap of addi broken in old
gif_delays=>[ ($delay) x @im ],
file=>$output
},
@im)
or die "$0: cannot save to $output: ",$Imager::ERRSTR,"\n";
So I produce my animated gif:
./anim.pl -d30 foo*.gif anim_out.gif