How to create your own animated GIFs the easy way

Chris McVeigh, TechHive
16 February, 2013
View more articles fromthe author

You can’t go too far online these days without coming across an animated GIF, either as a quick flashcard-style animation or a short, soundless, looping video. No, that sentence was not written in 1999. Animated GIFs — simple animations made by stringing several still shots together — went quietly out of fashion over the last 12 years in favour of full-on streaming HD digital video and fancy Flash productions.

But now, unbidden and somewhat enigmatically, they’re back. Tumblr in particular is jam-packed with these succinct visual snippets, which are often clever and comical. Those that strike just the right combination tend to go viral, and can end up being viewed by millions of people the world over. Not bad for a file format that is over two decades old.

Graphics Interchange what?

GIF — short for Graphics Interchange Format — was developed in 1987 by CompuServe, and a perpetual argument has raged about how to pronounce the one-syllable acronym, an argument I will not even attempt to negotiate. Suffice it to say that about as many people seem to be proponents of the hard-pronunciation as of the J. But no matter how you say it, GIF technology allowed the online services company to deliver downloadable colour images, a remarkable accomplishment for its time.

The format included two features that quickly earned it favour with programmers as well as the brand-new web design community: image compression, which reduced the overall file size, and the capacity to hold more than one image (or frame) in a single file. Though it was never intended to serve as a platform for animations, a 1989 revision to the format (popularly known as GIF89a) allowed these frames to be displayed with time delays, permitting frame-by-frame animation. In the mid-1990s, support for the format by the Netscape browser let creators choose the number of times the animation would loop.

A flood of animated GIFs thereby ensued — no respectable website was considered complete without at least one animated GIF, no matter how inane. From then on, the steady, reliable GIF has endured, due largely to its limited capacity for animation, despite competitors like the PNG (Portable Network Graphics) format.

Not surprisingly, animated GIFs played a key role in the commercialisation of the internet. At the dawn of digital advertising, ad blocks were quite tiny, reflecting the low-resolution displays of the time. To attract attention and maximize their marketing messages, advertisers relied on animated GIFs — short slideshows would display the product, deliver the message, close with the oh-so-amazing price, and then loop over and over again.

As time wore on, the GIF format yielded the advertising space to Flash, but there’s been a bit of a reversal in the past few years. If you’re using a MacBook Air or iOS device, chances are that the animated ads you’re seeing are good ol’ GIFs (if not HTML 5).

GIF limits

Despite its improbable success over time, the GIF format is showing its age. A GIF image is limited to a maximum of 256 colours, which was fine for a typical 8-bit monitor circa 1995, but laughable for a modern Apple Cinema display, for example. And while the palette is variable and can be customised to best match the colours in the source image or animation frames, GIF colour representation pales in comparison to the 16.8-million-colour palette we’re accustomed to with more modern image formats such as JPEG.

GIF files use a compression technique called LZW (Lempel-Ziv-Welch), which is a lossless algorithm poorly suited to animation and video playback. The greater the pixel dimensions of the document, the higher the colour count, and the quicker the frame rate, the larger the resulting file size. A 10-second video clip in MP4 format might be 2MB; the same video clip converted to GIF would be more than 20MB.

GIFs tend to be short and sweet as a result, relying on reduced frame rates and restricted colour palettes to keep the file size under control. Without sound, animated GIFs are the digital equivalent of silent movies.

These limitations certainly add to the challenge of creating an interesting GIF — but they may also contribute to its enduring charm.

Creating a GIF

A number of apps allow you to make animated GIFs, but I’m going to demonstrate the basics with Photoshop Elements 11, Adobe’s consumer-based image editor, which lets you export your file as an animated GIF. Basically, you just place each frame on a different layer and then, when you export, the layers are compiled into an animation.

Here are the steps to create a rotating flower graphic.

Step 1: Open Photoshop Elements and, at the launch screen, choose the Photo Editor. Now choose File -> New Blank File. Name the new document Animation and then define the size of your document. GIFs are best when fairly small, so enter a width and height of 640-by-360 pixels in dimension. Now set the Background Contents to Transparent and click OK. Once your document opens, click Expert (at the top), and then click the Layers button (lower right) to see the document layers.

Step 2: Choose Layer -> New Fill Layer -> Solid Color. Name the layer Green Background and click OK. Now choose a nice bright colour; in my example, I’ve chosen a shade of green (H: 110; S: 40; B: 70).

Step 3: Choose the Custom Shape tool, and you’ll see the tool options slide into view along bottom of the window. First, click the wobbly shape at the top right of the tool options to select Custom Shape (U). Now click the currently defined shape to see other available shapes. At the top of this pop-up panel, you’ll see a pop-up menu allowing you to access more shapes. Choose Nature from this menu, and then select Flower 24. Now hold down the shift key and then drag the cursor across your canvas from the top right down diagonally. Holding down Shift ensures that the object retains the original height-to-width ratio. Stretch the object so it’s almost as tall as your document, and then choose a new colour for it from the colour swatch pop-up menu to the bottom right of the shape selection menu; in our case, we’ve chosen Pastel Yellow-Green. Lastly, you’ll need to center the object. Select the Move Tool (V); as do you, you’ll see the alignment options appear along the bottom. Select -> Select All, and click both Center and Middle.

