Page 1 of 1

Centering mixed size images when creating animated GIF

Posted: 2019-06-12T20:18:45-07:00
by Sharok
Hi, I create an animated gif from mixed size images, but the smaller images are not centered. I want the smaller images to be centered instead of being on the left side or on the top. Can you help please? What options do I add to my command to center the images?

Here is the command I use:
convert -resize 668x476 -delay 400 -dispose background -loop 0 -gravity Center *.jpg ani.gif

Re: Centering mixed size images when creating animated GIF

Posted: 2019-06-12T20:35:41-07:00
by fmw42
Proper syntax reads the input images before doing any resize.

Try

Code: Select all

convert -delay 400 -dispose background *.jpg -resize 668x476  -gravity Center -background white -extent 668x476 -loop 0  ani.gif

Re: Centering mixed size images when creating animated GIF

Posted: 2019-06-12T21:34:01-07:00
by Sharok
You are awesome. That worked very well. Thanks very much.