Page 1 of 1

Resize issue with image

Posted: 2017-07-18T02:07:48-07:00
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

Re: Resize issue with image

Posted: 2017-07-18T05:47:28-07:00
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.

Re: Resize issue with image

Posted: 2017-07-18T06:49:39-07:00
by Juventus
It works perfectly. Thanks!