I have bunch (1761) photos, in a folder, and I want to convert them to a gif. They are a variety of sizes, and I would like those sizes preserved.

I issued the command, convert -delay 1000 -loop 0 *.jpg animated.gif which produced the animated gif, but all the image sizes were reduced to 250px by 140px. How can I make my animated gif, and have the convert command ignore the fact that the images have different sizes?

Using convert isn't a requirement, its just what I would normally use. I seem to recall this working previously, but its not doing it right now.

The first image size is: 927x1200px this is about the largest one, and I thought it would use that for the size of all the images.

  • Did you try convert -delay 1000 -loop 0 -extent 927x1200 *.jpg animated.gif?
    – ridgy
    Commented Dec 23, 2016 at 11:56

1 Answer 1


One way to get this done in different steps is first to convert the .jpg images to have same size, then create animated gif.


for i in *.jpg; do convert $i -size 927x1200 xc:black +swap -gravity center -composite ./CONVERTED/$i; done
convert -delay 1000 -loop 0 ./CONVERTED/*.jpg animated.gif

This does: For each image create new image of size 927x1200 in subfolder CONVERTED, keep the size of the image, center it with black border.

If you do want to have the images resized in a way so they fit into the output size, you might also resize them:

for i in *.jpg; do convert "$i" -resize 927x1200 -size 927x1200 xc:black +swap -gravity center -composite ./CONVERTED/"$i"; done

Instead of making animated gif (which could become very big) you might want to create a movie by using photofilmstrip (on the converted images).

  • totally crashes my PC running this command. no fault of yours, it appears this would work.
    – j0h
    Commented Dec 23, 2016 at 17:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .