mage. The last dimensions are assumed to be image depth,
        height, width, and samples.
    kwargs : dict
        Parameters 'append', 'byteorder', 'bigtiff', 'software', and 'imagej',
        are passed to the TiffWriter class.
        Parameters 'photometric', 'planarconfig', 'resolution', 'compress',
        'colormap', 'tile', 'description', 'datetime', 'metadata', 'contiguous'
        and 'extratags' are passed to the TiffWriter.save function.

    Examples
    --------
    >>> data = numpy.random.rand(2, 5, 3, 301, 219)
    >>> imsave('temp.tif', data, compress=6, metadata={'axes': 'TZCYX'})

    