Create a GIF animation of a bouncing ball
using Photoshop CC 2015.5

Introduction

This exercise will teach you how to:

Required Reading

The Exercise

Note: These instructions apply to both the Windows and Mac versions of Photoshop unless otherwise noted. This exercise is based on using Photoshop CC 2015.5 (Photoshop's version 17). I assume it will work properly using older CC versions because I did a brief test using Photoshop CC (Photoshop's version 14). A simple test was successful but I did not conduct a full step-by-step test.

Please follow these steps

Create a new Photoshop file and save it

  1. Start Photoshop CC 2015.
  2. Create a new Photoshop file as follows:
    1. Using the Photoshop menu bar select File > New >
    2. The New file dialog box will open.
    3. Complete the dialog box as shown in the image. Be sure that all the items match.
    4. And be sure to replace the text "YOUR-LAST-NAME" that is shown in the illustration with your last name!For example I would name mine: tweened-VAUGHAN
    5. Click OK
  3. The new document steps you just took do not create a file on disk. Therefore, before you start to work, use the following steps to save the file as a Photoshop psd (Photoshop document) file.
  4. File > Save
  5. Photoshop will suggest a file name based on the name you provided in the New document dialog box. Do not change the name.
  6. Click OK to create the new file.
  7. The name of the .psd file will appear in the document's tab in Photoshop. For example, my file was named:
    tweened-VAUGHAN.psd.

Create a blue circle using the ellipse tool

In Photoshop, and most other graphics programs, shapes can usually be assigned a fill color and a stroke color.

  1. In the toolbar, click and hold on the tool beneath the black arrow tool (see illustration below).
  2. A fly-out menu will appear displaying related tools that are grouped together.
  3. Slide over and down to select the Ellipse Tool



  4. After you have selected the Ellipse Tool, look at the area a the top of the Photoshop window.
  5. There you will see the Options bar control panel - more familiarly referred to as the Options bar. The Options bar shows options related to the current tool or selection. Below is the options bar for the ellipse tool. Your Options bar ought to appear similarly although your colors and values are probably different:




  6. Click on the Fill selector. It is green in the illustration above, but probably a different color in your options bar.
  7. A fill chooser panel will drop down with a row of four rectangles at the top. The rectangles provide options for different fill options as shown in the illustration below:


    • No color - means transparent. When this is selected for the fill, the shape will reveal anything that is obscured by it, such as a background color or shape.
    • Solid color - this means a plain unvarying color of your choice.
    • Gradient - this allows for a fill that has varying colors. You can have one of many color variations but they are limited to either linear or radial in progression.
    • Pattern - the shape can be filled with a pattern. Such patterns are available online or you can make your own. Usually such patterns must be based on images that are seamless and will look correct when tiled. More information.
  8. Click on the Solid color option, which is the black rectangle labeled above.
  9. In the color palette area select the pure blue color swatch as follows:
    • Hover over the color swatch in the color palette that has the screen hint RGB Blue as shown in the illustration below and also indicated by the diagonally patterned outline provided for illustration purposes.
      • Note that the color that you select now is irrelevant to the final outcome of the exercise. This is because the gradient overlay that you will create later will appear on top of the color selected here. I ask you to do this color selection now so that you become familiar with selecting a color from a color palette and using the screen hints that are provided with it.




  10. In the context of shapes, a stroke is the outer border, or edge, of a shape. (There are other types of strokes in Photoshop such as brush strokes). You do not want to have an outer edge for the shape because it needs to eventually look three dimensional, that is, it will need to appear to be a sphere.
    1. Click on the Stroke color selector (in the illustration below it is the upper red rectangle).
    2. The stroke chooser will open. It is identical to the fill chooser and therefore easily confused with it.
    3. Select the option with the red diagonal line through it, as shown in the illustration below within the lower red rectangular outline.
    4. The red diagonal line indicates that no color will be used - the stroke will be transparent. In practical terms this means that the circle will have no border.
    5. A red diagonal line will then appear in the Stroke color selector, which is indicated by the upper red rectangle in the illustration below.




  11. Next, using your left mouse button carefully click only once near the upper left corner of the white background of your photoshop image.
    • Do not click and hold
    • Do not click and drag.
  12. The Create Ellipse dialog opens. (see below)
  13. Enter a value of 100px for both the Width and the Height as shown below. (Note that an ellipse with an equal height and width is a circle.)



  14. Click OK.
  15. Click on the tool that looks like a black arrow which you will find in the toolbar above the ellipse tool. It is called the Path Selection tool.
  16. Using it, click on your shape (but not on an edge or the very center) and then drag it into a position in the top left section of the image area, similar to what you see in the illustration below. Note that in the illustration below, the black handles (also called control points) indicate that the circle is currently selected.




