tree Explains Things 02: Creating Animated GIFs in Photoshop
In this tutorial I'll be going through the process of loading image files into Photoshop and then creating a basic animation that you'll ultimately be able to export as a gif. (For better quality and a larger video size, I recommend viewing this on YouTube.)
My goal is to keep these videos to a duration of 15 minutes or below for all our sakes. (Okay, mostly mine.) To that end, I've added a lot of notes along the way in this one. I hope that I've allowed enough time on screen for you to read them, but not everyone reads at the same rate, so you may need to pause the video in places. I'm sorry if that's inconvenient for anyone, but a girl's gotta do what a girl's gotta do. And this girl's got a laptop that threatens to blow up if she uses iMovie for more than ten minutes at a time.
(This transcript is approximately 75% accurate to the tutorial and 25% me condensing my waffle into more sensible narration.)
--
If you're not familiar with how to extract files from your video source, I have another tutorial about a program called SnapMotion (here) that explains some basics about frame rates and how you go about deciding what frame rates to use with particular sources. For this tutorial I'll be using caps extracted from a 24 fps clip at every second frame.
Since this is a pretty basic tutorial, we're not going to worry about things like the number of frames or the eventual size of the gif. However, I will briefly go through Tumblr's dimensions and maximum file size for images because ultimately that's what you'll be working towards when you're making your gifs.
When I started making gifs, Tumblr's maximum image file size was 3MB. It's now 5MB, which is a pretty significant increase. The Tumblr dashboard displays single images at a fixed width of 540 pixels. You can also post images in rows of two or three. If you have two images side by side, they will both have a width of 268 px; if you have three images side by side, two of them will have a width of 177 px and one will have a width of 178 (because 540 isn't evenly divisible by 3).
If you upload images that don't conform to this width, they'll be stretched or shrunk to fit. I recommend making your gifs at these exact display widths because I find gifs, in particular, don't shrink well, especially if they have text on them. They just don't look good at all. And nothing looks good when it's been stretched.
--
The Actual Tutorial Part of the Tutorial
Once you've opened Photoshop, go to File, Scripts, then Load Files into Stack. From the Load Layers screen, click Browse, and select all the files you want included in your gif. Then click Open. You can scroll down in the files box to see the names of the selected files. From here, click OK. Photoshop will open each image file and insert it into this newly created file as a layer so that each cap from your video source becomes a layer in a single Photoshop file.
My next step is to resize the images in the file. Since I'm making a single gif for this tutorial, I want to make it in Tumblr's large size. To resize an image, go to Image then Image Size. Enter 540 in the Width field. Make sure your dimensions are linked so that the height is changed proportionally to the width. Click OK.
To save the file, go to File then Save and choose a name and destination the way you would when saving any type of file.
Creating the Animation
Go to Window then Timeline. This is the area where you'll create your frame animation and then your video. To insert the layers you've just imported into this window, click Create Frame Animation. This creates a single frame populated by one layer in your stack. In order to insert the rest of the layers into frames, click on the timeline menu and select Make Frames From Layers. Each layer now populates its own frame and can be viewed by clicking on that frame.
At this point, the first layer in the stack appears in the last frame of the animation. When Photoshop inserts the image files in the Load Layers process, it does it backwards. This means that the last image (in this case, image 40) is loaded first and the first image is loaded last. In terms of viewing the layers panel, it makes sense, because it means that the images appear in order; however, the effect of this is that the frames are also backwards. In order to correct the order, go to the timeline menu and click Reverse Frames. Now the last frame corresponds with the last layer and the first frame corresponds with the first layer, which is what we want.
At the bottom left of the timeline window are the controls. In the centre is the Play/Stop button. The button to its right will take you to the next frame and the button to its left will take you to the previous frame. The left arrow|bar button takes you back to the first frame. Next to that is the Looping menu. Although it's possible to select other options, for our purposes looping should be set to Forever.
Playing through the animation at this point shows that the frames are in the correct order but it's too fast. That's because there's no delay between frames. To select the frame delay for a single frame, click on 0 sec. at the bottom of the frame. You can choose from the presets in the menu or click Other to enter the whole or fraction of a second of your choice. To select the frame delay for all frames at the same time, go to the timeline menu and click Select All Frames. Now when you click on the bottom of one of the frames and select a duration, all the frame delay durations are changed.
Playing through the animation after applying the frame delays shows that it's slower. Actually, it looks too slow now. For some reason, playback in the frame animation timeline appears slower than in the video timeline.
You can see what the frame delay speed really looks like by viewing it in the video timeline. Click on the icon at the bottom left of the window. The controls in the video timeline are basically the same as those in the frame animation timeline, plus a few others that we won't be needing right now. Each of the layers in the video timeline is one frame plus the frame delay we just selected. Playing the animation in the video timeline shows that it looks smooth and more like the normal speed that you'd see a video.
To return to the frame animation timeline, you can either undo the previous action (Edit, Undo) or click on the icon at the bottom left of the window, which will convert the video back into frames.
Ordinarily I like to crop the height of my images even after they've been resized. It's partly because I like the way they look with a larger width to height ratio, but also because reducing the dimensions of the images is going to reduce the size of the gif file and that's always a good thing when you're dealing with limits.
To do this I use the Crop tool. From the menu, I select W(idth) x H(eight) x Resolution. My last preset was 540px wide and 290px high. I'm going to stick with that because I don't want to cut off too much of Vic's head in this. The resolution is set to 72 px/in, which I check against the image files' resolution located at the bottom of the window next to the image dimensions. Clicking into the crop screen shows the crop grid, which by default is the centre of the image. I usually test that out first before making any adjustments. To approve the crop, I click the tick at the top right of the toolbar, then click the play button to determine if the cropped animation looks the way I want it to.
When I'm happy with my frame delay and crop, I go back to the video timeline. You can stretch or shrink the timeline by adjusting the slider at the bottom of the window. I usually run the image through one more time to make sure I'm happy with it before committing to the animation.
The next step is to create a Smart Object. Highlight all the layers in the layer panel and right click, then select Convert to Smart Object. Now there's only one item in the layer panel and one item in the video timeline.
The last step is to sharpen your video. Some people might say that that's actually an editing step but I absolutely disagree. I think sharpening is foundational and it should happen at this point. It should not be optional. Everyone should sharpen their damn gifs.
Go to Filter, Sharpen, then Smart Sharpen. The main setting to be concerned with is Radius. A smaller radius means less sharpening and a larger radius means more sharpening. When I'm working on larger images like this one, I tend to use 0.4 or 0.5 px sharpening; when I'm working on smaller images (e.g. 268 px wide), I tend to use 0.3 or 0.4 px. It depends on a lot of variables: the image quality, the amount of motion (sharpening is less effective when there's a lot of motion), what the light is like, etc. Work with the preview to determine what looks best. (Although what I just did is hideous. Don't do that.)
With this image I choose to go with 0.4 px because she's moving a lot and I don't think the extra point of a pixel is going to make a lot of difference. Click OK to confirm the selection. If you disable the filter visibility now, you can see that everything looks slightly blurry. When you enable the filter again, there's a lot more delineation in terms of the lighter areas and at the outer edges. I find that Smart Sharpen is particularly good at picking out the edges of light coloured things and also metal. Metal comes up really nicely in Smart Sharpen.
So that's Smart Sharpen. As I said, everyone should sharpen their gifs. This is a hill and I will die on it.
The very last step is to export your animation. Go to File, Export, then Save for Web (Legacy). The main thing to look at in this screen is in the lower left corner. (Obviously this file is too large for Tumblr.) The main contributor to your file size at this point is the percentage of Dither. I don't change any of the other settings. At the lower right of the window is a kind of final check area. It shows the dimensions of the animation and the looping. You can also play it back here.
When you're satisfied with all of these elements, click Save to save your gif file.
And here's my gif!
--
That's how I create my gifs. It's not the only way, but for me this is what makes the most sense out of a very unintuitive process. Thanks for watching, and if you have any questions about the tutorial, please come and talk to me on Tumblr. As I noted in several spots in the video, next time I'll be talking about a few more advanced parts of the process, as well as Smart Objects.











