Animating Graphic Textures
You've already learned how to create looping backgrounds using After Effects; however, things are going to get better with a little teamwork. By combining the power of Photoshop and After Effects, you can create even more customized looping backgrounds. Because Photoshop is a rich graphics tool, much more variety can be had in the final result.
Let's explore two very different techniques that both produce excellent results:
- Seamless patterns. By using seamless patterns and the Offset command, looping backgrounds are a snap.
- Gentle fade. Knowing how to bury a transition can make looping a texture easy.
The Offset Technique
You'll first use seamless patterns and the Offset command to create a background. This underused technique wraps an image around your document. In other words, pixels push from one side and reappear on the opposite side. Depending on the desired movement of your background, you can offset horizontally, vertically, or both.
The technique is fairly straightforward and is easy to use. To begin, let's create two seamless patterns in Photoshop.
Building the First Pattern
The use of seamless patterns is a great way to make a repeating texture. There are many ways to go about creating a specialized texture; we prefer the simplest route. It is best to offset several simple layers than one complex layer. This will introduce more motion into the animated background.
- Launch Photoshop and create a new document sized for video. For this example, choose the Film & Video > HDV/HDTV 720p preset (Figure 7.14).
Figure 7.14 Stick with the Photoshop document presets to ensure properly sized video files.
Load the Default colors of black and white by pressing the D key, and then run the Clouds filter (Filter > Render > Clouds).
Now the cloud pattern needs to be offset. This filter pushes an image off the screen and rewraps the pixel data to the other side of the image.
- Offset the image 600 pixels horizontally (Filter > Other > Offset). Be sure to specify that you want the pixels to wrap around the edge. If you want to move the background vertically, you must offset vertically. If you want to move the background diagonally, offset horizontally and vertically.
- If visible, blend away the seams. Use the Spot Healing Brush (J) with soft edges. If needed, you can follow up with the Clone Stamp tool.
- Repeat the Offset filter by pressing Command+F (Ctrl+F) to check for seams. Clone or heal as needed. Repeat until the seams are invisible (Figure 7.15).
Figure 7.15 Check the pattern with the Offset filter to look for any seams.
- Save the layer as a TIFF file that After Effects will recognize.
Building the Second Pattern
To create a sense of movement, two textures must be moved across each other. You now have a simple background that can be looped. To complement this simple element, you can build additional textures or objects. Here is one additional recipe for another layer:
- Create another new document sized with the Film & Video > HDV/HDTV 720p preset.
- Make a radial gradient fill layer from black to white (Figure 7.16) or draw a radial gradient (flatten the image if necessary).
Figure 7.16 Be sure the gradient stays centered on the screen (an easy way to do this is to use the Gradient fill layer).
- Run the following filters (in this order).
- Run the Twirl filter set to 400 pixels eight times (Filter > Distort > Twirl).
- Run the Motion Blur (Filter > Blur > Motion Blur) at a -90° angle and a distance of approximately 350 pixels.
- Run the Maximum filter set to 30 pixels to smooth out the texture (Filter > Other > Maximum) (Figure 7.17).
Figure 7.17 This pattern is designed to be offset horizontally because both edges fade to black.
- Save the layer as a TIFF file that After Effects will recognize.
Animating in After Effects
Once the textures are built, you can animate them in After Effects. By employing a few simple technologies (blending modes, scaling, the Offset filter, and color mapping) natural, organic motion can be achieved.
To start, create a new project and import the two graphics you just created. Drag both graphics on the new composition icon located at the bottom of the Project panel. A dialog box appears asking you for specifics on the new comp. Choose to create a Single Composition and use a duration between 15:00 and 30:00. Set the composition size to match your source graphics (in this case you'll use HDTV 720p and a frame rate of 24p).
- Select both layers in the Timeline and press Command+D (Ctrl+D) to duplicate them. Working with multiple copies of the same layer will create the illusion of depth (similar to the Perlin noise you read about earlier).
- Rearrange your Timeline so you have a 1/2/1/2 stack (Figure 7.18). Then turn off the visibility icon for the top three layers.
Figure 7.18 Using multiple copies creates the illusion of depth without a big increase in render time.
Select the bottom layer and apply the Offset effect (Effect > Distort > Offset).
The Offset effect is very simple to use once you understand it. You choose to keyframe how much the center of a layer is offset (using the Shift Center To property). Add a keyframe at the start of the layer for the default position; you can leave this keyframe unmodified.
Go to the end of the layer and add a second keyframe for the Shift Center To property.
Double-click on the keyframe to adjust its value. Change its measurement Units to % of composition. The keyframe currently reads 50% for both the X- and Y-axis. By adding a full 100%, the image will complete one full offset cycle. For this example, enter a value of 250% in the X-axis field to move two full cycles (Figure 7.19). Activate RAM preview to see your results. You should now have two full rotations.
Figure 7.19 By choosing the % of composition method, you can avoid doing math in your head. Just add a whole number for each rotation. In other words, 50% + 1 rotation = 150%; 2 rotations = 250%.
- Activate Layer #3 and repeat the offset technique described in steps 3 and 4. Add a keyframe at the start of the layer for the default position and then at the end of the layer for three reverse rotations (–350%, 50%).
- Adjust the blending mode and/or opacity of Layer #3 to achieve a soft look. In the example project, we used Overlay mode.
- Activate Layer #2 and scale to 200% (it's okay in this case to scale up, because we just have a soft texture.)
Select Layer #4 and press U to see all the keyframes.
Move your playhead to the start of the composition, and then click the word Offset for Layer #4. Copy the keyframes by pressing Command+C (Ctrl+C). Select Layer #2 and paste the offset keyframes.
- Adjust the blending mode and/or opacity of Layer #2 to achieve a soft look. In the example project, we used Multiply mode.
- Activate Layer #1 and scale to 200%.
Select Layer #3 and press U to see all the keyframes.
Move your playhead to the start of the composition, and then click the word Offset for Layer #3. Copy the keyframes by pressing Command+C (Ctrl+C). Select Layer #1 and paste the offset keyframes.
- Adjust the blending mode and/or opacity of Layer #1 (remember Shift++ and Shift+- also work in After Effects to cycle blending/transfer modes). In the example project, we used Soft Light mode at 70% opacity.
Add an adjustment layer at the top of your stack (Layer > New > Adjustment Layer).
Apply a colorization effect, such as Colorama, CC Toner, or Tint. In the example, we chose Colorama with the Output Cycle set to the Ramp Red preset (Figure 7.20). You can also experiment with other effects on the adjustment layer, such as glows, blurs, or third-party effects.
Figure 7.20 You can use a Levels effect to clamp the Output Black or White points to keep the backdrop from becoming too bright.
- Make sure all your quality switches are set to Best Quality, and render at the proper settings for your nonlinear editing or motion graphics application.
The Stitch in Time Technique
The second animating technique we'll show you is deceptively simple but produces great results. By using blending modes and a well-placed dissolve, it's possible to create a looping background. This technique is very versatile and will work with virtually any source layers. For this technique, you'll take three or more gradients made in Photoshop and blend them together using After Effects. These gradients can be grayscale photos, filtered layers, or preexisting files.
Preparing Textures with Photoshop
For this technique to work, you'll want to use a group of oversized grayscale textures (Figure 7.21). You could scale and filter in After Effects, but that is the slower method. Instead of scaling up and manipulating color and tone across time, you can process the images once they are in Photoshop and speed up rendering times.
Here's a few ways to put Photoshop to use:
- Take advantage of Photoshop's excellent scaling abilities. By enlarging the gradients in Photoshop, you'll only need to scale down in After Effects.
- Use Photoshop's Nearest Neighbor scaling method to resize your images. You can access it in the Image Size dialog box (Image > Image Size) from the Resample Image menu.
- Soften any artifacts using the Median filter (Filter > Noise > Median). A low value of 5–10 pixels should be sufficient.
- Defocus textures with the Lens Blur filter (Filter > Blur > Lens Blur). Adjust the filter to taste, but favor an out-of-focus image. Click OK when you're satisfied.
- Remove any color from the texture using a Black & White adjustment layer. Be sure to flatten your final results.
Creating Motion with After Effects
Now that your assets are ready, you can animate the layers in After Effects to create movement. The process is very easy; you'll just use basic Transform properties like Anchor Point, Scale, and Rotation. The technique demonstrated can be used to create simple or complex flowing grayscale images. The goal is to combine multiple images in one composition and then map color to them to achieve a finished background.
Building the Composition
Start by creating a new project or adding the newly created textures to an existing project. Drag three or four graphics on the new composition icon located at the bottom of the Composition panel. A dialog box appears asking you for specifics on the new composition. Choose to create a Single Composition and a duration between 18:00 and 33:00. Set the composition size to match your source graphics (in this case you'll use HDTV 720p and a frame rate of 24p). The extra 3:00 will be used to create the overlap zone, so be sure to pad your initial duration.
Disable the visibility for all but the bottom layer. Select the bottom layer and press S for scale. Then hold down the Shift key and press R for Rotation and A for Anchor Point. By using Anchor Point instead of Position you'll get better results (especially when rotation is involved). Turn on the stopwatch icons for all three properties. Choose random values for the start keyframes. Move the current time indicator to the end of the composition and set different values. All you're trying to accomplish is movement (just be sure that the image always fills the entire screen with no visible gaps at the edges) (Figure 7.22). The goal is to create varied motion with keyframes and then blend the layers together. Be sure to keep experimenting as you design.
Figure 7.22 By zooming your canvas to a lower magnification, it's easier to see the edges for each layer. You can also change the label colors to make it easier to see each layer.
Invoke a RAM preview to see your results. The image looks pretty simple so far; it's just a sliding and scaling gray texture. But add a few more of these textures and motion will really start to take shape.
Activate the next layer and repeat the animation technique. Try to achieve a different motion path (thus creating "visual interference"). Try moving the texture in a different direction and at a different speed than the first layer. When you're satisfied, adjust the blending mode and/or opacity of the second layer to achieve a soft look. We favor modes like Overlay, Multiply, Soft Light, and Add.
Continue to animate your remaining layers:
- Keep the movement speed relatively slow. Most backgrounds should appear soft and flowing.
- Feel free to duplicate an existing layer and apply slightly different keyframe values. This often creates a natural drift.
- You can reverse the keyframes on a layer by using the reverse keyframe assistant (Animation > Keyframe Assistant > Time-Reverse Keyframes).
- Be sure to try different blending modes. You can select a layer and use the shortcut Shift+= to cycle through modes. Try out several options because different layers blend to produce dramatic variations.
- Use your RAM preview to see your results as you build the composition.
- Do not add color or blur effects yet.
Creating the Loop
Once you have a flowing background, its time to make it loop. To do this, you'll need to create a split and a fade. Highlight all your layers and create a precomposition by choosing Layer > Pre-compose and name it Pattern Pre-comp (Figure 7.23). This nests all the layers into an intermediate composition.
Figure 7.23 The Pre-compose command nests multiple layers into a new composition. This makes them easier to work with as a group.
Next, you need to shorten the main composition by 3:00 (the overlap you created earlier). Access your composition settings by pressing Command+K (Ctrl+K) and shorten the composition by 3:00. In other words, change the duration from 33:00 to 30:00.
Drag to the center duration of the composition. There's no need to be precise; just move about halfway down the Timeline. You can now split the layer in half, thus creating a loop point.
- Select the layer and press Shift+Command+D (Shift+Ctrl+D) to split the layer (Figure 7.24).
Figure 7.24 Splitting a layer allows for overlapping (which creates the loop).
- Now you must overlap the layers. With Layer #1 active, jump to the start of the composition by pressing the Home key. Press the left bracket key ([) to move the layer's In point.
- Select Layer #2, and then press the End key. Press the right bracket key (]) to move the layer's In point.
- Activate Layer #1 and press O to jump to the layer's Out point. Press T for opacity, activate the stopwatch, and set a keyframe for 0% opacity.
- Drag backwards three seconds and set a key frame for 100% opacity. This creates a gentle dissolve at the overlap point (Figure 7.25).
Figure 7.25 Carefully place your opacity keyframes to create a fade between the two layers.
RAM preview the composition to see the seamless animation. Now that you have a loop, you can further stylize it. We recommend the use of adjustment layers and any of the techniques you've learned so far. We usually start with a blur effect (such as Fast Blur or CC Radial Fast Blur). We then apply a colorization effect, such as Colorama, Tint, or CC Toner (Figure 7.26). Once you've stylized the composition, you can render it at the proper settings for your nonlinear editing, multimedia, or motion graphics application.
Figure 7.26 Stylize the background to add color and de-focus.