It looks like not many users are aware that they can convert image files of different formats (RAW, BMP, GIF, PNG, JPEG, TIFF, etc.) to other formats by using our applications via the CMD.EXE command line. Almost everybody is satisfied with this simple and familiar method: Run an application, drag and drop selected files or folders onto its window, and then click the “Convert” button. That’s all, the job is done!
But if you need to automate the file conversion process, convert files on schedule, or use graphic converters with your own scripts or apps, the ability to run programs with specific parameters from the CMD.EXE command line (also known as “console”, “prompt” or “shell”) becomes an indispensable tool for an experienced user. I’ll tell you about our applications’ brand-new, flexible, and powerful CLI (command-line interface) syntax by using a few examples.
It should be noted that we’ve implemented command line support in our software relatively long ago. Actually, initially only very basic functionality was supported. But with the recent release, everything has changed very much for the better. We have fully redesigned the old CLI syntax. As a result, now almost all file-conversion features and parameters are available if you execute our applications using the command line.
By the way, you can find a special, console-based application, with the “cmd” suffix in the filename (for example, png2jpgcmd.exe), in the distribution package and in the installation folder (usually “C:\Program Files\Easy2Convert Software\XXX to XXX\”) of our software. When you automate the file conversion process or call our app from external scripts, we recommend using this console-based application.
Enough about technical stuff, let’s take a look at the new command-line syntax’s core features using some real use cases. Launch the CMD.EXE console (I’m using Windows 7, but you can also use Windows XP, Vista, or 8).
How to convert BMP to JPG in CMD.EXE?
Suppose you have a BMP file named picture.bmp, which you need to convert to the JPEG format. Go to the folder with BMP to JPG installed, and execute the following command:
bmp2jpg.exe -i c:\tmp\picture.bmp -o d:\converted\ -c jpg
The result: The original BMP file was converted to the JPEG format, and the new JPEG file was saved to the D:\converted\ folder.
How to convert a whole Kodak Photo CD to TIFF in CMD.EXE?
Surely many photographers and graphic designers keep a few old Photo CDs somewhere in their garage or basement. As far as I remember, Kodak Photo CDs were very popular some twenty years ago. It’s understandable that people would like to convert all these old photo collections to a more up-to-date image format, such as TIFF. You can do that easily by executing just one command in the command line:
pcd2tiffpro.exe -i d:\ -o c:\photocd\ -c tiff
The result: Our application scanned the whole Kodak Photo CD in the D:\ DVD drive, converted all found PCD files to the TIFF format, and saved the new TIFF files to the C:\photocd\ folder.
How to save all frames from GIF animations to PNG?
Our GIF converters let you easily extract all frames from animated GIF files and save these frames to a different image format, such as PNG. So let’s complicate the task a little bit. Suppose you need to process all GIF files in different folders on different disks, and do it all at once, using only one command in CMD.EXE.
That’s quite possible, though you need to do some preparations. Create a list of files and folders, and save it as a text file named list.txt:
c:\tmp\sun.gif c:\tmp\moon.gif d:\universe.gif d:\images\anim01.gif d:\images\anim02.gif e:\gfx\ e:\mygifs\ d:\galaxy3.gif d:\galaxy4.gif
Now call our application from the command line:
gif2image.exe -i c:\list.txt -o d:\converted\ -c png
The result: All GIF files from the list were converted to the PNG format, and all frames were extracted from animated GIF files and saved to the D:\converted\ folder.
How to resize a PSD image and save the result to BMP in CMD.EXE?
Suppose that in addition to converting an image file from one format to another, you also need to resize the image to 600×400 px, and to flip it horizontally. The result must be an 8-bit BMP file with RLE compression. To do this conversion, use additional options:
psd2image.exe -i c:\design.psd -o d:\tmp\ -c bmp --width=600 --height=400 --flip-horizontal --bmp-bpp=8 --bmp-compression=rle
The result: The Adobe Photoshop PSD image was resized to 600×400 px, flipped horizontally, and saved as an 8-bit BMP file with RLE compression in the D:\tmp\ folder.
How to batch-convert all RAW files on a USB flash drive to JPEG in CMD.EXE?
This use case will probably catch the interest of photographers. First remove the flash drive from the camera, and copy/sync the RAW files to a folder on your computer. Now you need to batch-convert all RAW (CRW, CR2, DCR, NEF, RAF, etc.) files to an image format suitable for the Web, such as JPEG with the best quality. You also need to resize the images to 800×600 px, and to increase their brightness and contrast.
raw2jpgpro.exe -i d:\raw\ -o c:\jpeg\ -c jpg --width=800 --height=600 --brightness=30 --contrast=20 --jpg-quality=100
The result: All RAW images were resized to 800×600 px, and their brightness and contrast were increased; the files were converted to JPEG with the best quality and saved to the C:\jpeg\ folder.
Hopefully, these examples of using our converters via the CMD.EXE command line will come in handy. To find a complete list of supported command-line options and more examples, please refer to the user documentation included in our software.
If I’m invoking bmp2jpg.exe via cmd it flashes and disappears right away. The original bmp files have been converted though…
Your stuffs excellent. Thanx for sharing!
You share interesting things here.
thanks, it works!
Hello, I was able to convert all my gif images with your advice automatically! That’s right AUTOMATICALLY, just sit and watch, thanks a lot!
Wow, pretty interesting for me. Haven’t used cmd.exe yet.
What’s the “-c” switch for? I didn’t find its description in documentation.
You share interesting things here.
that’s interesting, thanks for sharing.
I must confess CMD usage dramatically increased my productivity. Not only image conversion, but other repetitive tasks I have to do.
Hi, my name is Sherry. I was just looking at your software and see that your tools have the potential to grow. The majority of designers like me are looking for good graphical tools you have. You can achieve these things only if you continue to improve your software. And the graphical user interface is a good starting point.
Excellent content you got here!
Yep, CMD can save a lot of manual work…
I saw this article on other website. It had identical meaning but in a completely different words.
Hello Easy2Convert, your apps are incredible I know it. Very useful tools for every designer.
I came to your blog and noticed you could have a lot more hits. I have found that the key to running a website is making sure the visitors you are getting are interested in your niche.
A motivating discussion is definitely worth comment. I believe that you should write more about this cmd.exe issue. To the next! All the best!
Hi. Keep up the good work and say hi to everyone down there. The command line interface looks fantastic. You’ve done well. Good luck.
Thanks Chris, many sleepless nights went into this.
Nice information on the CMD topic, been wanting to get one of these, but didn’t knew if it really performed well.
This came at the right time when I was looking for how to use command-line with my converter. Thank you for sharing this.
have you given any thought at all with converting your main webpage into french? i know a couple of of translaters here that will would help you do it for no cost if you want to contact me personally.
Nice work. I remember that woman at the conference asking about this matter…
really appreciate you sharing this CMD tutor post. much thanks again. want more.
Nevertheless I like your blog. I might need to use a normal web browser just to enjoy it.
Beautiful. It is a truly special experience here and be part of the community experience.
You should share more useful tips like this. These type of articles are the most valuable. I know writing content is hard work, but the effort is much appreciated by the users, the info helped me to save a lot of time, thanks!
Appreciating the hard work you put into your blog and detailed information you offer. It’s good to come across a blog every once in a while that isn’t the same outdated rehashed material. Excellent read! I’ve saved your site and I’m adding your RSS feeds to my Google account.
Excellent.. Wonderful.. Please more posts like this (about command-line and software automation)!
Hello there I am so grateful I found your blog, I really found you by mistake, while I was researching on Askjeeve for something else, Anyhow I am here now and would just like to say thanks for this CMD post, I don’t have time to read it all at the moment but I have saved it and also included your RSS feeds, so when I have time I will be back to read a lot more, Please do keep up the great work.
I just found your website on second page of serach engine, your post about cmd.exe is very interesting, exaclty what I was looking for.
I just want to tell you that I’ll definitely bookmark your post. You surely have a good article about the command-line using for converting images. Thanks for revealing the info.
Thanks a lot.
There are some interesting points this article. Good info about cmd invoking, thanks and we want more! Added to FeedBurner as well…
Thanks for improving my knowledge about CMD.
Hi I am so thrilled I found your blog, I really found you by accident, while I was researching on Google for something else. Please do keep up the excellent work.
Fantastic post however I was wondering if you could write a little
more on this topic? I’d be very thankful if you could
provide some more examples how to use cmd. Cheers!