I am trying to read a png
image in python. The imread
function in scipy
is being deprecated and they recommend using imageio
I read all answers but I think one of the best method is using openCV library.
import cv2
img = cv2.imread('your_image.png',0)
and for displaying the image, use the following code :
from matplotlib import pyplot as plt
plt.imshow(img, cmap = 'gray', interpolation = 'bicubic')
plt.xticks([]), plt.yticks([]) # to hide tick values on X and Y axis
plt.show()