Image Quality in Imagemagick

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Locked
Ganesha
Posts: 23
Joined: 2014-05-20T06:40:01-07:00
Authentication code: 6789

Image Quality in Imagemagick

Post by Ganesha »

I use a jar http://www.java2s.com/Code/Jar/j/Downlo ... 085jar.htm for resizing images like jpeg,png. This jar gives a good quality of image after resize which I feel better than that of imagemagick's command

Code: Select all

convert test.jpg -resize WxH> testresize.jpg
Is there any other way of resizing image to produce the same quality of the jar using convert command?

User avatar
GeeMack
Posts: 757
Joined: 2015-12-01T22:09:46-07:00
Authentication code: 1151
Location: Central Illinois, USA

Re: Image Quality in Imagemagick

Post by GeeMack »

Ganesha wrote:

Code: Select all

convert test.jpg -resize WxH> testresize.jpg
Is there any other way of resizing image to produce the same quality of the jar using convert command?
Maybe try this...

Code: Select all

convert test.jpg -resize WxH> -quality 100 testresize.jpg

Ganesha
Posts: 23
Joined: 2014-05-20T06:40:01-07:00
Authentication code: 6789

Re: Image Quality in Imagemagick

Post by Ganesha »

On doing so, what filter it uses?

Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Image Quality in Imagemagick

Post by Bonzo »

I think the standard filter is Lanczos; see: http://www.imagemagick.org/script/comma ... php#filter

snibgo
Posts: 13034
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Image Quality in Imagemagick

Post by snibgo »

I wouldn't use JPEG as output to compare resizing from two different systems.

Perhaps you can show us an example input and output where you think the java version is better.
snibgo's IM pages: im.snibgo.com

User avatar
fmw42
Posts: 26383
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Image Quality in Imagemagick

Post by fmw42 »

Lots of different resizing techniques depending upon upscale vs downscale and subject matter. See
http://www.imagemagick.org/Usage/filter/
http://www.imagemagick.org/Usage/filter/nicolas/

mikmach
Posts: 44
Joined: 2015-02-06T07:50:43-07:00
Authentication code: 6789

Re: Image Quality in Imagemagick

Post by mikmach »

By default IM jpeg -quality is somewhere between 75 and 85. Try passing 90 or 95 (100 is overkill in most cases). Also to improve look of files with sharp edges don't forget about '-sampling-factor 1x1'.

User avatar
fmw42
Posts: 26383
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Image Quality in Imagemagick

Post by fmw42 »

IM jpeg default quality is to match the input if the input quality is given or if not use 92. See http://www.imagemagick.org/script/comma ... hp#quality

Locked