Maintaining images

You can only load/save BMP files unless SDL_Image library is present in system.
JPG
PNG
GIF (non animated)
BMP
PCX
TGA (uncompressed)
TIF
LBM (and PBM)
PBM (and PGM, PPM)
XPM

You can save to the following formats.
BMP
TGA
PNG
JPEG

PNG, JPEG saving new in pygame 1.8.

pygame.image.load

pygame.image.load(filename) load(fileobj, namehint="") load image from file or file-like python object and return Surface that contain it.

You should use os.path.join() for compatibility.
eg. asurf = pygame.image.load(os.path.join('data', 'bla.png'))
+++++pygame.image.save
pygame.image.save(Surface, filename)
Saves surface to file.

pygame.image.get_extended

To test if extensions are available use pygame.image.get_extended()

pygame.image.tostring

To transfre image into string use:
pygame.image.tostring(Surface, format, flipped=False)

RGB, 24bit image
RGBX, 32bit image with unused space
RGBA, 32bit image with an alpha channel
ARGB, 32bit image with alpha channel first
RGBA_PREMULT, 32bit image with colors scaled by alpha channel
ARGB_PREMULT, 32bit image with colors scaled by alpha channel, alpha channel first
+++++pygame.image.fromstring
pygame.image.fromstring(string) will return Surface created from given string.

pygame.image.frombuffer

If want multiple images from one string use:
pygame.image.frombuffer(string, size, format): return Surface