All Articles After Effects
Parallax Tutorial: 2D to 3D with Photoshop & After Effects– Part 2
Richard Lainhart on Sun, April 10th | 0 comments
In Part 1 of our tutorial, we began the process of turning a static 2D image into a 3D animation by opening the image and isolating each major section of the image onto its own layer in Photoshop. In

In Part 1 of our tutorial, we began the process of turning a static 2D image into a 3D animation by opening the image and isolating each major section of the image onto its own layer in Photoshop.

In Part 2, we're going to continue in Photoshop to fill in the empty areas in the image left by isolating the sections. Then we'll move over to After Effects to put the layers into 3D space and complete the animation.

Step 6 - Fill in the Gaps

Now comes the tricky part, if what went before wasn't tricky enough for you. You may have figured out by now that if we were to bring this Photoshop image in its current state into After Effects, separate each layer in space on its own 3D layer, and start to move around the layers with a camera, we'd immediately see the empty spaces in the rearward layers where we cut out the forward layers. And you'd be right.

So what we need to do is a little fancy Photoshop work to fill in the missing parts of the image with pixels so that we don't see any gaps. For that, we'll use the Clone Stamp tool. With the Clone Stamp, we'll pick up pixels from other parts of the image and paint them into the missing areas to create the illusion of a continuous image on each layer. It won't be perfect, but it will be good enough to fool the eye.

We don't need to worry about the Sailors layer, as that will be in front. But we will have to fill in the gaps in the Water and City layers. Let's start with the Water. Turn off the visibility for the other layers, make sure the Water layer is selected, disable any pixel selection in the layer (Select > Deselect or Command-D), and choose the Clone Stamp tool. For this, choose a good-sized soft brush, and leave the other settings at their defaults:

Then Option-click somewhere in the water to set the clone point, and start painting in the empty areas of the image with water pixels:

Fortunately, because this water is pretty undifferentiated, we don't have to worry too much about repeating pixels or obvious cloning. Just remember to Option-click regularly in the existing water pixels to clone from a different point, and watch out for edges in the image you may hit. If you do hit some edges, just clone them over with pixels from elsewhere. Your objective is to fill in the entire cut-out area with reasonable-looking water:

Note: I've cloned in water well above the waterline cutoff point; you'll see why shortly.

But for now, we're done with the water.

Step 7 - Paint In the City

This will be a little trickier, because the city buildings are more familiar, regular shapes, but there's not as much to paint in, and we have a good stock of other buildings in the image to clone from. Because we're painting in more detail, start with a smaller brush, say 25 pixels or so, and pick a clone point well outside the empty area. This layer will be well within the background, and we'll take advantage of the general fuzziness and high detail of this area of the image to fill in the gaps with other building sections. I would suggest painting with horizontal strokes only, since the buildings have such strong horizontal lines, but there's nothing wrong with combining pieces of several building into our new cloned buildings:

As before, continue cloning until all the cut-out area is filled in. Unlike before, though, we don't need to clone below the waterline:

If you look closely, you'll see some odd-looking buildings in the filled-in area, but nothing that is too obtrusive - this will certainly work for our purposes.

Save your changes, and we're done in Photoshop! The final steps in After Effects won't take nearly as long. So, let's bounce over to AE and wrap this up.

Step 8 - Import the Photoshop File

We want to make sure we don't lose any of our hard work when we bring this complex Photoshop file into After Effects, so choose File > Import > File..., navigate to where you saved your Photoshop masterpiece, select it, and set the Import As... popup menu to Composition. In the subsequent import dialog, accept the defaults and click OK:

Step 9 - Set Up the 3D Composition

We're almost there. We've imported the Photoshop file as a composition, which means that each layer in the original Photoshop file will now be a separate layer in the new composition, including the original layers' transparency information and even their order in the Layer palette.

So, double-click the new composition, and drag its layers (if they aren't already in this order) so that the Sailors are on top, the Water in the middle, and the City at the bottom. (If some of your layers weren't visible because of their order, this should fix that. The Water, though, will probably still cover the City, because of the extra pixels we painted in earlier.) You can leave the original Background in for reference if  you want, but turn off its visibility. Next, make each layer 3D by clicking on the 3D Layer button (the cube) for each layer in the Timeline:

At this point, it still looks like the sailors are lost at sea, because we still can't see the city, but we'll fix that shortly:

Next, add a Camera to the comp by choosing Layer > New > Camera... and accept the default settings.

Now we're ready to set up the layers in space. Select the Sailors layer, type "P" to solo its Position properties, and note that it now has three position properties - X, Y, and Z. Z is depth, so let's move the Sailors layer forward by dragging the Z Position value into the negative range - in my case, about -340. This will move the Sailors layer well in front of the other two.

Next solo Position for the City layer, and set its Z Position to 200. This will move that layer back in space, although we still can't see most of it because of the water:

With the City layer still selected, type Shift-S to add Scale to its soloed properties, and scale it up to 120% or so, so it fills the frame. Now, select the Water layer, and type "P" to solo Position, Shift-R to add Rotation to the soloed properties, and Shift-S to add Scale as well. Set its X Rotation to -45 degrees, which will rotate the water away from the camera and give it a receding perspective. (The water is a plane that connects foreground to background, so rotating it like this will help to emphasize the distance between front and back when we animate the camera.) Then set its Y Position (the middle one) to about 1120 to reveal the city at last and get the sailors out of the water, and set its Scale to about 120, so it fills the frame. The water should be positioned so it just intersects the city at the waterline. All the properties for the three layers should look something like this:

And the comp image should look something like this:

Step 10 - Animate the Camera

Our last step is to animate our camera to add some motion to the scene and set parallax to work. We'll also take the opportunity to tweak the layer settings. So, with the Camera selected, type "P" to solo its Position properties, and enable keyframing on Frame 0 for Position. Move the Camera to the right by increasing its X Position to 530 or so, move it down in the frame (so it shoots from a lower position and moves the sailors up in the frame) by increasing its Y Position to 780 or so, and zoom it in a bit by decreasing its Z Position to -775 or so as shown, which will bring the sailors much closer:

Move the Timeline to the 10 second point, and animate the camera up, in, and to the left by setting the X, Y, and Z Position values to roughly 420, 600, and -700, respectively:

Finally, select both those Position keyframes and apply Easy Ease to them (Animation > Keyframe Assistant > Easy Ease), for a nice smooth camera move.

You may need to adjust the scaling or positioning of the layers at this point so that you don't see any edges once you animate the camera. When you have the layers set to your liking, render out the comp (which I've scaled and placed in another 720p comp for YouTube compatibility), and you should see something like this:

And that's it! Notice that parallax gives a strong impression of layers of images at different distances from the eyes, as the camera moves up to reveal the city. Try different camera moves and layer positions and rotations to see what happens. Above all, experiment, and have fun!

Comments (0)

You must be logged in to comment. Login Now

Course Advisor
Don't Know Where To Start?
Ask A Course Advisor
Ask Us!
Copy the link below and paste it into an email, forum, or Facebook to share this with your friends.
Make money when you share our links
Become a Affiliate!
The current affiliate rate is: 50%
Classes Start Next Week!
Live 8-week Online Certification Classes for: