convert -size ignore ratio

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
immortal26

convert -size ignore ratio

Post by immortal26 »

I'm trying to figure out how to ignore the ratio of just the height.

So like... convert -size 1000x500\! ... so that it's always 500 in height but doesn't have to be 1000 in width, just 1000 is the greatest it can get in width.

This is being used to create a label of text IE: convert -size 1000x500\! -font Candice label:Hello ... something of that nature.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: convert -size ignore ratio

Post by fmw42 »

use the ^ symbol

convert image -resize "1000x500^" result

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

It does not apply to creating an image using -size! But does work with changing sizes such as with -resize, -thumbnail, etc
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: convert -size ignore ratio

Post by anthony »

-size is used for image creation. Labels, captions canvases (xc:), gradients, etc.. New images have no existing 'ratio' to be preserved, so such flags are currently not used.

You do not need to specify a size, but over the last few years you can now combine -size and -pointsize entries for generating labels and captions of specific size (or just hieght) specifications. Basically you have a lot of control options.

See IM examples Labels and Captions for details.
http://www.imagemagick.org/Usage/text/
and for Canvas image generation (new or using an existing image) see...
http://www.imagemagick.org/Usage/canvas/

-resize and -thumbnail etc are used for resizing images can also leave out one of the deminsions or specify to turn off image ratio preservation. See Image Resizing in IM Examples for details.
http://www.imagemagick.org/Usage/resize/
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply