Depending on how many images you plan to be converting, you may wish to look at alternatives. I'll likely get accused of trolling or whatnot for this, but I was very not impressed by the speed of the image compression done by Image::Magick. You may be ok for compressing JPEG images (I didn't try those), but compression of TIFF images was completely not acceptable IMHO. Converting 5-page documents from Group III TIFF to the latest flavor of TIFF took 3-4 seconds each. For my 850,000 image conversion, that would have taken approximately a month of raw processing. Ugh!
Just a word of warning. ++ to all the excellent suggestions above.