pygame   documentation
||  Home  ||  Help Contents  ||
 
|| pygame || cdrom || constants || cursor || display || draw ||
|| event || font || image || joystick || key || mixer ||
|| mixer_music || mouse || movie || sndarray || surfarray || time ||
|| transform ||
 
|| CD || Channel || Clock || Font || Joystick || Movie ||
|| Overlay || Rect || Sound || Surface ||
 
|| color || cursors || sprite ||

pygame.image

This module contains functions to transfer images in and out of Surfaces. At the minimum the included load() function will support BMP files. If SDL_image is properly installed when pygame is installed, it will support all the formats included with SDL_image. You can call the get_extended() function to test if the SDL_image support is available.
 
Some functions that communicate with other libraries will require that those libraries are properly installed. For example, the save() function can only save OPENGL surfaces if pyopengl is available.
frombuffer - create a surface from a python memory buffer
fromstring - create a surface from a raw string buffer
get_extended - returns true if SDL_image formats are available
load - load an image to a new Surface
save - save surface data
tostring - create a raw string buffer of the surface data

frombuffer
pygame.image.frombuffer(string, size, format) -> Surface

 
fromstring
pygame.image.fromstring(string, size, format, flipped=0) -> Surface

 
get_extended
pygame.image.get_extended() -> int
 
load
pygame.image.load(file, [namehint]) -> Surface

 
save
pygame.image.save(Surface, file) -> None
 
tostring
pygame.image.tostring(Surface, format, flipped=0) -> string