1
votes

This seems like a question people may have asked indirectly before, but my question is more straightforward.

I have a folder of images sized 559x464 px.

[cbloecke@mac:cropped]% file file1_95w65w20n50n.png
file1_95w65w20n50n.png: PNG image data, 559 x 464, 8-bit/color RGBA, non-interlaced

All the png images have the same "95w" text in the filename. I use the imagemagick -loop and -delay commands to make them into an animated gif.

convert *95w*.png -delay 30 -loop 0 animated_95w65w20n50n_t.gif

But every time I do this, the resulting gif is resized larger with lots of empty space around it.

[cbloecke@mac:cropped]% file animated_95w65w20n50n_t.gif
animated_95w65w20n50n_t.gif: GIF image data, version 89a, 720 x 1080

I've tried using -trim and -resize 559x464 to reduce the size of the image, but they aren't doing anything. Why does imagemagick keep adding all this extra space? How do I trim it back down to the original 559x464?

Note: I'm working on a network where I have no control over the modules installed, so I'd prefer a solution in imagemagick, or potentially another default linux module.

1
Try convert *95w*.png +repage ...Mark Setchell
Well that was quick, thanks! Want to make your comment an answer so I can accept it?ChristineB

1 Answers

2
votes

Try repaging your images after you open them so they forget any previous virtual canvas sizes:

convert *95w*.png +repage -delay 30 -loop 0 anim.gif