resizing does not work properly

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
nitaraju

resizing does not work properly

Post 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...
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: resizing does not work properly

Post by magick »

RTM. You need to add ! to your resize (e.g. 320X420!) otherwise the aspect ratio of the image is maintained.
nitaraju

Re: resizing does not work properly

Post 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.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: resizing does not work properly

Post 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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply