Re: Convert jpg with quality not properly

Bob Friesenhahn <[email protected]> Mon, 17 Sep 2018 08:42:46 -0500 (CDT)
Newsgroups gmane.comp.video.graphicsmagick.help
Message-ID <[email protected]>
On Mon, 17 Sep 2018, YongdeGe wrote:

> I am comfused about the quality, if the quality not store into Image 
> Structure, why I use GraphicsMagick utils convert jpeg, but get the 
> right quality when checked it. And there is some regulars for the 
> quality when use the binding:
>
> Expect Quality     Real Quality
> 70		   		34
> 80				50
> 88				70
> 90				76
> 91				78
> 92				80
>
> Actually, I try another golang binding for testing, but get the same problem. But, I use ImageMagick to view the verbose, I notice that拢潞Quality: 34 (approximate). As you said before, maybe there is no perperty for the quality.

The JPEG (JFIF) format itself does not store any 'quality' property, 
and in fact this property is an input and invention of the IJG JPEG 
library and not used by other JPEG encoders such as in Photoshop.

When a JPEG file is read, some code in the reader looks at certain 
JPEG encoding tables and estimates the 'quality'.  The estimated 
quality and some other properties are stored as attributes in the 
image.  For example:

   JPEG-Quality: 90
   JPEG-Colorspace: 2
   JPEG-Colorspace-Name: RGB
   JPEG-Sampling-factors: 2x2,1x1,1x1

If one provides the image definition (-define) 
'jpeg:preserve-settings' option then these properties are used to 
re-encode the image when (if) it is again written in JPEG format. 
This only happens if the user has not modified one of the properties 
from the default.

It is likely that modern ImageMagick has made this mode the default 
and I have noticed that it now uses a much higher quality factor than 
the IJG JPEG library default as its default setting.

It would be good if there is something you can do to reduce the size 
of the email messages you are sending to this list since most are 
going into moderation (need to be approved before forwarding) due to 
being a little bit too big.

Bob
-- 
Bob Friesenhahn
[email protected], http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/

_______________________________________________
Graphicsmagick-help mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/graphicsmagick-help