Image Libraries

Jump to: navigation, search

Loading images from files is outside the scope of the OpenGL specification. It is handled by user-made code or one of the image handling libraries below.

Single format libraries

Note: These libraries only load the image data into memory. With the exception of libktx, they neither know nor care about loading it into OpenGL Textures.
  • libpng: The official library for loading PNG files. It is very widely used. Many other libraries use this to handle PNG.
  • libjpg: A library for loading JPEG (or JPG) files. As with libpng, other libraries use libjpg to handle JPEG.
  • libktx: Library for the KTX file format. The KTX format is closely related to OpenGL, but not used by most tools. LibKTL also has functions to take a loaded KTX image and convert it into an OpenGL texture.

Multi format libraries


Last Update: July 7, 2008

SOIL (Simple OpenGL Image Loader) is a public-domain cross-platform image loader that's extremely small. It can read a small variety of useful formats (BMP, JPEG, PNG, various DDS files, etc).

It does have functions to load images into OpenGL textures. Indeed, it only allows this (which is why it is "simple").

It is public domain software.

OpenGL Image

Last Update: April 05, 2011

GLI (OpenGL Image) is a small cross-platform C++ image library able to load DDS textures (DDS9 and DDS10), compressed or uncompressed.

It is licensed under the MIT license.

Unofficial OpenGL SDK

Last Update: August 10, 2012

Unofficial OpenGL SDK has an image loading component called GL Image. This is a C++ library for loading images. It currently supports DDS9 textures (and compression), PNG, JPEG, TGA, BMP, and GIF formats.

It has functions to load images into OpenGL textures, either user-created ones or ones created by the system itself. It supports creating immutable storage for textures as well as those with mutable storage. It even supports direct state access, to minimize state changes when creating them.

It is licensed under the MIT license.


Last Update: March 8, 2009

DevIL stands for Developers Image Library (it once was called "OpenIL", but that was trademarked, so they had to change it). It supports many image formats for reading and writing, it supports several compilers and OS (Win, Linux, Mac OSX). The library has a OpenGL-like syntax.

It does have functions to load images directly (more or less) into OpenGL textures, though these are part of "ilut" and not "il" proper.

DevIL uses the LGPL license, version 2.1.


Last Update: March 17, 2012

FreeImage is an cross-platform image-loading library, with very wide support for image formats (including some HDR formats like OpenEXR).

It does not have functions to load images directly into OpenGL textures.

It is released under multiple licenses, GPL 2 and 3, as well as their own FreeImage Public License.


DO NOT USE THIS! This is a very old library that should not be used anymore. Most people who encounter GLAUX are people who see the NeHe tutorials which haven't been updated in years. NeHe uses auxDIBImageLoad() in order to read BMP files. GLAUX is no longer available.