Possible Duplicate:
Batch converting PNG to JPG in linux

I have about 50 PNGs that are about 10Mb each (fully compressed). I want to convert them to JPGs with maximum quality, so that they fall just under Facebook's 5Mb limit. I can manually convert each one in the GIMP, but this seems like a bit of a pain. Is there an easy way to convert them all at once?

Edit: mogrify -format jpg *.png seems to be pretty much what I'm looking for. However, it compresses to around 1.5mb. When I select maximum quality in GIMP, it saves them at around 4mb. Is there a way to control the compression rate with mogrify?

marked as duplicate by Matthew, Phoshi, BinaryMisfit Dec 6 '09 at 14:28

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


Try mogrify -format jpg -quality 90 *.png and the pictures should come out a lot smaller.

The "quality" number is a 0 - 100 integer value where 0 is worst and 100 is best, chances are mogrify defaults to 100 hence the large file sizes. 90 is a good point to start at as it compresses quite well and you'll be able to see almost no difference to the original image. Below around 75 you'll probably start to see artifacts and poor quality, depending on your eyesight and personal aesthetic.

Not the answer you're looking for? Browse other questions tagged or ask your own question.