Create Animated GIFs with Mac OS X Preview.app October 22, 2009
Posted by Robert Harder in : Utility , trackbackIf you open an animated GIF in Mac OS X’s Preview application, the default application for viewing images and PDFs, you may know that you can see individual frames of the animation, but did you know you can also create animated GIFs with Preview? Here’s how.
How To
For this example, we will create an animated GIF of us typing some text into a text editor. Preview sets the interframe delay to 0.1 seconds, and I have not seen a way to change that. That is a reasonable typing speed for this effect.
Open a text editor such as TextEdit, TextMate, BBEdit, etc. Resize the window so that it’s a nice, tight size that will look good on a web page.
The first thing you might notice between the screenshot above and the animated GIF at the beginning is that the shadow looks better on this screenshot. That’s because GIF images can only contain 256 different colors, and that’s not enough to see the subtle changes in the shadow.
Save this opening shot by typing Command-Shift-4. Release those keys and type Space. Now click on the text editor window. That creates a screen capture of just the window you clicked and saves it to the desktop.
Open that file in Preview. Choose Save As from the File menu. Select GIF as the file type. Name the file something meaningful like animation.gif. You can now delete the original screen capture image so you don’t accidentally duplicate it during the next steps.
We’ll want to see the sidebar so we can add images to the GIF sequence. Click the Sidebar button in the toolbar.
Let’s just add one character ‘A’ to the text editor, and add that to the sequence.
- Type ‘A’ in the text editor window.
- Type Command-Shift-4.
- Type Space.
- Click on the text editor window.
- Find the captured image on your Desktop, and drag it onto the Preview window, directly over the “animation.gif” image in the sidebar.
Your Preview window should look something like this now:
Now let’s capture several frames at once to speed this along. After each character that we type in the text editor, we’ll type Command-Shift-4, Space, and click on the text editor window, creating many screenshots saved to the desktop.
Select all of these new screenshots on the desktop, and drag them to the Preview window as shown below so that you tell Preview to add the images to the sequence you began (as opposed to simply opening more files, which it will do if you drag too low on the sidebar).
You’ve got it now. Continue with more frames, and save your GIF. Drag the GIF image to Safari or other animated GIF-enabled viewer, and enjoy. Unfortunately I haven’t found a way to loop the animation in Preview.







Comments»
Thank you Robert for a really good explanation of to (easily) create animated gifs. I have followed the steps and it works fine.
If you want to control the interframe delay, GIFBuilder is a free and easy to use tool for OS X. See http://www.nyctergatis.com/gifbuilder/
SR
Is there another way to add looping or interframe delay? Gifbuilder isn’t supported on the Intel, or OSX snow leopard.
If you like the command line, you can use ImageMagick’s “convert” command to modify the gif properties like so:
convert -delay 3 -loop 0 base.gif base-fast-repeat.gif
For that matter, you probably could have done screen captures direct to file and then used ImageMagick to build the gif directly.
-Rob
I swear, my older Mac’s Preview (10.3.9) had a button that you can place on the top toolbar that was a ‘play’ button for gifs. I cannot find it in the newest Mac Preview. But I KNOW it was there!
WOW! Great Tutorial! took me a few seconds though to figure out you were supposed to drag the GIF’s on the BASE GIF, and not on the general sidebar, but hey! it works!
My tip for you guys: if 0.1 seconds is too fast for you, what I did was to create 10 copies of each frame, and then dragged all 10 copies into the same GIF. Effectively then 10 copies played at 0.1 seconds each – resulting in a singular image that LOOKS like it plays for 1 second, but is actually a set of 10 images playing at 0.1 seconds each.
Sneaky….
Thanks for the tip!
MUCH EASIER than Photoshop…
MACS RULE!
What did you mean by drag them onto the base GIF?
When you have the sidebar open, Preview shows you all the frames within the GIF (initially just one frame). You’ll have two windows open, each with their sidebars open, and you’ll drag an image from one sidebar to the other (that is, from the “second” frame to the “base” frame). Good luck. -Rob
Doesn’t work. When I drag the second image to the drawer, it can only go above or below the first image, not over the top of it. There is no option to combine the two images, so my Preview is a non-animation version.
Same as Lance! I can only place more files above or below the existing file in the preview sidebar. I’m using Leopard; maybe this can only be done in snow leopard.
@Lance, @Al This can happen if you don’t first save the (first) image as a GIF so that Preview knows it should accept multiple images per file. See if that’s the problem.
Same problem as Lance and Al for me. Tried your suggestion, Robert, but still no joy.
Any ideas?
Thank you.
@Lance, @Al, @George Sorry, not sure what’s going wrong. It’s probably some step I’m leaving out, but I can’t see what it is. -Rob
Thanks for the tip! I used this and it works great. For loop setting I just used GIMP.
Having the same problem… can’t layer the frames. I’m on version 4.2. What version did you build the tutorial with?
@Timothy I don’t remember which version of OS X I was using when I wrote the tutorial. I’m on Snow Leopard now (Preview v5.0.3). Maybe it was introduced later. Which version of OS X has Preview 4.2? -Rob
Even though I have all the frames, when I go to save the image as a GIF, it saves only 1 frame (usually the first one selected when selecting all of them). Do I have to save all the screenshots as GIF’s?
@Jack Assuming you’ve got a recent Preview app (from earlier comments, we haven’t quite worked out when the feature was introduced), it’s possible that Preview is simply showing you multiple images in one window such as when you select a bunch of JPEGs and open them at once. The last screenshot above shows what it ought to look like when you drag a subsequent frame onto the GIF. If that’s all good-to-go, then I’m sorry, but I’m not sure what’s broken. -Rob
I’m having the same problem. I have the latest version, but it looks like our sidebars are a little different. My pictures are saved as .GIFs but their sidebars don’t have your icons on the bottom. Yours has a “six squares” icon, a “two dots” icon, a “three lines” icon, and a “pen” icon; mine shows a “gear” icon and a side scroll feature. I’m not sure why they’re different.
How would one modify this so that one could run an Automator script or an AppleScript to automatically both record and then combine this stuff on-the-fly?
Since Lion is the OS X running, Preview is not able to save as GIF. Only PDF, JPEG, JPEG2000, TIFF, PNG and EXR (I don’t know what is this one. Solutions?
Is there any way to make them loop on preview?
@macadol, by holding down the option key while clicking the drop down arrow for the save type options, you can get all the others including GIF format.. I tried for almost an hour on a 4.2(leopard) preview and had the same problem as @Lance, @Al, @George … but managed to do it on a Lion Preview.. Thanks for the tutorial!!
agree with @macadol, no GIF format. @Anteneh, are you sure you can do it on Lion Preview