use strict; use warnings; use Imager::GIF; my $gif = shift || die 'need an image'; my $img; $img = Imager::GIF-> read( file => $gif ) or die $img-> errstr; $img = $img-> scale( scalefactor => 0.5 ); $img-> write( join '.', $gif, 'half', 'gif' ) or die $img-> errstr;