Subject: | add an auto_crop() method |
# remove rectangular regions matching the top left pixel
# on left/top/right/bottom and remove them in a new image
my $new = $im->auto_crop();
# with some smarts for handling alpha=0
# return how much was removed
my ($new, $left, $top, $right, $bottom) = $im->auto_crop;
# crop until we see $color
my $new = $im->auto_crop(keep => $color);
# instead of the top left pixel, use $color
my $new = $im->auto_crop(remove => $color);