Resize and fill the rest

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
Mahroun
Posts: 23
Joined: 2011-12-24T02:52:08-07:00
Authentication code: 8675308

Resize and fill the rest

Post by Mahroun »

I couldn't figure it out, sorry

I have a frame that is 188 x 123, but those dimensions are dynamic and frame size can change..
I need to downscale the image to look best and centered in the frame, so I make calculations in my script (Ahk script) and resize one of the sides (depend on the image dimensions), now I need to fill the rest with white.

I'm using IrfanView to do the resizing but would like to use ImageMagic to do both resizing and filling.

Any idea?
Thanks
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Resize and fill the rest

Post by Bonzo »

Try something this:

Code: Select all

convert input -resize 500x500 -background white -gravity center -extent 500x500 output
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Resize and fill the rest

Post by anthony »

There is a lot of examples of this type of thing in
IM examples, Thumbnails
http://www.imagemagick.org/Usage/thumbnails/
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply