fmw42 wrote:So how does one determine the quality value?
The compression level (the first number in IM) is not a number that you can find out about by looking at the output file, I guess. (But you can list the used setting when creating the file with "-debug coder".)
The filter type (the second number) however can be retrieved from the output. pngout for example will display it.
anthony wrote:Default quality for PNG should probably be 95.
All I'm saying is that the default that ImageMagick currently uses for PNG is 75. And it would be good if these things could be reflected in the documentation.
el_supremo wrote:The debugging seems to be hard coded to do that except that I don't get compression level 9, I always get level 8.
We're talking about different things here. You're referring to these settings that start with "JNG...". Maybe "JNG compression" (8) defines the general compression type (Deflate). I don't know..
But I was talking about the PNG compression level. AFAIK, in JNG the normal image is compressed as JPG and the alpha layer is compressed as PNG (so, lossless). And this compression level from the PNG part is set to 9 when one tries to specify this long 'two quality values' number:
2010-08-02T20:48:47+02:00 0:00.125 0.078u 6.6.3 Coder Magick[1564]: png.c/WriteOnePNGImage/7420/Coder
Compression level: 9
I now think that these long numbers don't work for JNG (at least currently not in the format from the documentation). Everything that's greater than 100 just results in the maximum quality for each part. (One gets the same maximum quality when one specifies a too high quality number with .JPG as output file, for example.) The JPG part gets set to quality 100 (sampling-factor 1x1), and the PNG part gets stored with compression level 9. (It seems that the filter type is 1 then. But I'm not sure about the filter types in JNG, as I don't know if there's a way to extract just the PNG data out of the JNG.. And the debug messages don't show the filter type unless it's filter type 5. And filter type 5 doesn't seem to work in JNG - seems that filter type 0 is used instead of 5..?

)
The quality can be specified for JNG - but on my system, it only works with one (normal) quality number. Of course, the PNG part then uses the same 'quality' number as the JPG part.
And when no quality is specified, the default values from the two parts are used. The debug messages show '0' as JPG quality, but the real value is 92 then, and the PNG part uses the PNG default of 75 (but in JNG, 75 seems to be the same as 70).