Charles Martin
Charles Martin

Reputation: 87

Convert jpeg from 3-channel sRGB to single-channel gray with imagemagick

I'm invoking the following command to convert an input jpeg that I know is sRGB 3-channel into a single-channel gray image as follows:

convert my-sRGB.jpg -grayscale Rec601Luma my-8bit-gray.jpg

When I run identify on my-8-bit-gray.jpg, it is 8-bit grayscale. But the size is about the same as the input's.

I expected it to be roughly 1/3 of the original size. So, is there an option I need to plug in to make sure the output image is the reduced size?

Thanks, Charles

Upvotes: 1

Views: 715

Answers (1)

Mark Setchell
Mark Setchell

Reputation: 207530

It's hard to say without seeing the files - and StackOverflow strips them down anyway, so I think you'd need to share the originals via Dropbox or Google Drive or similar to have any hope of an answer. It's possible that the expected size reduction is not happening because of some other factor - such as interlace or quality.

The JPEG standard does allow single channel images, see Section 6.1 of the ITU Spec. If you look here, you can see the number of components is encoded in the SOF0/SOF2 field.

Upvotes: 1

Related Questions