matplotlib.pyplot.imread(fname, format=None)[source]
Parameters: fnamestr or file-likeThe image file to read: a filename, a URL or a file-like object opened in read-binary mode. formatstr, optionalThe image file format assumed for reading the data. If not given, the format is deduced from the filename. If nothing can be deduced, PNG is tried. numpy.arrayThe image data. The returned array has shape (M, N) for grayscale images. (M, N, 3) for RGB images. (M, N, 4) for RGBA images.