Imagemagick: converting gif to pngs and pngs to gif produce different results - image

I am getting some problems trying to convert a gif file to pngs (change some colors in the pngs, but not yet) and then reconvert it into gif.
I convert the gif using: convert loading_32.gif loading.png. It produces 11 pngs files, what is pretty fine. But when I am trying to convert these pngs files into gif again using convert -delay 10 -loop 0 *.png loading2.gif , I get a different gif. Here the links to the gifs: original gif and generated gif
Hope someone can help!

This happens because *.png doesn't add the images in the original order. Try the following...
convert -delay 10 -loop 0 loading-{0..11}.png loading2.gif

Related

ImageMagick convert command misses frames

I am using 'convert' to make animated gifs with some png images I have generated.
If these images are small, then all works fine. I did
convert -delay 3 -loop 0 animation-small-png-1/* animation-small-1.gif
The generated gif works, see it with this post, it's the one with the big circle.
But if I take the big images and I do
convert -delay 3 -loop 0 animation-small-png-2/* animation-small-2.gif
Then the generated gif doesn't work fine, see it with this post : it's the one with the little circle, the size of this circle jumps one time by animation cycle. That is not normal, see please the previous gif file.
Can someone help me ?
images 1
images 2
Your Imagemagick command works fine for me on IM 6.9.12-70 Q16 Mac OSX Monterey and libpng 1.6.38
convert -delay 3 animation-small-png-2/* -loop 0 animation-small-2.gif
What is your Imagemagick version and platform/OS? What is your version of libpng? Do you have enough space in your /tmp directory? Are there left-over Imagemagick files there that you can delete?
My guess was that your /tmp directory got too full and could not handle any more files during your processing of the animation.

ffmpeg makes yellow patches in gifs

I have a bunch of png images made from a python script. When I convert the images to a mp4 format using ffmpeg, the video looks good. But the moment I make them into gifs it starts creating random yellow patches as shown below.
The syntax I use to convert png to gif is ffmpeg -i img%04d.png animation.gif
Thanks.

how to convert png animation to gif and keep the transparent using ffmpeg

I would like to convert png animation file to gif in windows,
I choose to use ffmpeg, as I have many of pngs to covert, cmd is quite straight forward in this case.
the sample img here:
https://i.imgur.com/SPGGMEb.png
tried:
ffmpeg -i SPGGMEb.png -vocdec gif output.gif
everything seems fine but the transparent background turns to black, as:
https://i.stack.imgur.com/7CbO8.gif
how can I keep the transparent background during conversion?

ImageMagick - convert png(s) to animated gif rather than having separate multiple overlapping images

Confuse as to what I'm doing wrong. I used the following command:
convert -loop 0 -delay 10 dog_cursor_24_1.png dog_cursor_24_2.png dog_cursor_24_3.png, dog_cursor_24_4.png, dog_cursor_24_5.png test.gif
Outputs a GIF image but upon viewing, the images are overlapping each other, which I do not want. Should look like a moving picture.
In Imagemagick, you do not use commas. So remove them. Put -loop 0 before the output gif and add +repage after reading the pngs to remove any virtual canvas.
convert -delay 10 dog_cursor_24_1.png dog_cursor_24_2.png dog_cursor_24_3.png dog_cursor_24_4.png dog_cursor_24_5.png +repage -loop 0 test.gif
If that does not work, then post your animation. It may need a different -dispose method.

slide Wipe effects with ImageMagick tool and ffmpeg

I have to do a four slide effects named 'Wipe Up', 'Wipe Down', 'Wipe Right', 'Wipe Left'. Like curtain of two images for each type. I think it can be possible with cropping of images with 'convert'
convert 01.jpg -crop 1920x5 output_%03d.jpg
where i can get sequence of images and compose at same time to the second image(What I don't know..) And then I can build video from this sequence of images with ffmpeg:
ffmpeg -i output_%03d.jpg out.mp4
Maybe someone can help me with compossing of images in the same time when I croping? Thanks for any suggestions!
PS: all images have fixed dimensions: 1920x1080
You could use ImageMagick's MIFF format (Multiple Image File Format) to send a stream of multiple, cropped images to another invocation of ImageMagick to put them together in a video sequence. So assuming you start with this:
and did this
convert input.png -crop 1920x10 miff:- | convert - -loop 0 out.gif
you would get this

Resources