Image Converter

From time to time, I encountered some image files that my installed tools couldn’t open or had trouble with (for example, JASC Paint Shop Pro doesn’t save TGAs with an alpha channel). Googling only reveals that there seems to be an entire market of dubious sites selling trivial software that any hobby developer could recreate in 30 minutes.

This is a free command line utility that converts images between all file formats supported by the FreeImage library. I selected the lot when I compiled FreeImage, here are the formats it says it supports:

bmp, ico, jpg, jif, jpeg, jpe, jng, koa, iff, lbm, mng, pbm, pbm, pcd, pcx, pgm, pgm, png, ppm, ppm, ras, tga, targa, tif, tiff, wap, wbmp, wbm, psd, cut, xbm, xpm, gif, hdr, g3, sgi, exr, j2k, j2c, jp2, pfm, pct, pict, pic, 3fr, arw, bay, bmq, cap, cine, cr2, crw, cs1, dc2, dcr, drf, dsc, dng, erf, fff, ia, iiq, k25, kc2, kdc, mdc, mef, mos, mrw, nef, nrw, orf, pef, ptx, pxn, qtk, raf, raw, rdc, rw2, rwl, rwz, sr2, srf, sti

I’m not sure if FreeImage can write all of those, but it certainly writes all of the popular ones!

Usage

Usage is as follows:

Nuclex.ImageConverter C:\MyArtAssets\*.tga Textures\*.png

This will tell the image converter that you want all TGAs in C:\MyArtAssets converted into PNGs and placed in the Textures subdirectory below your current working directory.

You can use relative or absolute paths for both the source and the target specifications. Converting single images is possible, too, of course. The target format is determined by the file extension.

Download

Nuclex.ImageConverter.7z (4.1 MiB)

Requires .NET 4.0 and the Visual C++ 2010 SP1 Runtime to work! Source code can be compiled in Visual C# 2010 Express SP1.

One thought to “Image Converter”

Leave a Reply

Your email address will not be published. Required fields are marked *

Please copy the string NdwpJC to the field below:

This site uses Akismet to reduce spam. Learn how your comment data is processed.