Bad animation output image when using Montage with gifs
Im triying to create a Montage 5x1 from 5 gifs:
Every gif are 512x512 size
http://cdn.noten.in/gif/file-1.gif
http://cdn.noten.in/gif/file-2.gif
http://cdn.noten.in/gif/file-3.gif
http://cdn.noten.in/gif/file-4.gif
http://cdn.noten.in/gif/file-5.gif
magick montage "D:/xampp/htdocs/wastickers/file-1.gif[0-10]" "D:/xampp/htdocs/wastickers/file-2.gif[0-10]" "D:/xampp/htdocs/wastickers/file-3.gif[0-10]" "D:/xampp/htdocs/wastickers/file-4.gif[0-10]" "D:/xampp/htdocs/wastickers/file-5.gif[0-10]" -tile 5x1 -delay 12 "D:/xampp/htdocs/wastickers/montage.gif"
if i set to took only frame 0 its works as expected. if without frame indicator outputs the same error.
everytime i try the montage looks pretty bad like it are extracting every frame and putting together cropped:
Result:
http://cdn.noten.in/gif/montage.gif
I don't think this is a bug.
Your inputs are animations. I suppose you want the result to be a single animation, where each frame is made of one frame from each input, appended together.
IM has no simple command to do that. It can be done, but the process is not trivial. See https://www.imagemagick.org/Usage/anim_mods/#append
You will have to write a script loop and montage one frame at a time from each image and save as MIFF or PNG. Then combine all the results into a GIF animation.
I don't think this is a bug.
Your inputs are animations. I suppose you want the result to be a single animation, where each frame is made of one frame from each input, appended together.
IM has no simple command to do that. It can be done, but the process is not trivial. See https://www.imagemagick.org/Usage/anim_mods/#append
So can you explain why is taking frames cropped(check the result), and why is creating the tile filling the 5x1 montage with frames of the first image instead 5 images? do you think is not a bug?
I tried using most of the options achieving the same result.
You will have to write a script loop and montage one frame at a time from each image and save as MIFF or PNG. Then combine all the results into a GIF animation.
Thanks for your suggestion, i think it would be the only option.
So can you explain why is taking frames cropped(check the result), and why is creating the tile filling the 5x1 montage with frames of the first image instead 5 images? do you think is not a bug?
I can't see any bug here.
You read 11 frames from each input GIF. The GIFs are compressed, which means each frame has only the differences from the previous frame. "-layers coalesce" would de-compress to give you the full frames, but you don't do this.
After reading 55 frames, you then write them a GIF, with "-tile 5x1". So the first 5 frames (out of 55) will be written to the first frame. Then the next 5 are written to the next frame, and so on.
So can you explain why is taking frames cropped(check the result), and why is creating the tile filling the 5x1 montage with frames of the first image instead 5 images? do you think is not a bug?
I can't see any bug here.
You read 11 frames from each input GIF. The GIFs are compressed, which means each frame has only the differences from the previous frame. "-layers coalesce" would de-compress to give you the full frames, but you don't do this.
After reading 55 frames, you then write them a GIF, with "-tile 5x1". So the first 5 frames (out of 55) will be written to the first frame. Then the next 5 are written to the next frame, and so on.
Sorry but its my first time working with IM, and your suggestions has good logic.
in fact: I need to set the 篓-tile 5x1 parameter first, then the -layers coalesce so it can extract the full image frame, and next of params the pictures and output?
in fact: I need to set the 篓-tile 5x1 parameter first, ...
But that won't do what you want. You have 55 images. The first 11 came from the first GIF. So when you write the first 5 images to be montaged together, they will all come from the same input GIF.
You need to rearrange the images so the first 5 images are image [0] from all 5 input GIFs.
in fact: I need to set the 篓-tile 5x1 parameter first, ...
But that won't do what you want. You have 55 images. The first 11 came from the first GIF. So when you write the first 5 images to be montaged together, they will all come from the same input GIF.
You need to rearrange the images so the first 5 images are image [0] from all 5 input GIFs.
I tried with 2x1 gifs and worked ok, but now a new challenge has come (for me), the 2 gifs are appended in every tile, i mean the plays gif 1 and then 2 in tile 1, and second tile the same,
magick montage "D:/xampp/htdocs/wastickers/file-1.gif" "D:/xampp/htdocs/wastickers/file-2.gif" -tile 2x1 -coalesce "D:/xampp/htdocs/wastickers/montage2x1.gif"
How to arrange one gif per tile with animation?
magick montage "D:/xampp/htdocs/wastickers/file-1.gif[0]" "D:/xampp/htdocs/wastickers/file-2.gif[0]" ...etc... "D:/xampp/htdocs/wastickers/file-5.gif[0]" -tile 5x1 -coalesce "D:/xampp/htdocs/wastickers/montage5x1_00.gif"
magick montage "D:/xampp/htdocs/wastickers/file-1.gif[1]" "D:/xampp/htdocs/wastickers/file-2.gif[1]" ...etc... "D:/xampp/htdocs/wastickers/file-5.gif[1]" -tile 5x1 -coalesce "D:/xampp/htdocs/wastickers/montage5x1_01.gif"
...etc...
magick montage "D:/xampp/htdocs/wastickers/file-1.gif[10]" "D:/xampp/htdocs/wastickers/file-2.gif[10]" ...etc... "D:/xampp/htdocs/wastickers/file-5.gif[10]" -tile 5x1 -coalesce "D:/xampp/htdocs/wastickers/montage5x1_10.gif"
Or write a bat script that loops as many times as you need to get 55 images, i.e. for 5x1, that would be 11 times. Each time increment the value in the [0]. So [0], [1], [2] ... [10].
See https://imagemagick.org/Usage/basics/#list_ops and Selecting Frames at https://imagemagick.org/script/command-line-processing.php#sequence
Or you could do it like this (Windows BAT syntax):
magick ^
( file-1.gif[0-10] -layers coalesce -append +repage ) ^
( file-2.gif[0-10] -layers coalesce -append +repage ) ^
( file-3.gif[0-10] -layers coalesce -append +repage ) ^
( file-4.gif[0-10] -layers coalesce -append +repage ) ^
( file-5.gif[0-10] -layers coalesce -append +repage ) ^
+append ^
-crop 1x11@ +repage ^
-layers optimize ^
out.gif
Thanks @snibgo and @fmw42, i will try your scripts in php with FOR, i was looking for the fast way because i have about files 600 zip files from which script extracts and generates first 5 gifs to make a thumbnail, i was wishing this can be done with 1 simple montage command, i hope it wont last forever :P