Skip to content
Switch branches/tags
Go to file

Latest commit

libtiff-4.3.0 deprecates the use of int8, uint8, int16, uint16, int32,
uint32, int64, uint64 typedefs. Our only use of them was 'uint32' with
TIFFReadRGBAImageOriented(): Just replace uint32 with SDL's own Uint32
and it compiles without any warnings.

Git stats


Failed to load latest commit information.
Latest commit message
Commit time
Jul 13, 2007
SDL_image 2.0

The latest version of this library is available from:

This is a simple library to load images of various formats as SDL surfaces.
This library supports BMP, PNM (PPM/PGM/PBM), XPM, LBM, PCX, GIF, JPEG, PNG,
TGA, TIFF, and simple SVG formats.

#include "SDL_image.h"

	SDL_Surface *IMG_Load(const char *file);
	SDL_Surface *IMG_Load_RW(SDL_RWops *src, int freesrc);
	SDL_Surface *IMG_LoadTyped_RW(SDL_RWops *src, int freesrc, char *type);

where type is a string specifying the format (i.e. "PNG" or "pcx").
Note that IMG_Load_RW cannot load TGA images.

To create a surface from an XPM image included in C source, use:

	SDL_Surface *IMG_ReadXPMFromArray(char **xpm);

An example program 'showimage' is included, with source in showimage.c

JPEG support requires the JPEG library:
PNG support requires the PNG library:
    and the Zlib library:
TIFF support requires the TIFF library:
    and the Zlib library:

If you have these libraries installed in non-standard places, you can
try adding those paths to the configure script, e.g.
sh ./configure CPPFLAGS="-I/somewhere/include" LDFLAGS="-L/somewhere/lib"
If this works, you may need to add /somewhere/lib to your LD_LIBRARY_PATH
so shared library loading works correctly.

This library is under the zlib License, see the file "LICENSE.txt" for details.