why does my grayscaled image have a larger size than the color image

Viewed 1682

image in question : http://cdn1.ouchpress.com/media/celebrities/539/kate-upton-401846.jpg

I'm trying to convert the image to grayscale using the below command

img = cv2.imread('kate.jpg',cv2.IMREAD_GRAYSCALE)

cv2.imwrite('kategray.jpg',img)

however the grayscaled image is of size 700kB whereas the color image is only 500kB.

What am i missing ? Since the color information is removed and the alpha channel is removed.

Shouldn't the image have a smaller size ?

3 Answers

Give a try, I have tested this with python 3.7

import cv2
img = cv2.imread('d:/1.jpg', cv2.IMREAD_GRAYSCALE | cv2.IMREAD_REDUCED_GRAYSCALE_2)
cv2.imwrite('d:/test1.jpg', img)
Related