As shiza commented, Image::Magick might fit the bill. I have recently been playing around with Imager and found it to have a much cleaner API.
I have also built an experimental gear for Sprog to do an image transformation. My vision there is to have a bunch of image processing gears that each do one specific transformation and can be chained together if necessary. The one I've built, adds a border around the image. The user gets to select border width and colour via a properties dialog. Other ones I have in mind are thumbnail generation, rotation, adding text labels (eg: copyright info or captions) and auto cropping. Imager can be used for all those things.