Step 4: Choose the Text Tool. As soon as you do, you’ll notice that text options appear along the bottom of the document window. Choose a lightweight font like Helvetica Neue Ultralight at 30 pt, white, and with center justification. Now click in the middle of your document and type SPRING. Click the green checkmark on the bounding box to confirm the text entry. You should then see alignment options along the bottom of the window. Choose Select -> All and then click both Center and Middle alignment icons to fully center the text. Now lock this layer so that you don’t accidentally change it. In Layers, click the text layer to select it (if necessary) and then click the padlock icon at the top to lock it down.

Step 5: Your next two frames will be based on this first set of layers. Under Layers, hold down Shift and then click each layer; with all three layers selected, choose Layers -> Duplicate Layers. You’re presented with a Duplicate Set window; to continue, click OK. Now repeat this process once more. You should have three copies of your text, sun shape, and background colour.

Step 6: Choose the Move tool, and click the flower. You should see a tiny circle at the bottom of the bounding box; click it. A set of transformation options will appear along the bottom of the document window. Under Angle, dial in 20 to rotate the shape 20 degrees. Click the green checkmark on the bounding box to accept the change.

Step 7: Under Layers, click the eye icon for the three topmost layers to turn them off. Repeat the rotation process for the middle flower, this time rotating it only 10 degrees. Once you’ve completed the rotation, turn the top three layers back on.

Step 8: You must now merge each flower with its solid background to create three distinct frames. (Save your file at this point, so you can revert to it if something goes wrong.) Shift-click the top three layers to select them and then choose Layer -> Merge Layer. Now repeat the process for the middle and bottom sets.

Step 9: It’s time to turn out your GIF! Choose File -> Save for Web. On the far right of the Save window, you’ll see a set of options. Choose GIF 32 No Dither from the Preset pop-up menu, and then click the Animate checkbox. Near the bottom right, you’ll see the animation options. Looping should be set to Forever, and for the moment, we’ll leave the Frame Delay at 0.2. Click Save, and then save your new GIF to your desktop.

Step 10: Pop on over to your Desktop, and drag and drop your GIF into an open browser window to see it in action!

Once you’re familiar with the process, you can build GIFs with more frames for smoother animation. Again, just remember that as you increase the number of frames, you can decrease the frame delay in the Save for Web page and thereby boost your frame rate.

Bug eyes

Here’s a different technique you can use in Photoshop Elements to create another kind of GIF.

Step 1: Open a photo of a favourite pet using Photoshop Elements. Once the photo is open, click Expert (at the top), and then click the Layers button (lower right) to see the document layers.

Step 2: Under the Layers panel, click Background and then choose Layer -> New -> Layer from Background. Name it Frame 1 and click OK. Now select it and choose Layer -> Duplicate Layer. A pop-up window will ask you to name the layer; call it Frame 2.

Step 3: Click the new layer to select it (if necessary) and then choose Filters -> Distort -> Liquify. You’ll see a set of tools in the upper left. Choose the Bloat tool (the sixth icon down) and then, at the far right, set the brush size to whatever size is nearest to the size of the eyes in your photo. Now click the cursor very carefully over the pupils of your friend’s eyes to increase the size of the eye just slightly. The tool sometimes bloats too quickly; if this happens, choose Edit -> Undo and then try again with quicker mouse-clicks. When you’re done, press OK.

Step 4: Once you’ve returned to the main interface, click Frame 2 to select it and choose Layer -> Duplicate Layer. Name it Frame 3, and then Filters -> Distort -> Liquify and use the Bloat tool to expand the size of the eyes even more. Click OK when you’re done.

Step 5: In order to have the eyes appear to expand and contract when the animation loops, we need to place a frame between Frame 3 and Frame 1. So, click the layer called Frame 2 and choose Layer -> Duplicate Layer. This time, name the layer Frame 4 and click OK. Now click and drag Frame 4 above Frame 3 in the Layers panel.

Step 6: It’s time to export your GIF. First, you’ll need to resize the file to avoid memory errors or slow performance. Choose Image -> Resize -> Image Size. Click the checkbox for Resample Image (if necessary), and then choose a maximum pixel dimension of 600 pixels in either direction. Click OK to resize the file, and then choose File -> Save for Web. At the far right of the Save for Web window, you’ll see a number of export options. Keep it simple by choosing GIF 128 Dithered from the Preset pop-up menu, and then click the Animate checkbox. Near the bottom right, you’ll see the Animation options. Looping should be set to Forever, and let’s speed up the Frame Delay to 0.1. Click Save, and then save your new GIF to your desktop.

Step 7: Pop on over to your desktop, and drag and drop your GIF into an open browser window to see it in action!

Once you’ve become familiar with the process, you can build a GIF like this with additional frames for smoother animation, and then decrease the frame delay in the Save for Web page to increase your frame rate.


By Chris McVeigh. Contributor, TechHive

Chris McVeigh is an author, illustrator and toy photographer who lives in Halifax, Nova Scotia.

Leave a Comment

Please keep your comments friendly on the topic.

Contact us