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 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.