in reply to Resizing, reformatting pictures
Image::Magick or Imager may be what you're looking for.
merlyn also has some WT columns about this topic, IMSMR.