]) is an open-source light weight image input/output library that can read, write, and
manipulate image files in just a few lines of code. It can be used to load textures of formats PNG, JPEG, PCX, BMP, TGA, and GIF and output as PNG and TGA files. It well integrates with C and OpenGL.
Here is a code snippet which can be used to load textures:
unsigned int *tTexture;
Image *image = OpenImage(filename,PF_DONTCARE,FF_AUTODETECT);
if(image == NULL)
int imWidth = image->getWidth(); int imHeight = image->getHeight();
glGenTextures(1,&tTexture[ID]); glBindTexture(GL_TEXTURE_2D,tTexture[ID]); gluBuild2DMipmaps(GL_TEXTURE_2D,GL_RGB,imWidth,imHeight,GL_RGB,GL_UNSIGNED_BYTE,image->getPixels());