#!/usr/bin/perl use strict; use Image::Magick; my $p = new Image::Magick; $p->Read("image.jpg"); $p->Trim(); $p->Write("trimmed.jpg");