imageio.v2.mimread#

imageio.v2.mimread(uri, format=None, memtest='256MB', **kwargs)[source]#

Reads multiple images from the specified file. Returns a list of numpy arrays, each with a dict of meta data at its ‘meta’ attribute.

Parameters:
uri{str, pathlib.Path, bytes, file}

The resource to load the images from, e.g. a filename,pathlib.Path, http address or file object, see the docs for more info.

formatstr

The format to use to read the file. By default imageio selects the appropriate for you based on the filename and its contents.

memtest{bool, int, float, str}

If truthy, this function will raise an error if the resulting list of images consumes greater than the amount of memory specified. This is to protect the system from using so much memory that it needs to resort to swapping, and thereby stall the computer. E.g. mimread('hunger_games.avi').

If the argument is a number, that will be used as the threshold number of bytes.

If the argument is a string, it will be interpreted as a number of bytes with SI/IEC prefixed units (e.g. ‘1kB’, ‘250MiB’, ‘80.3YB’).

  • Units are case sensitive

  • k, M etc. represent a 1000-fold change, where Ki, Mi etc. represent 1024-fold

  • The “B” is optional, but if present, must be capitalised

If the argument is True, the default will be used, for compatibility reasons.

Default: ‘256MB’

kwargs

Further keyword arguments are passed to the reader. See help() to see what arguments are available for a particular format.