Linux – Batch Convert PNG to JPG

jpeglinuxpngshell-script

Does anyone know a good way to batch-convert a bunch of PNGs into JPGs in linux? (I'm using Ubuntu).

A png2jpg binary that I could just drop into a shell script would be ideal.

Best Answer

Your best bet would be to use ImageMagick.

I am not an expert in the actual usage, but I know you can pretty much do anything image-related with this!

An example is:

convert image.png image.jpg

which will keep the original as well as creating the converted image.

As for batch conversion, I think you need to use the Mogrify tool which is part of ImageMagick.

Keep in mind that this overwrites the old images.

The command is:

mogrify -format jpg *.png