Page 1 of 1

Centering / Scaling images in animation

Posted: 2009-11-09T19:49:36-07:00
by dognose
I'm trying to animate a few images of different sizes and orientations.

Say 100x50, 50x100, 30x30

I'm looking for an easy way to have them animate nicely, with images centered and scaled.

Do I have to individually calculate the offset and resizes? or can I apply something like -gravity center.

as it is now, anything bigger than the first frame gets cut off, and non of the images are scaled or aligned.

Any ideas?

Re: Centering / Scaling images in animation

Posted: 2009-11-09T20:03:41-07:00
by fmw42
what is your command line?

you probably need to use -page as per http://www.imagemagick.org/Usage/anim_basics/

but Anthony is the expert on this

Alternately, just -exent each image to the size of the largest before making the animation

convert image1 image2 image3 ... -background white -gravity center -extent WidthxHeight animation.gif

Re: Centering / Scaling images in animation

Posted: 2009-11-10T21:16:20-07:00
by anthony
I would need to know exactly what you want, you are not clear in what your input and output will be!

Do you have individual images, or a pre-existing GIF animation.

Do you want to scale the images to best fit the size given, or crop them?

But essentially if you create the sequence of frames as what you want to see, then -layers optimize them, you will get an appropriate GIF animation. If the input is already a GIF animation 'coalesce' the animation first so as to remove any existing GIF animation optimizations that could cause problems with your image manipulation.

Re: Centering / Scaling images in animation

Posted: 2009-11-11T09:26:28-07:00
by dognose
Ah, thanks, the -extent option was what I needed. gravity wasn't affecting anything otherwise.

thanks for all your help!