Displacement in PS & AE

In this lesson, I learned how to produce a 3D effect using a displacement map image and photo in Photoshop and After Effects. As always, we first looked at the definition of displacement, which I wasn’t sure about before. I also found a really cool gif similar to the one that was used on the PowerPoint as an example. They showcase the term quite well visually.

 

 

Displacement: when an object moves relevant to a reference frame, its change in position is known as displacement. In other words, displacement is defined to be the change in position of an object, implying that it has been moved.

 

 

After learning this simple meaning, I could guess that a displacement map had something to do with mapping out movement in some way. This was somewhat true but a displacement map, also known as a height map, is actually a grayscale texture or version of the image which utilises black and white pixels. Black pixels equal to 0 are the base of the surface and the white pixels equal to 1 are the textures on top that come out of the base. Anything in-between equates to the height. In 2D, displacement can occur on a maximum of two axis, which is what we did today. Because we used photos, the X and Y axis gave off that almost-parallax-like effect. In 3D however, you can displace a surface on a maximum of 3 axis, since depth is also involved.

 

 

There are also other maps you can utilize for such an effect, such as a bump map (grayscale) which adds a subtle shading effect to a surface, or a normal map displacement that uses RGB values to give height and direction.

 

 

So how can this be applied to images? The process is achieved through the use of Photoshop to create the map, and After Effects to apply it. The image is brought in and used as a guide for which areas to displace, after which both the image and the map are brought into After Effects where the photo is turned into a fake 3d one. When choosing our photos, we were told to be mindful of how complex the image is since it makes the process longer and more difficult and we only have the timeframe of about an hour to work. Other than that though, it could be anything and my choice was a deer since it is relevant to my project and I felt that it would be beneficial to apply the effect to this.

 

 

Creating the Map in Photoshop

 

With the program open and the image locked and loaded in its own layer as the background, we could begin with the first step to faux 3D. We created a new layer and filled this in with black, which was then hidden away so that we could focus on the white pixels. Since black is furthest away, that layer was like our base, and the ones on top would be the things coming out. To create them, we added a new layer on top and using a soft, white brush, started painting in the image. Because this was only the first layer, I covered the entire deer, foreground and ground at the back as well but I left the background out for obvious reasons.

 

This is where I was just starting to fill the deer in

 

After we were satisfied with the first layer, we were told to bring the opacity down to 10%. Initially, I was confused as to why, but I realised pretty quickly that you need to build up the whites for that 3d effect, otherwise it would all be one solid block. I liked the fact that I was able to unhide the black layer at any time to see how the map was looking, and I did this throughout so that I could check my progress, or for any black spots or gaps that I might have missed. It helps to see the map against the black background since with the photo, you could miss a spot.

 

 

From that point onwards it was very simple, I was just repeating the same steps. I added a new layer, painted a little less of what stuck out each time, turned the opacity down to 10% and carried on. We were supposed to do 10 layers at 10%, but you could also do 5 at 20% for example, or even 100 at 1% if you’re willing to spend so much time on it. As long as the layers add up to that 100% then the number doesn’t matter, although the more layers there are, the more detailed the effect.

 

 

During this part of the lesson, Jake told us a very nifty way of looking at our work if we were struggling to know which parts to paint. He said to imagine the subject in the dark with a torch shining a light directly in front of it. The faded parts are towards the back, darker and less visible, and the most highlighted aspects are nearest to the front, where the light makes contact without obtrusion. With this in mind, I could complete the layers of my deer more realistically, and towards the final ones, I even started thinking about smaller details that might stick out based on the bone structure of the animal.

 

 

For the last 2 to 3 layers, my main focus was on the face, since that would stick out the most. Of course, I left the nose until last so that the 3D effect could be more obvious and realistic. I then unhid the black layer, did some final touch-ups and my displacement map was ready to be exported! I can’t believe that the process for making a 3d photo is so easy to understand and relatively simple to do. It does depend on the image, but just adding layers and changing the opacity is really basic stuff, and the effect it builds up to seems like it was much harder to achieve.

 

 

Applying the Displacement in After Effects

 

Now that the displacement map was complete, we moved onto the After Effects stage, and imported it in, making sure to choose ‘composition’ in the import kind dropdown. Next, we opened up the folder with the layers and dragged the background (the original image) into the composition. After that, we put the entire comp from PS on top and hid the map like so.

 

 

We were asked to click the image, go to ‘effect’, ‘distort’ and then ‘displacement map’. The settings appeared in the box to the left, where we changed the horizontal and vertical displacement both to the option ‘luminance’. That was the basics done! When I played around with the numbers underneath each, I could see the effect taking place. It was really cool! The movements had to be quite subtle, but the photo did indeed look 3D. I don’t like the glassy, stretched out look that happens around the edges, but more layers and skill is required to perfect it and I was still happy to know the process.

Some extras that we could have done at the end (optional) were adding a compound blur to the map, which would have increased the depth, or inverting the colours using colour grading which also adds perspective to the photo.

 

 

In my opinion, this is such a cool and easy effect that you can apply to images to make them more fun. I think that I’ll definitely be trying it out again in the future, perhaps even for my creative project if I feel that 3D images would help or add to the production value in some way. Overall, it was a really enjoyable lesson and I didn’t really have any major difficulties or complaints – everything went rather smoothly. Next time, I’ll be applying some of the effects on top to see what kind of difference that creates.

 

I made my 3D deer into a little gif 😀

Leave a Reply