display a png file in python code example
Example 1: python show png
%pylab inline
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
img = mpimg.imread('your_image.png')
imgplot = plt.imshow(img)
plt.show()
Example 2: python read png file
# Import OpenCV Library
import cv2
# Read the PNG Image in BGR format
img = cv2.imread("<PATH_TO_IMAGE_FILE>.png")
# Print the Shape of image as it is a Numpy Array
print("Image Shape:", img.shape)