Page 1 of 1

resizing does not work properly

Posted: 2007-09-27T13:27:08-07:00
by nitaraju
Hi,
I am tryign to convert a .png image to .jp format with the following changes -

Resize image to 1920x1080 (to correct aspect ratio)
Adjust gamma to 1.26 (Photoshop value)
Save as 320x240 (cropping sides off to fit) JPEG

The actual size of the image is - 1280 X 1080

For this i am using the following command -
convert -size 1920 X 1080 Original.png -gamma 1.26 -resize 320X420 convert1.jpg

The image is converted but the image size is - 284 X 240.

This does not meet my requirement.
Please help...

Re: resizing does not work properly

Posted: 2007-09-27T15:20:31-07:00
by magick
RTM. You need to add ! to your resize (e.g. 320X420!) otherwise the aspect ratio of the image is maintained.

Re: resizing does not work properly

Posted: 2007-09-28T07:52:40-07:00
by nitaraju
The resizing worked well. But i have to correct the aspect ratio to 1920 X 1080. The actual Image size is - 1280 x 1080. I was tring to correct the aspect ration to 1920 X 1080 in the same command in which i want to resize the image.

What shall i do to manage correcting the aspect ration as well as resizing the image at the sametime.

Re: resizing does not work properly

Posted: 2007-09-30T18:44:43-07:00
by anthony
Exactly as 'magick' described. Add an '!' to the resize option argument.
It forces it to resize the image to the exact dimensions given. You may need to add a backslash or quote the '!' character as many command line shells use it for history substitution.