#!/usr/bin/perl use strict; use warnings; use Imager; my $gif = shift || die 'need an image'; my $img = Imager->new; $img->read(file => $gif) or die $img->errstr; $img = $img->scale(scalefactor => 0.5); $img->write(file => join '.', $gif, 'half', 'gif') or die $img->errstr;