ImageMagick is a set of tools for image manipulation and conversion. It consits of a set of command line programs as well as of a library that can be interfaced from own applications. It can do almost any image manipulation from a batch file or shell script and even brings it's own scripting language. Besides this, it serves well to circumvent a known Photoshop bug that prevents fom opening large TIFFs with Photoshop.
The software can be found at www.imagemagick.org.