Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a C++ library that enables reading of .tga and .blp image formats on Windows?

share|improve this question
up vote 1 down vote accepted

For BLPs, you may check this source code example.

For TGAs, honestly I would just convert them to eg. PNGs offline, and then use plain GDI+ to load the PNGs. Is there a specific reason for using TGA? Anyway, you can use this full, annotated source code.

share|improve this answer
I have heard TGAs are more compact than PNGs. – Oskar Jul 10 '12 at 9:36
@Oskar this is almost never the case; TGAs are usually not compressed, and when they are they use RLE compression which is one of the most naive forms of compression. On the other hand, the PNG standard allows for many different optimisation and compression schemes that have made it the preferred lossless image format for the web and virtually any other application. – sam hocevar Jul 10 '12 at 16:10
Thanks, I thought that .blp was more complex. I will se what can I dow with .tga. – user629926 Jul 10 '12 at 21:58

For Targa (.tga) files, the FreeImage library may be useful.

share|improve this answer

I recommend using SOIL. I found it to be by far the easiest way of loading and saving texture to and from OpenGL. The last update was in 2008, though. It still works fine, but some people like to steer away from "old" software.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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