Currently, I try to create *.tga image for a single colour image which matches to the GIMP generated TGA image file. Tries several algorithms but I couldn't get exact output. Is there any standard library which I can use?


The company I work for has a C/C++ library for Windows that supports many image formats, including TGA RLE. Although it’s not open source, there’s a fully-working free evaluation you can try and see if the output files match what you’re looking for.

The C++ code to save a TARGA RLE file looks like this:

L_LoadBitmap("G:\\test\\input.bmp", &bmp, sizeof bmp, 0, ORDER_BGRORGRAY, NULL, NULL);
L_SaveBitmap("G:\\test\\output.tga", &bmp, FILE_TGA_RLE, bmp.BitsPerPixel, 0, NULL);

You can obtain the evaluation from this page.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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