load_image(filename,
alpha=False,
colorkey=None)
load_image (...) -> Surface
Loads and returns an image.
Tries to load an image from the passed 'filename' argument and
automatically converts it to the display pixel format for faster blit
operations.
The 'alpha' argument will enforce alpha transparency on the image by
invoking Surface.convert_alpha(). If the surface contains alpha
transparency, it will be enabled automatically.
The 'colorkey' argument can be used to add color based transparency
using Surface.set_colorkey().
The following example will load an image using both, alpha
transparency and a colorkey:
load_image ('image.png', True, (255, 0, 0))
-
|