Reputation: 23
I'm trying create a script to tile a gif to fit a certain dimention.
Here is the animated gif i use to test it (71 frames) (it seems i need 10 rep for embedding, sorry): green-matrix.gif
so far i have tried the following commands (variables have been replaced with proper values):
magick convert -size 1153x692 -coalesce tile:green-matrix.gif -coalesce -loop 0 tempout.gif
which gives me the following static gif (it's the first frame of my input): output1.gif
after that i have tried this command: magick montage green-matrix.gif -tile 7x4 -geometry +0+0 tempout.gif
which gave me this broken output (3 frames, on the last frame some tiles turn to white): output2.gif
Thanks.
Upvotes: 2
Views: 483
Reputation: 5385
First, you should only use "magick convert" if you have a particular need to apply the behavior of ImageMagick version 6. It's almost always recommended that you simply use "magick" to get all the features and behavior of IMv7.
This command will read the original 72 frame input GIF, set a viewport size of your final desired dimensions, and assemble the 72 full sized tiled frames into the output GIF...
magick tile.gif -coalesce -virtual-pixel tile -set option:distort:viewport 1153x692 -distort SRT 0 -loop 0 big.gif
Keep in mind this creates all 72 fairly large images, so it might be pretty slow. On my Windows 10 system it takes over a minute to create the output.
Upvotes: 2