< index < 5. Image toolkit | ===================================== 5.11 Saving an image to a .bmp or .png file ===================================== |

You can save an image to a 24 bits .bmp or .png file.

    C++ : void TCODImage::save(const char *filename)
    C   : void TCOD_image_save(TCOD_image_t image, const char *filename)
    Py  : image_save(image, filename)

Parameter | Description
--- | ---
image | In the C version, the image handler, obtained with any image creation function.
filename | Name of the .bmp or .png file.

Example :

    C++ : TCODImage *pix = new TCODImage(10,10);
          pix->save("mypic.bmp");
    C   : TCOD_image_t pix = TCOD_image_from_console(my_offscreen_console);
          TCOD_image_save(pix,"mypic.bmp");
    Py  : pix = libtcod.image_from_console(my_offscreen_console)
          libtcod.image_save(pix,"mypic.bmp")