Using the Layers panel to rename a layer

  1. Find the Layers panel. If you don't see it, use the Window menu to select Layers.
  2. In the Layers panel there ought to be a layer with the default name of Ellipse 1. This layer holds the circle shape within it.
  3. Double-click on the name of that layer so that you can change the name.
  4. Enter a new layer name: ball as shown below:



  5. Be sure that your shape is selected, if it is not, use the black arrow tool to click on it to select it.


Introduction to Layer Styles

Following this brief section you will be creating a layer style. Before doing it, I want you to have some basic information about them:

 

What is a color gradient?

A color gradient is, typically, a gradual blending from one color to another.

A linear gradient is spread in a line, in one direction. A horizontal linear gradient of the full spectrum of visible light:

A radial gradient spreads from one point outward and evenly in all directions.

Below are examples of radial gradients that transition from an inner light blue to a darker blue on the outside edge of the gradient. Note that the following examples are very similar to what you will be creating. The circle on the left is a radial gradient that is centered relative to the shape. The circle on the right uses the same gradient but its center is up and to the left, creating the illusion of a sphere or ball.

Radial gradient radiating from the center of the circle

Radial graident radiating from the center of the circle

Radial gradient radiating from the upper left

 

Creating Gradient Overlay layer style

It's important that you do NOT start experimenting with layer styles until you have finished the exercise. However, I encourage you to do so in a separate file after you have completed this exercise.

  1. Be sure that that the layer with your circle is selected.
  2. Select in the Layer menu > Layer Style > Gradient Overlay... as per the illustration below. Another method for creating a Layer Style is to click on the fx button at the bottom of the Layers panel:



    Layer style dialog box Styles list
  3. The Layer Style dialog box will open.

Editing the gradient

  1. Your Layer Style dialog box ought to be open.
  2. Carefully make all of the settings illustrated below.
  3. Next, click on the Gradient sample as shown below:



  4. The Gradient Editor dialog box will open, shown below.
  5. About Stops
    • Gradient Stops are represented by the little squares with triangles that are located above and underneath the horizontal band that represents the gradient.
    • The squares represent:
      • Above the gradient they represent the opacity at that location. The opacity is represented by the following;
        • white = completely transparent, that is, no color will be seen at that location in the gradient.
        • black = completely opaque, meaning that the color is unaffected.
        • shades of gray = partial opacity
      • The stops underneath the gradient represent the color which can be seen within the stop.
    • The value of an opacity stop is set by first selecting an opacity stop and then in the Stops area of the dialog entering a percentage value into the Opacity field. The color of an opacity stop will be black, white, or a shade of gray depending on the opacity value.
    • The color value of a color stop can be changed by double-clicking on the stop which will open the dialog box: Color Picker (Stop Color).
    • The triangles point to the location on the gradient where the setting of the stop takes effect.
    • A selected stop will have a black triangle instead of a white triangle.

    • When a stop is selected any color or opacity that you set will be applied at that point in the gradient.
    • Note that the gradient is represented as horizontal linear gradient. However, it is also used to represent radial gradient settings.
    • Also note that additional stops with other values can be added by clicking below or above the gradient for either opacity or color respectively.
      • By default, the value of the stop will be the opacity or color at the location you click. This initial value can be easily changed using the methods mentioned above in this section.
      • Any stop can be removed by click-dragging it up or down and releasing the mouse button.
      • There must always be a minimum of one stop.
    • The following illustration provides information about the stops used in the Gradient Editor:


  6. Color and gradient stops shown on the gradient barSet the color stops for the radial gradient that you will use as follows:
    1. Double-click on the stop in the lower left of the gradient bar.
    2. This will open the Color Picker (Stop Color) dialog (illustrated on the right).
    3. At the bottom of this dialog box is a field identified only by a # hash tag (see the red box in illustration) and it contains what is called a hexadecimal color code.
    4. The field in the illustration contains the hexadecimal code for the color used for the stop. Set the value in that field of your Color Picker to 183bab
    5. Then click OK.
    6. Next, double-click on the lower right side stop.
    7. Set the hexadecimal number to deeaf9
    8. Click OK.
  7. Click OK to close the Gradient Editor.
    • Note: If you need to change the gradient overlay settings in the future, simply double click on the words Gradient Overlay under the word Effect in the Layer panel. Then the Layer Style dialog box will open with Gradient Overlay selected in the left column. You can then make changes.

Positioning the highlight for the ball

  1. Your Layer Style panel ought to look something like this now:



  2. When this dialog box is open you can manually reposition the center point of the gradient. The center of your gradient is the lightest part.
  3. To move the gradient, leave the Layer Style dialog box open and have the Gradient Overlay style still selected.
  4. Click and hold on the gradient in your image, not the one in the dialog box.
    1. If you cannot see the circle in your image, move the dialog box away so that you can.
  5. Drag the gradient up to the left, as per this animated illustration:



  6. Click OK to close the Layer Style dialog box.

 

