I am trying to read a png image in python. The imread function in scipy is being deprecated and they recommend using imageio library.
However, I am would rather restrict my usage of external libraries to scipy, numpy and matplotlib libraries. Thus, using imageio or scikit image is not a good option for me.
Are there any methods in python or scipy, numpy or matplotlib to read images, which are not being deprecated?
With matplotlib you can use (as shown in the matplotlib documentation)
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
img=mpimg.imread('image_name.png')
And plot the image if you want
imgplot = plt.imshow(img)
import matplotlib.pyplot as plt
image = plt.imread('images/my_image4.jpg')
plt.imshow(image)
Using 'matplotlib.pyplot.imread' is recommended by warning messages in jupyter.