Image Libraries

From OpenGL Wiki
Revision as of 11:42, 19 November 2020 by Sailor (talk | contribs)
Jump to navigation Jump to 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.
  • lodepng: Very small library for loading PNG files without any dependencies.
  • libpng: The official library for loading PNG files. It is very widely used. Many other libraries use this to handle PNG.
  • libspng: An alternative to libpng with a simple C API.
  • 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: Jan 11, 2014

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: November 1, 2020

SAIL (Squirrel Abstract Image Library) is a fast C/C++ image decoding library providing simple yet powerful APIs, from one-liners to complex use cases with custom I/O sources.

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

Supported image formats: APNG, PNG, JPEG, GIF, TIFF. Work to add more image formats is ongoing.

Supported platforms: Windows, macOS, Linux.

It is released under the MIT license.


Last Update: January 1, 2017

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 23, 2014

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.


Last Update: March 28, 2014

GLraw is an utility that converts Qt-supported images into various OpenGL-compatible raw formats. glraw reduces the process of loading textures at run-time to a minimum: A file-content dump into GPU memory.

Image to OpenGL texture conversion can be done either by glraw's command line interface, e.g., within an existing tool-chain, or at run-time with glraw linked as asset library (requires linking Qt). For loading image files, just source copy the minimal Raw-File reader or integrate the dependency free, C++ loader library.

It is licensed under the MIT 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.