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.