What are frames?

 

Animation

You are now ready to create the animation. The objective is to make the ball start high on the left side, drop to the middle of the bottom, go to the upper right side, and then return back again. You will then set the animation to repeat endlessly.

  1. Open the Timeline panel: Window menu > Timeline
  2. Click the button shown below. A two item menu will appear. Select Create Frame Animation



  3. As soon as you make that menu selection, your first frame will appear in the timeline.
  4. It ought to be selected as is indicated by a light gray shading around the frame's thumbnail image.
  5. Next, click once on the button shown below in the red box which will add an identical copy of the first frame.



  6. Next, select frame 2 (it should already be selected). Again, you can tell it's selected due to the light gray shading around its thumbnail image.
  7. Select the Move tool (V) at the top of the toolbar.
  8. Click on the ball in the main viewing area (not in the frame's thumbnail) and reposition it to the bottom center of the frame as shown in the illustration below.
  9. The image below is what you ought to end up with.
  10. Select both frame 1 and 2 by Shift-clicking on frame 1 (this assumes that frame 2 is already selected).
  11. Next, you will let the computer create frames to go in-between the two positions of the ball in the frames. This is a procedure called tweening.
    • Tweening expedites the animation process by generating frames to go between a beginning and end frame.
  12. Click on the button shown in the small red box at the bottom of the illustration below. The tooltip of the button is also visible there. The Tween dialog box will open as shown below. Enter 3 into the Frames to Add field. Do not change the other settings:




  13. Click OK.
  14. Below is an image of what you ought to see now: five frames with perfect spacing between the positions of the balls in each frame:



  15. Next, be sure that only frame five is selected. Click on the new frame button, seen in the red box above.
  16. A copy of frame 5 has been made named frame 6 (what a surprise!).
  17. Select frame 6, then move the ball to the top right corner. (See frame 9 of the illustration below).
  18. Now shift-click on frames 5 and 6 to select them both.
  19. Click on the Tweens button again.
  20. Enter the same value of 3 frames.
  21. Click OK.
  22. Now you have added the ball bouncing up to the right.
  23. Select all nine of your frames by selecting the first frame, holding down the Shift key, then selecting the last frame.
  24. Click on the little 0 sec. menu on any of the frames.
  25. A menu of display time lengths is show. This menu is used to set the length of time that the selected frames will be shown.
  26. Select 0.1 - this will set the display time to 1/10 of a second for all of your frames as illustrated:



  27. Now click on the Once menu button in the lower left of the Timeline panel.
  28. Select Forever. This will result in the frames in the animation being repeated endlessly.
  29. Click the play button beneath the timeline and your animation will play.
  30. Click the stop button (the square) to stop the animation playback.
  31. Select frames 2-8 by first clicking on frame 2, then pressing and holding down the Shift key, and then clicking on frame 8.
  32. Then use the small menu in the far upper right the Timeline panel and select Copy Frame, shown below:



  33. Select your last frame, frame 9.
  34. Return to the same menu and this time select Paste Frames...
  35. The Paste Frames dialog box opens.
  36. Select Paste After Selection if it is not already selected, as shown below:



  37. Click OK
  38. You ought to now have a copy of those frames placed after frame 9. The new frames will be numbered 10-16. Those frames ought to be selected. Leave the frames selected.
  39. Once again, use the small menu button on the far right side of the Timeline panel and open its menu.
  40. Select Reverse Frames
    This illustration shows the three steps you just took:



  41. Play the animation and it ought to look satisfactory.
  42. You may want to select all the frames and set the frame rate to 0.1 sec. to speed it up. I think that will provide much more satisfactory results.

Export the animated GIF

  1. The last step is to export the animation as an animated GIF.
  2. File > Export > Save for Web (Legacy)...
  3. Make the same settings as you see in the red boxes in the illustration to the right.
    1. But note that it does not matter what frame of the sixteen is shown in the Animation section on the bottom.
    2. If you want to, take another look at your amazing animation using the play button near the bottom.
  4. Click the Save button to save your animated gif file using the name automatically provided, which is the same name as your photoshop file but with the .gif file extension at the end.
  5. Now be sure to File > Save your Photoshop file.
  6. Create a folder named tweened-YOUR-LAST-NAME (replace YOUR-LAST-NAME with your last name!)
  7. Put both your .gif file and your .psd file into that folder.
  8. Compress the folder as a .zip or .rar file.
  9. Submit the compressed file.

You are advised to read more about using the Save for Web command for image optimization (compression).

Below is the absolutely phenomenal result - it was certainly worth all the effort...right?

For more information:

Photoshop Help / Create timeline animations

Photoshop Help / Create frame animations

Create an animated GIF in Photoshop