Resize issue with image

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
Juventus
Posts: 2
Joined: 2017-07-18T02:02:32-07:00
Authentication code: 1151

Resize issue with image

Post by Juventus »

When I run the following command:

convert "test.jpg" -resize 532x308 -quality 85 "output.jpg"

As a result I have output.jpg image with size: 531x308: https://gyazo.com/2741f35488d53e02aa6147a0beecf42e


Why it is not pixel perfect, i.e why output image do not have size 532x308? Or I do not understand something?
Thanks
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Resize issue with image

Post by snibgo »

See http://www.imagemagick.org/script/comma ... p#geometry

By default, IM resizes to keep the same aspect ratio. If you want exactly 532x308, use a "!" suffix, eg:

Code: Select all

convert "test.jpg" -resize 532x308! -quality 85 "output.jpg"
Depending on your shell, you may need to escape the "!" or put the resize string in quotes or both.
snibgo's IM pages: im.snibgo.com
Juventus
Posts: 2
Joined: 2017-07-18T02:02:32-07:00
Authentication code: 1151

Re: Resize issue with image

Post by Juventus »

It works perfectly. Thanks!
Post Reply