import cv2
image = cv2.imread('foo.jpg')
print(image.shape)
gray_image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
print(gray_image.shape)
cv2.imwrite('gray.jpg', gray_image)
In OpenCV (Python), why am I getting 3 channel images from a grayscale image?