jump to navigation

Create Animated GIFs with Mac OS X Preview.app October 22, 2009

Posted by Robert Harder in Utility.
Tags: , , ,
trackback

If 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.

All Your Base Are Belong To Us

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.

Blank Document

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.

Saved as GIF

We’ll want to see the sidebar so we can add images to the GIF sequence. Click the Sidebar button in the toolbar.

With Sidebar Showing

Let’s just add one character ‘A’ to the text editor, and add that to the sequence.

  1. Type ‘A’ in the text editor window.
  2. Type Command-Shift-4.
  3. Type Space.
  4. Click on the text editor window.
  5. Find the captured image on your Desktop, and drag it onto the Preview window, directly over the “animation.gif” image in the sidebar.

Dragging Image Over First Frame

Your Preview window should look something like this now:

After Two Frames

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).

Dragging Several Files

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»

1. Sigi Reich - May 27, 2010

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

2. Adrian Boeing - August 3, 2010

Is there another way to add looping or interframe delay? Gifbuilder isn’t supported on the Intel, or OSX snow leopard.

3. Robert Harder - August 4, 2010

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

4. rueli - September 9, 2010

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!

5. Vic - December 7, 2010

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!

6. Luso - January 22, 2011

What did you mean by drag them onto the base GIF?

7. Robert Harder - January 25, 2011

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

8. Lance - February 15, 2011

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.

9. Al - February 26, 2011

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.

10. Robert Harder - March 9, 2011

@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.

11. George - March 30, 2011

Same problem as Lance and Al for me. Tried your suggestion, Robert, but still no joy.

Any ideas?

Thank you.

12. Robert Harder - March 30, 2011

@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

13. Kristie Satterly - April 21, 2011

Thanks for the tip! I used this and it works great. For loop setting I just used GIMP.

14. Timothy McKean - May 3, 2011

Having the same problem… can’t layer the frames. I’m on version 4.2. What version did you build the tutorial with?

15. Robert Harder - May 3, 2011

@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

16. Jack - June 5, 2011

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?

17. Robert Harder - June 6, 2011

@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

18. Kenny - September 7, 2011

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.

19. esaruoho - November 22, 2011

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?

20. macadol - January 15, 2012

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?

21. Jordon Jasper - February 1, 2012

Is there any way to make them loop on preview?

22. Anteneh - March 7, 2012

@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!!

23. Wayne - April 2, 2012

agree with @macadol, no GIF format. @Anteneh, are you sure you can do it on Lion Preview

24. Bay Sweetwter - August 18, 2012

@mcadol and Wayne; Open Preview, Export, then press Option key and hold as you click the Format drop down list. Lots more choices, including gifs.

25. Bay Sweetwater - August 18, 2012

Anteneh, if you’re still reading this, can you tell us what exactly you did on Lion after you got all your gifs into Preview? I’ve got that far, but I can’t save it. Thx!

26. kirpi - September 5, 2012

I just tried it and it plain works.
Thank you for the trick.

27. Ashok Maurya - December 24, 2012

well, image sequencing on preview is not available in Mac Lion. Is there a way out?

28. NYE2013 - January 6, 2013

Thanks Bay Sweetwater. But the guys at Apple sure are trying to make life as difficult as possible for their customers, hiding away more and more options that used to be in the open. Like the dock left button
.

29. David Whittington - March 12, 2014

Just use Quick Look vs. Preview to view your animation.

30. giá ôtô cũ - October 20, 2014

giá ôtô cũ

Think Harder » Create Animated GIFs with Mac OS X Preview.app

31. Joshua See - November 7, 2014

Open an existing GIF in Preview, duplicate it, then replace its contents with the to get around the save as GIF limitation. Works as of 10.9, Mavericks.

32. lafber - February 5, 2015

You can save as gif using preview, using ALT key when you choose the format !

33. junebeetle - March 9, 2015

Epic! Thank you so much 🙂

34. cheap giuseppe zanotti shoes - December 20, 2015

Heya i’m for the primary time here. I found this board
and I in finding It really helpful & it helped me out much.
I hope to provide something again and aid others such as you helped me.

35. รับถ่ายวีดีโอ - March 19, 2016

of course like your web site but you need to check the spelling on quite a
few of your posts. A number of them are rife with spelling issues and I in finding it
very troublesome to tell the reality however I’ll surely come again again.

36. Boca RestaUrant - May 3, 2020

There is certainly a great deal to know about this topic.

I like all of the points you made.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: