imageio.v2.imread(uri, format=None, **kwargs)[source]#

Reads an image from the specified file. Returns a numpy array, which comes with a dict of meta data at its ‘meta’ attribute.

Note that the image data is returned as-is, and may not always have a dtype of uint8 (and thus may differ from what e.g. PIL returns).

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

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


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


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