sdl2.sdlimage - Python bindings for SDL_image¶
py-sdl2 provides bindings for SDL2_image, a library designed for use with SDL2
that adds support for loading a wide range of different common (and uncommon)
image formats for easy use with SDL2. In addition, SDL2_image includes functions
SDL_Surface objects to PNG and/or JPEG images.
Table Of Contents
If using an alternative rendering system that doesn’t use SDL surfaces as input (e.g. PyOpenGL), the Pillow imaging library may be a better fit for your project.
Returns the most recently encountered SDL2 error message, if any.
This function is a simple wrapper around
Retuns: A UTF-8 encoded string describing the most recent SDL2 error. Return type: bytes
These functions are used to check whether an SDL file object
SDL_RWops) is a valid image file of a given format. Note that
all of these functions will return 0 if SDL2_image was not built with
support for that format, even if it is a valid image of that type, so be
cautious when using these for formats like WEBP, JPEG, PNG, and TIFF, which
are optional when building SDL2_image.
Latest SDL2_image library major number supported by PySDL2.
Latest SDL2_image library minor number supported by PySDL2.
Latest SDL2_image library patch level number supported by PySDL2.
IMG_Init()flag to enable support for the JPEG image format.
IMG_Init()flag to enable support for the PNG image format.
IMG_Init()flag to enable support for the TIFF image format.
IMG_Init()flag to enable support for the WEBP image format.