python read png file

Solutions on MaxInterview for python read png file by the best coders in the world

showing results for - "python read png file"
Francesco
20 Sep 2017
1# Import OpenCV Library
2import cv2
3
4# Read the PNG Image in BGR format
5img = cv2.imread("<PATH_TO_IMAGE_FILE>.png")
6
7# Print the Shape of image as it is a Numpy Array
8print("Image Shape:", img.shape)