How to convert all files (in different formats) in given folder to different file type

Tal Galili picture Tal Galili · Mar 9, 2013 · Viewed 38.4k times · Source

I have a folder with many images from different types (png, jpg, jpeg, bmp, pdf), and I would like to convert them all into png (for instance) using imagemagick.

Is there a single command which can perform this? If not, what should I do instead?

Thanks.

Answer

nwellnhof picture nwellnhof · Mar 10, 2013

Try the mogrify command:

mogrify -format png *.*

But be careful. Without the -format option, mogrify overwrites the original images. Make sure to read the documentation.