Better way to get JPG quality than Identify -Verbose?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
Tom2112
Posts: 4
Joined: 2017-12-07T07:45:23-07:00
Authentication code: 1152

Better way to get JPG quality than Identify -Verbose?

Post by Tom2112 »

Hello Everyone,

I'm working with a large image library, approx. 1.7 million images. They are almost entirely in jpeg format, though the quality settings used to save them vary. I know I can check (or estimate) the quality setting of a jpg file by using image magick with the identify and -verbose switches. That gives me way more information than I need. Is there a way to just get the quality numbers?

I'm planning to write a script to go through the images and mogrify the images that have a quality higher than 85 down to 85. This should save me a large amount of storage space without sacrificing much in noticeable quality.

Thanks in advance,
Tom

BTW, I'm using the latest version of image magick (v7.0.8-28 Q16) on Windows 10. And the command I was using to get the quality numbers was 'magick identify -verbose myfile.jpg'
Last edited by Tom2112 on 2019-02-20T07:19:34-07:00, edited 1 time in total.
Tom2112
Posts: 4
Joined: 2017-12-07T07:45:23-07:00
Authentication code: 1152

Re: Identify -Verbose Options?

Post by Tom2112 »

I think I found an answer. So I'll post it for anyone trying to do something similar.

magick identify -format %Q myfile.jpg

will return just the quality number, and it is much faster than trying something with -verbose and attempting to pull the quality number out of the pipe.
Post Reply