MacOS: How to convert BMP files to JPEG or PNG format (command line)

Mac BMP image FAQ: How can I convert BMP image files to the JPEG format?

If you have just one BMP file you need to convert, or just a few, you can convert BMP images to JPEG using Preview. However, if you have a lot of BMP images, and want to convert them all to JPEG or PNG format, you'll probably want to look at a Mac command-line tool like ImageMagick. (Unfortunately my Mac batch image conversion tutorial using the Mac Automator doesn't work on BMP files.)

Convert BMP images to JPEG or PNG

Warning: Before proceeding, please make a backup of your image files. The commands about to be shown are powerful, meaning you can do a lot of great things with them, or possibly some bad things. So, backup your image files.

Using ImageMagick you can convert one BMP image to the JPEG format with one simple command like this:

mogrify -format jpg sample.bmp

If you want to convert that same BMP image to PNG format, use this command instead, substituting 'png' for 'jpg':

mogrify -format png sample.bmp

Now, if you want to convert ALL BMP images in the current directory to JPEG format, use this command, noting the use of the wildcard character in the '*.bmp' specification:

mogrify -format jpg *.bmp

If you want to resize your BMP image you may want to use the ImageMagick convert command, like this:

convert test.bmp -resize 1024x768 test.jpeg

(This example was taken from the ImageMagick website.)

Installing ImageMagick on Mac OS X

If you're comfortable with the Mac Unix command line, you can install ImageMagick on a Mac OS X system as described on this page using MacPorts. (Scroll down to the area on that page that refers to Mac OS X.)

Alternatively, if you need more information on this process I can write more about it, but until then, I hope this tutorial on how to convert BMP images to JPEG or PNG image formats has been helpful.