Updated date:

How to Make GIFs From Videos and Photos

Author:

I created a program that makes animated GIFs from photos and videos. Then I used it to make 3D animations.

Animated and Transparent GIFs

Small JPGs and PNG photos may contain thousands of unique colors. GIFs support transparency, silent animations, 256 colors and small file sizes. The limited number of colors makes them low quality. If you want high quality images that contain thousands of colors then use the JPG or PNG format.

You might want to make animated GIFs because they are popular, easy to share and interesting. On places like Twitter they often get more views than videos and static photos. People search for them. The animation I made from a video gets more views than the HD video. When I send GIFs in an email or text people can watch them. Animated PNGs and videos don't play in an e-mail or text.

Supporting transparency means you can make the image see through. Images that have a transparent background can be added on top of text and images. The result is similar to cut and paste. PNG images can also have transparent backgrounds and the quality is better.

I recommend using the GIF format for animations that are easy to share.

Slow motion boiling water to snow. As the boiling water leaves the cup it turns into snow.

Slow motion boiling water to snow. As the boiling water leaves the cup it turns into snow.

Images to GIF

Take a series of pictures with a camera and save them as a GIF or video. It works well for still or slow moving objects. If possible use voice commands, continuous shooting or a tripod. Pressing the button can jerk the camera and ruin your shot. Put the camera down when it is not supposed to move.

When taking pictures you are missing the time between photos. The hard part is to make sure the lighting does not change too much between shots. It does not need to be perfect but you don't want the flickering to ruin it. You can see my first attempt at stop motion below. I probably should have taken the pictures in a different spot.

Star wars rancor toy animation. Created using stop motion.

Star wars rancor toy animation. Created using stop motion.

Video to GIF

Videos are a series of images with sound. Animated GIFs are a series of images. Taking a video is easier than taking a series of photos. Computer programs can quickly extract images from a video and loading one video is easier than loading a large number of photos. That is why it is usually easier to start with a video.

To turn a video into an animation I cut the duration down to a few seconds, reduce the number of frames per second and reduce the dimensions. When possible I like to have a smooth transition. I try to make it so the viewer does not notice it stopping and starting over and over again. The animation below is long and large compared to most GIFs.

For me the hardest part is getting myself to make it tiny. It can be hard to capture the moment in 5 seconds and bigger is usually better. I like watching large HD videos that fill my TV screen. Things that look great on a large screen may not be worth watching on your phone. You need to find moments that only last a few seconds and look good when they are reduced to the size of your hand.

Most of the animations I have made are a little bigger than they should be.

Shark GIF animation from a video I took at Ripley's Aquarium of Canada.

Shark GIF animation from a video I took at Ripley's Aquarium of Canada.

Frames Per Second

Decreasing the frame rate can make a video look choppy. Increasing the frames per second before you record the video may improve the quality of the video or it may just add extra frames. When I reduced the number of frames from 60 to 24 frames per second the videos looked the same to me.

Using a lower frame rate decreases the file size. It also makes it easier to edit the frames. At 12 frames per second a 5 second video has 60 frames. At 60 frames per second it would have 300. If the extra frames do not improve the quality of the animation then get rid of them. The fewer frames the better.

Dog animation made with two pictures.

Dog animation made with two pictures.

Reducing the Size

Animated GIFs should be shorter and smaller than a typical video. Pick a section of the video for the animation and try to keep it under 10 seconds. While you are reducing the dimensions of the video you may want to zoom in on the main subject by cropping it. Most are less than 500 pixels across and last less than 6 seconds.

The animation does not really end when it keeps repeating. It is like watching a person jumping rope. If it is interesting then reducing the duration will not reduce the amount of time spent watching it. Large animations may take too long to load. The viewer may not wait for it to start.

For the animation below I reduced the framerate from 30 fps to 3. Then I increased the playback speed and deleted 20 frames. It shows over a minute of video in 10 seconds. While saving it I reduced the dimensions from 1280x720 to 500x281. The files size was still too big so I made it even smaller. Reducing the number of colors is another way to reduce the file size.

Recommended for you

If you upload an animation to a website and it does not play then you probably exceeded their size limits.

Shark aquarium at Ripley's Aquarium of Canada

Shark aquarium at Ripley's Aquarium of Canada

How to Put a Video in Reverse

It is easy to put a video in reverse after you have extracted the pictures. You might want to reverse a short video so it ends at the beginning. Loop the video so you don't notice it stopping and starting over while it is repeating. When you have the pictures for the animation in a directory you can change how they are sorted. On my computer I right clicked went to the Sort By option and switched from ascending to descending.

Animated GIF of me becoming invisible.

Animated GIF of me becoming invisible.

Videos That Look Like GIFs

The animated GIF you looked at online could really be a short repeating video. It is easy to make a video loop on a website or on your computer. Upload a short video to Twitter and it will automatically loop. Upload a GIF and it will be converted into a video that repeats. A short silent video that loops looks like a GIF but the quality can be better and the file size is much smaller.

When comparing file sizes GIFs are only smaller than videos when the duration, dimensions and frame rate is decreased. The hard part is making sure the animation you created is not going to take too long to load or use too much data. Sites like Twitter convert them into videos to reduce the file size.

As an alternative you might want to make a video look like a GIF. Offline you can just open the video and choose the repeat option on your video player. The code below can be added to a webpage. It tries to load a WEBM file. If that fails it tries to load an MP4 file. If it fails again then it loads the animation. The autoplay option only works with the muted option.

<video muted autoplay loop playsinline>
 <source src="Animation.webm" type="video/webm"> 
 <source src="Animation.mp4" type="video/mp4"> 
 <img src="Animation.gif">
</video>

Phasing experiment. I wanted to see if I could phase through something.

Phasing experiment. I wanted to see if I could phase through something.

Special Effects & Drawings

Make your animations more interesting by adding some special effects. There are fewer frames and the dimensions are going to be smaller. So it is easier to add special effects and drawings. You could draw lines like I did to the Star Wars toy or erase parts of the foreground image like I did with the chair animation.

Add the effects before reducing the size or cropping the image. Mistakes or imperfections are not as noticeable after you shrink the images. The animation above is not perfect but the effect looks good.

Why GIFs

GIF stands for Graphics Interchange Format. When people search for them they are usually looking for low quality short tiny videos or animations. They provide instant gratification because there is no waiting. You don't need to press a button or wait for them to load. They are really short and they play automatically in e-mails.

There are better alternatives but GIFs are the only ones that work in emails and people are searching for them.

GIF Maker

I made a 3D Gif Maker that you can use to make animated GIFs. It was originally created so I could add special effects. All of the animations on this page were made using it. I also recommend EZGIF. Their optimizer can reduce the file size by 50%.

Reduce the duration, dimensions and number of frames per second first. Most video editors can do that. Minimize the content then convert it. In 4 minutes you could make your first GIF. Find some GIF worthy moments, shrink them down and share them.

They are made for sharing but many of them are copyright protected. Pictures, videos and animations are automatically copyright protected until the owner says they are not. When you share what you made on social media sites like Pinterest and Twitter you can get the credit and the traffic. If you give the rights away then anybody can upload it to websites.

How can I make a good GIF? When I searched online I found hundreds of them but I only liked 3. Most of them did not look good to me. Try making animations that look great to you that also have some good keywords. Keep it short and simple. Since they are silent you may want to add text directly to the animation or beside it.

This content is accurate and true to the best of the author’s knowledge and is not meant to substitute for formal and individualized advice from a qualified professional.

© 2021 Michael H

Related Articles