Page 1 of 1

unable to resize correctly psd image with same aspect ration

Posted: 2015-11-25T02:09:04-07:00
by madan
Hi,

I am using ImageMagick Version 6.9.2 Q16 to resize psd images with below 2 commands. Trying to resize from 3000x3000 to 1768x2160. But its not resizing properly, instead it resized to 1768x1768.

Can anyone have an idea of how to resize psd images with same aspect ratio

Original Image: input.psd Target image : output.psd
>identify input.psd
input.psd[0] PSD 3000x3000 3000x3000+0+0 8-bit sRGB 38.12MB 0.437u 0:00.437
input.psd[1] PSD 3000x3000 3000x3000+0+0 8-bit sRGB 38.12MB 0.421u 0:00.421
input.psd[2] PSD 3000x3000 3000x3000+0+0 8-bit sRGB 38.12MB 0.421u 0:00.437
input.psd[3] PSD 1580x342 1580x342+748+2633 8-bit sRGB 38.12MB 0.421u 0:00.437
input.psd[4] PSD 1549x2547 1549x2547+766+226 8-bit sRGB 38.12MB 0.421u 0:00.437

command usage 1:
convert input.psd -resize 1768x2160 output.psd
identify output.psd

output.psd[0] PSD 1768x1768 1768x1768+0+0 8-bit sRGB 41.99MB 0.140u 0:00.127
output.psd[1] PSD 1768x1768 1768x1768+0+0 8-bit sRGB 41.99MB 0.140u 0:00.132
output.psd[2] PSD 1768x1768 1768x1768+0+0 8-bit sRGB 41.99MB 0.125u 0:00.135
output.psd[3] PSD 1768x383 1768x383+837+2949 8-bit sRGB 41.99MB 0.125u 0:00.137
output.psd[4] PSD 1314x2160 1314x2160+650+192 8-bit sRGB 41.99MB 0.125u 0:00.142

command usage 2:
>convert input.psd -resize 1768x2160 -layers merge output.psd
identify output.psd

output.psd PSD 2605x3332 2605x3332+0+0 8-bit sRGB 6.048MB 0.031u 0:00.031

Thanks,
Madan

Re: unable to resize correctly psd image with same aspect ration

Posted: 2015-11-25T10:38:58-07:00
by fmw42
convert input.psd -resize 1768x2160 output.psd
If you want an exact size then use ! to force that size though it will distort the image. Otherwise IM tries to preserve the aspect ratio from the larger dimension.

Code: Select all

convert input.psd -resize 1768x2160! output.psd
see http://www.imagemagick.org/script/comma ... p#geometry