< index < 5. Image toolkit | ===================================== 5.2 Loading a .bmp or .png image ===================================== |

You can read data from a .bmp or .png file (for example to draw an image using the background color of the console cells).
Note that only 24bits and 32bits PNG files are currently supported.

    C++ : TCODImage::TCODImage(const char *filename)
    C   : TCOD_image_t TCOD_image_load(const char *filename)
    Py  : image_load(filename)

Parameter | Description
--- | ---
filename | Name of the .bmp or .png file to load.

Example :

    C++ : TCODImage *pix = new TCODImage("mypic.bmp");
    C   : TCOD_image_t pix = TCOD_image_load("mypic.bmp");
    Py  : pix = libtcod.image_load("mypic.bmp")