Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
    
    $img->autocrop(fuzz=>20) or die "autocrop: ".$img->errstr();
    $img->write('out.jpg') or die "writing: ".$img->errstr();
    
  2. or download this
    use Imager;
    use Imager::Filter::Autocrop;
    ...
    $img->read(type=>'scalar', file=>$imgdata) or die "read: ".$img->errst
    +r();
    $img->autocrop(fuzz=>20) or die "autocrop: ".$img->errstr();
    $img->write(file=>'out.jpg') or die "writing: ".$img->errstr();