#!/usr/local/bin/perl -w
###########################################
# anigif - Turn png files into an
#          animated gif
# Mike Schilli, 2013 (m@perlmeister.com)
###########################################
use strict;
use Imager;

my @imgs = ();

for my $file_name ( @ARGV ) {

  my $img = Imager->new( file => $file_name );

  $img = $img->scale( xpixels => 300, 
                      ypixels => 200 );
  push @imgs, $img;
}

Imager->write_multi( { 
  file        => "anim.gif", 
  type        => 'gif', 
  gif_loop    => 0, 
  make_colors => "mediancut" }, @imgs) or
   die Imager->errstr();
