Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
Free command line image converter

I need a command line tool for windows which can be used to convert an image from any common format to 24 bit bitmap. I'm writing some programs to do image manipulation in C, but I don't really want to write a ton of code to read images in multitudes of formats. I use bitmap format a lot for both reading and writing because it's pretty straight forward. I don't really want to convert all of the images by opening in paint and saving in the desired format.

share|improve this question

marked as duplicate by EBGreen, Canadian Luke, slhck Oct 15 '12 at 19:29

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.

up vote 9 down vote accepted

ImageMagick can do format conversions with a tool that comes with it called convert. You can find binaries for it here.

You'll want to run something like this on Windows:

for %%f in (*.jpg) do (
       convert "%%~nf.jpg" -type truecolor "%%~nf.bmp"

Or in Bash:

for f in *.jpg; do convert "$f" -type truecolor "${f%.*}.bmp"; done

Convert picks the format automatically from the extension and -type truecolor makes sure you are converting to 24-bit.

share|improve this answer
Thanks for the extra details. – Big Endian Oct 15 '12 at 18:53
What shell is your syntax for? – UtahJarhead Oct 15 '12 at 19:06
It doesn't look like bash, so here's the above in bash: for f in *.jpg; do convert "$f" -type truecolor "${f%.*}.bmp"; done – UtahJarhead Oct 15 '12 at 19:08
The posted code is MS batch. – EBGreen Oct 15 '12 at 19:15
It should work as a windows batch script, since that's what Big Endian is running. It is however, untested, as I do not have a windows installation. – zmode Oct 15 '12 at 19:16

Try Convert. It can do a lot.

share|improve this answer
Yeah, that's what I'm looking for. 8 minutes before I can accept answer. – Big Endian Oct 15 '12 at 18:48
zmode gave more specific details, so I'm accepting his answer. Thanks! – Big Endian Oct 15 '12 at 18:52
@galuano1 : Your link is dead. – user2284570 Feb 5 '15 at 18:24
@user2284570 Updated the link. – galuano1 Feb 6 '15 at 3:47
FWIW, convert is part of the core ImageMagick suite of tools. – JakeGould Feb 6 '15 at 4:09

Not the answer you're looking for? Browse other questions tagged .