Make Animated GIFs from Videos

How to Make Animated GIFs from Videos

How to Make Animated GIFs from Videos

I'm sure we've all had our days when we visit a particular website or forum and go green in envy when we see posts or users with fancy animated GIFs ripped from a video. If you ever wished you wanted to learn how to create those GIFs, you've come to the right place.

In this tutorial, I'll explain the process of making an animated GIF from a particular scene in a video. It's not as hard as most people imagine it to be, so I'm sure by the time you're through reading this, you'll be able to whip out those GIFs at anytime of your choosing too.

What you will need?

A software that will extract frames from a video, like VirtualDub or KMPlayer, and an image editing software that will put it together. For this tutorial, I'll be using KMPlayer and Photoshop (any Photoshop that comes without Image Ready will do - basically CS3 and above). You can also use free GIF makers like Beneton Movie GIF, but Photoshop usually gives out the best quality so that's what I use.

That's the video I'll be using, the Final Fantasy Versus XIII trailer that was shown at Square Enix's Production One press conference, earlier this month. Anyway, let's get a move on.

Frame Extraction
Play the video in KMPlayer and pause it a couple of seconds before the scene you want a GIF of starts. Once you've done that, right click on the video and go to Capture -> Frame Extract. You can also hit Ctrl + G on the keyboard if that's what you want.

Step One: Here we go
You'll be greeted by a window with a few options. The image below shows the optimum settings for a good quality GIF that's doesn't have too big a filesize. If you're planning on making a shorter GIF that needs to be very smooth, you can lower the Frames to Extract option to 2 every # frames, but be warned it substantially increases the file size.
 Step Two: Specifying the extraction parameters
Once you're ready to extract the frames, click on Start in the window and then resume the video. It will start extracting the frames according to the parameters you've set and when you've crossed the scene you want as a GIF, stop the video and close the Frame Extraction window. You can even close KMPlayer itself if you want, because its work is done.
Step Three: Deleting unwanted images

There's one little thing left to do though. Earlier, I mentioned that you'd need to pause the video a couple of seconds before the scene you want, so that you inadvertently don't miss a second or two of the video. However, those frames have also been extracted, so browse to the folder you specified and clear out the un-needed frames that were captured from the video.

Important: Make sure you have only the images you want to use in your GIF in that folder - no other files, folders or images.

Image Editing
Now that you're done with that, you need to put it together in a GIF file and that's where Photoshop comes in. So load it up and go to File -> Scripts -> Load Files into Stack.
Step One: Loading Files into a Stack
A window will pop up, asking you what files you want to load into the stack. Click on the drop down box and select the folder (very important), then browse and select the folder which contains the extracted images. Photoshop will load them and display the file names in the black box below, so make sure the file names are all in there before you click okay.
Step Two: Telling Photoshop where to look
When you hit okay, Photoshop will begin the process of importing all these images as layers in one image file. Wait till it's done - you'll know if you look at the Layer toolbar. Once it's done, make sure the Animation toolbar is shown at the bottom of the screen. If it is not, go to Window and click on Animation. Anyway, you'll see one image in the Animation toolbar and all of them in the layer toolbar. There's a button on the top right of the Animation toolbar, click on it and select Make Frames from Layers. Photoshop will begin filling up the toolbar with all the layers, i.e. all the frames you extracted.
Step Three: Making Frames from Layers

Now all the images are in the animation toolbar and you can even preview your GIF by hitting play. But wait - it will initially play in reverse and at a pace that's much too fast. You'll need to fix that. First, select all the frames in the animation toolbar (click on the first one, then press shift and click on the last one). Then click on that button on the top-right of the toolbar again and click on Reverse Frames. Your images will now be in the right order.
Step Four: Reversing the frames
Now that the images are in the right order, you need to slow them down. All the frames will still be selected, so click on the text that says '0 sec' and on the menu that pops up, click on 0.1 seconds. Tada, your GIF-in-progress now plays in the right order and at the right speed.
Step Five: Slowing it down

We'll now do something known as tweening. If you just keeping playing your GIF on loop, which is what will happen once you put it up online, you'll notice it ends very abruptly and goes back to the beginning. You might get lucky with some GIFs that don't do this, but most of them will, so tweening becomes a very important step - it will add a transition right at the end so the whole thing doesn't seem abrupt.
Step Six: Tweening

Select the last image and look for an icon that looks like a chain link at the bottom of the animation toolbar. Click on it and a window with options will appear.
Step Seven: Tweening Options
In the drop down box, select First Frame and instruct it to add 3 Frames. The other parameters have to be the same as the ones in the above image. When that is done, you'll see three new transition frames at the end.

The next step is to resize the GIF.
Step Eight: Resizing

Click on Image -> Image Size, or hit Alt+Ctrl+I on your keyboard. In the window, make sure Constrain Proportions (so your image doesn't get squashed or skewed) and Resample Image are selected, and then change the height to anything between 150 pixels to 200 pixels. Keep in mind these affect file size majorly, so choose wisely. The longer the GIF, the smaller it needs to be to maintain a decent filesize and vice-versa.
Step Nine: Preparing to add a border

Now we'll need to add in a border to the image. Well, you don't really have to, but I'd recommend it so the image doesn't stick out like a sore thumb wherever you post it. Select the first frame in the animation toolbar, then click on Layer -> New Layer, or hit Shift+Ctrl+N on your keyboard. Make sure it's above the other images in the layer toolbar - it should be right on top.
Step Ten: Time to Stroke

Once the new layer has been added, click on it in the layer toolbar, then click on the image and select it completely by hitting Ctrl+A or going to Select -> Select All. Now go to Edit -> Stroke.
Step Eleven: Stroke Parameters

You'll have to apply strokes a total of three times. First, make a 3 pixel wide stroke in black (should be located on the inside, importantly), then a 2 pixel wide stroke in white and finally a 1 pixel wide stroke in black again. You should now have double borders and a pretty good looking GIF.
The border looks good, doesn't it?
Your GIF should now be ready. Hit play in the animation window to verify, and then go to File -> Save for Web & Devices, or hit Alt+Shift+Ctrl+S (!).
Step Twelve: Saving

The image below will show you the parameters you need to select. If your file's turning out to be too big, you have three recourses - reduce the image size (see Step Eight), reduce the number of colours it uses to 128, or reduce the dither level to 99% (no lower or it'll look extremely pixelated).
Step Thirteen: Save Parameters

Now save your file and voila, your GIF is ready! Now just upload it to any image hosting website like Imageshack or Tinypic and you can now show it off on the Internet. I hope you're now able to make GIFs on your own, and don't worry if it doesn't look too good because practise will make you much better.

In case you're wondering, you can click here to check out the GIF I made.