In imagemagick, the -trim option removes any edges from an image that are exactly the same color as the corner pixels. I know, I could use a binding to use imagemagick in a