Page 1 of 1

wrong quality setting of result when convert with thumbnail

Posted: 2014-09-23T02:20:17-07:00
by lintianzhi
when i convert a jpg file with thumbnail, the result quality setting resulting to fuzzy image, and if i set quality manually the result looks good.
so, i want to know how to get a suitable quality value when convert?
thanks.

remain is the image i test and how to reproduct it:

file: http://ztest.qiniudn.com/3SG0.jpg
the quality of original file is 22

convert with quality:
result file: http://ztest.qiniudn.com/q.jpg

Code: Select all

~/imagetest » convert 3SG0.jpg -thumbnail 357x -quality 100  q.jpg
~/imagetest » identify -verbose q.jpg| grep Quality
  Quality: 100
convert without quality:
result file: http://ztest.qiniudn.com/nq.jpg

Code: Select all

~/imagetest » convert 3SG0.jpg -thumbnail 357x   nq.jpg
~/imagetest » identify -verbose nq.jpg | grep Quality
  Quality: 22
i have posted it in Users, but i think it is more suitable in Developers, sorry for dup post

Re: wrong quality setting of result when convert with thumbn

Posted: 2014-09-23T09:06:57-07:00
by glennrp
ImageMagick preserves the quality setting if it can. Normally that's appropriate, but when the image is severely downscaled as you have done, the low quality becomes noticeable. The fix is to do what you have done, namely specify a higher quality (90 should be enough; it's half the filesize and visually indistinguishable to me).

Re: wrong quality setting of result when convert with thumbn

Posted: 2014-09-24T23:48:10-07:00
by lintianzhi
glennrp wrote:ImageMagick preserves the quality setting if it can. Normally that's appropriate, but when the image is severely downscaled as you have done, the low quality becomes noticeable. The fix is to do what you have done, namely specify a higher quality (90 should be enough; it's half the filesize and visually indistinguishable to me).
I use a larger quality value, and let the value in the range [origin, origin*sqrt(original_size/result_size)] when the image is downscaled. For my program call convert not myself and i want get more smaller images as it can. thank you.