imagemagick might get you started, otherwise something like the Gimp could do this easily.

http://www.imagemagick.org/Usage/crop/