Resizing to Fill a Given Space

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
kbsolutions

Resizing to Fill a Given Space

Post by kbsolutions »

Hi!

Hope someone can help me with that...
I would like to resize a pic to fill a given space with a certain background image. Its working fine with a color, but how can I do this with a background image (gif)?

With color it works fine:
convert myimage.gif -resize 300x300 -size 300x300 xc:#fff +swap -gravity center -composite mynewimage.gif

but if you would like to have a background image... can someone help me with that please?
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Resizing to Fill a Given Space

Post by anthony »

IM Examples, Thumbnails...
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
kbsolutions

Re: Resizing to Fill a Given Space

Post by kbsolutions »

hmm, I did already searching for an example... but I did not find one! that's the reason, why I am posting here.
Can you give me a hint?

Regards
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Resizing to Fill a Given Space

Post by anthony »

The example used gradient: for the background image...
Last example in 'padding out an image'
http://www.imagemagick.org/Usage/thumbnails/#pad

Just replace gradient: with the background GIF image
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply