Video by Adobe.
A GIF is a short looping animation made from a handful of still frames. For a photographer that can be a before and after, a sequence shot in a burst, a subtle cinemagraph, or a few frames of a tide or a crowd. Photoshop builds one from layers: each layer becomes one frame, you set how long each frame shows, and then you export. The steps below use the desktop Photoshop. Menu names shift a little between versions, so look for the same ideas if a label differs.
Know what a GIF can and cannot do
- 256 colours per frame. A GIF is a poor home for smooth skies and skin. Gradients show as bands. Photos with strong, simple colour hold up best.
- No sound, and files get big fast. Every frame is stored, so size grows with frame count and pixel dimensions.
- Short and small wins. Aim for 5 to 30 frames and a width of 600 to 1,000 pixels. Under about 5 MB loads quickly on most pages.
- Video may be a better answer. For smooth motion over a few seconds, an MP4 looks better and is much smaller. A GIF is for a short loop that has to play anywhere without a player.
Step 1: Plan the frames
Decide what changes from frame to frame. Good sources:
- A burst of a moving subject, shot with the camera still (use a tripod or lean on something solid).
- A set of photos for stop motion, where you move an object a little between shots.
- One photo edited two or three ways, for a before and after.
Keep every frame the same pixel size and the same aspect ratio. If you shot raw, edit all frames with the same settings first so brightness does not flicker. Then resize them to the final size before you build the animation, because resizing 30 frames inside one file is slower and harder to undo. See image resolution and file sizes for the sizes behind this.
Step 2: Get each frame onto its own layer
There are two quick ways:
- From a folder of images: choose File, then Scripts, then Load Files into Stack. Pick your images and click OK. Photoshop makes one document with each image as a layer. Tick “Attempt to automatically align source images” only if the shots were handheld.
- From Bridge or Camera Raw: open the files as layers in a single document. Or copy each frame into the first document with Select All, Copy, Paste.
Check the Layers panel. The bottom layer becomes the first frame, and the top layer becomes the last. Drag layers to reorder them. Rename them if you like, but names do not affect the animation.
Step 3: Open the Timeline and make frames
- Choose Window, then Timeline.
- In the Timeline panel the main button can say “Create Video Timeline” or “Create Frame Animation”. Open its menu and choose Create Frame Animation, then click the button. You need the frame version, not the video one, to make a classic GIF.
- Click the panel menu (the small icon at the top right of the Timeline) and choose Make Frames From Layers. Each layer becomes a frame.
If your frames come out in reverse, open the same panel menu and choose Reverse Frames.
Step 4: Set the timing and loop
- Frame delay. Under each frame is a time, 0 sec by default. Click the first frame, hold Shift and click the last to select all, then click any frame’s time and pick one. Use 0.1 to 0.2 seconds for smooth action, 0.5 to 1 second for a before and after, and a longer hold on the last frame so people can read it.
- Looping. Use the menu at the bottom left of the Timeline, usually labelled “Once”. Choose Forever for a loop, or Other to enter a count.
- Preview. Press the Play button (or the Spacebar). If it flickers, the layers are probably not the same size or the frames are not aligned.
To make a seamless loop of a motion that goes back and forth, build the forward frames, then duplicate the middle frames in reverse order so the last frame leads back to the first. Do not repeat the first frame at the end, because it will pause for a beat on every loop.
Step 5: Export the GIF
- Save your layered file first (as a PSD) so you can change the timing later.
- Choose File, then Export, then Save for Web (Legacy). In recent versions it is listed there with “Legacy” in the name, and its shortcut is Alt+Shift+Ctrl+S (Windows) or Option+Shift+Cmd+S (Mac).
- Set the file type to GIF.
- Set Colors as low as you can before it looks bad: 128 or 64 is often fine for simple images. Set Dither to Diffusion at around 80 percent for photos, or turn it off for flat graphics.
- Set Looping Options to Forever at the bottom.
- Resize in the Image Size box if needed, and check the file size shown under the preview.
- Click Preview to see it play in a browser, then Save.
Keep file size down
- Cut frames. Removing every other frame halves the size and often looks nearly the same.
- Cut dimensions. A GIF at 800 pixels wide is often a quarter of the size of one at 1,600.
- Cut colours. Drop from 256 to 128 and compare.
- Keep the background still. Pixels that do not change between frames compress very well, so a locked-off tripod shot gives a small file.
Common mistakes
- Frame delay left at 0. The browser may play it far too fast.
- Forgetting Forever. It plays once and stops on the last frame.
- Frames of different sizes. You get jumps or white edges.
- Using a photo of a sky with fine gradients. Banding appears at low colour counts.
- Skipping the PSD. The GIF cannot be edited later.
Try this
Take 12 shots of one moving thing from a steady position, such as a walking person’s feet, a wave, or traffic. Load them as a stack, make frames, set 0.1 seconds, loop Forever, and export at 800 pixels wide. Then export again at 128 colours and compare the file sizes.
Want a loop where only part of the frame moves? See how to make a cinemagraph.
Want to plan a sequence of frames in camera? Read about stop motion photography.
Wondering what size and format to use for the web? See exporting photos and image file formats.
More tools for working with layers? Go to Photoshop for photographers.