Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

add comment

2 Answers

up vote 7 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
add comment

Try Convert. It can do a lot.

share|improve this answer
1  
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
add comment

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