You are here.

Mega-ZBlog header image

Animated GIFs

January 8th, 2008 · No Comments · Windows

Someone just asked me (well that asked me on Dec. 12th but I didn’t spot their forum PM until today… oops) how I make my animated GIFs so i might as well share with everyone!

I use three tools.

  1. MPlayer to dump the frames to PNG images,
  2. IrfanView to batch convert the PNGs to GIFs while resizing/resampling them and palettizing them,
  3. UnFREEz to make an animated GIF out of the frames.

MPlayer is a command line application, so I usually first play the movie normally but I use different values for -ss (starting time in seconds) and -frames (number of frames to play before qutting) until it plays the bit I want to dump, then I use -noframedrop (to force it to render every frame even if audio and video get out of sync) and -vo png:z=0 (render each frame to a PNG with no compression (IE fast)).

IrfanView has a nice “batch conversion” option I use to resize the images using a resampling algorithm, and reduce the colors to 8 bit using dithering, and finally resave them as GIFs.

Sometimes IrfanView can’t read one of the PNGs properly, and so the converted image is bad. When that happens I usually open it in MSPaint, copy the image, paste it into IrfanView and resave over the original and that fixes it.

After I have all my little GIFs I usually have to trim it down to make sure the total file size is low enough for an avatar (I use 1mb as my upper limit). Usually I’ll cut scenes I don’t care about, or
unimportant scenes I’ll take bits out of the beginning or end, sometimes I halve the framerate and the file size by deleting every other frame.

Once I have my final frames, I drag and drop them into UnFREEz. I figure out the frame delay by inverting the framerate value mplayer displays for the movie (IE if it’s 29.997 FPS I take 1 / 29.997 which is 0.0333 seconds per frame or 3 centiseconds per frame. Most of the movies I’ve used are ~25FPS which is about a 4cs delay.

Then I save my final image, preview it in IrfanView to make sure it looks right, and then upload it.


0 responses so far ↓

  • There are no comments yet...Kick things off by filling out the form below.

You must log in to post a comment.