Page 1 of 1

can't estimate the jpeg quality

Posted: 2019-12-11T22:01:41-07:00
by sihafupi
I've noticed that imagemagick can't estimate the jpeg quality from a camera that I have.
Quality 0-30 works fine, but as soon as I go above 30, I get nothing from imagemagick

Code: Select all

$ identify -verbose image30.jpg | grep -i quality
  Quality: 53
$ identify -verbose image32.jpg | grep -i quality
It seems to be caused by this line: ... peg.c#L940
i doesn't reach 50. I tried Version: ImageMagick 6.9.7-4 as well as ImageMagick-7.0.8-35
Can someone help me understand what's going on here? Thanks ;)

Re: can't estimate the jpeg quality

Posted: 2019-12-11T22:16:32-07:00
by fmw42
Is it your camera? Does exiftool display the correct quality? Post links to your images so the developers can test with them

Re: can't estimate the jpeg quality

Posted: 2019-12-16T08:53:33-07:00
by whugemann
The JPEG quality was not defined by the original JPEG standard. It was introduced only later by the Independent JPEG Group's code (IJG), setting the quality of the DQTs in the original JPEG standard to 50% and providing a scaling algorithm for the matrix elements.

Thus the JPEG quality can only be really estimated for JPEG images that stem from programs that use (or follow) IJG code for JPEG compression. For any other source, i.e. phot cameras, it's just a rough guess. IM uses the IJG DQTs.

IM's code is rather simple, summing the matrix elements up and comparing the result to the sums that would follow from the IJG code. If your camera uses some kind of scaling for the matrix elements, IM's guess will fail.

If you provide your original photographs, I could give a more detailed analysis by the use of JPEGsnoop.