1import cv2
2
3# Reading color image as grayscale
4gray = cv2.imread("color-img.png",0)
5
6# Showing grayscale image
7cv2.imshow("Grayscale Image", gray)
8
9# waiting for key event
10cv2.waitKey(0)
11
12# destroying all windows
13cv2.destroyAllWindows()