Sample Header Ad - 728x90

How can I convert an animated gif to indivual frames and then back again to animated gif?

2 votes
2 answers
756 views
I want to manually modify an animated gif. So I'm trying to convert it to individual (editable) frames, after which I can draw my modification and then re-assemble the frames. First I convert a 31 seconds long mp4 to animated gif :
ffmpeg   -i Daisies.mp4   -r 15   -vf scale=512:-1   -ss 00:00:03 -to 00:00:06   DaisiesOK.gif
This animated gif is OK. Then I convert this animated gif to individual frames :
magick convert DaisiesOK.gif Daisies.png
The first frame looks OK, except it's in 256 colors, but the next ones are very pale, full of transparent pixels. These frames to animated gif :
magick convert -delay 20 -loop 0 *.png Daisies.gif
Gives a very ugly video, the daisies have white "shadows", the place where they started from (they're swaying) stays imprinted with white daisy edges. If I try to use jpeg instead of png, it's even worse, most of the video is just black. How can I extract the frames preserving all the color information? Does the problem come from imagemagick or from ffmpeg?
Asked by Alain Reve (123 rep)
Feb 9, 2025, 05:50 PM
Last activity: Feb 13, 2025, 11:26 AM