From the course: Deke's Techniques (2018-2021)

713 Contour mapping with Distort > Displace

From the course: Deke's Techniques (2018-2021)

713 Contour mapping with Distort > Displace

- Hey gang, this is Deke McClelland. Welcome to Deke's techniques. This week I'm going to introduce you to the art of contour mapping inside Photoshop. Specifically we'll take this portrait shot and then we'll turn it into a bright and blurry displacement map for reasons that I think will become obvious over the course of this movie. And then we're going to use the displacement map to distort a basic horizontal line pattern so that the lines trace along the contours of the woman's face. Here, let me show you exactly hot it works. Alright, here's the final affect, just so you have a chance to see it on screen. We're going to start things off by creating a displacement map that we'll use to create these contoured lines. And I'm going to start off inside this photograph which comes to us from the Dreamstime image library, about which you can learn more and get some great deals at dreamstime.com/deke.php. I'll go ahead and click on the background item here, and I'll make a duplicate of it by right-clicking in the image window using my rectangular marquee tool, which is selected up here near the top of the tool box. And I'll choose duplicate layer, and then I'll just go ahead and change this document item to new and click okay, and that will copy this image to a new document so I don't harm the original. Now I'll go up to the layer menu and I'll check to see if the flatten image command is available. Now it should be, after all, we have a background item here inside the layers panel, but depending on which version of Photoshop you're using, the program might get a little confused. In which case, just go ahead and choose that flattened image command. Now if the command is dimmed, don't worry about it. Alright, now we need to soften the transitions because otherwise we'll end up with a very choppy displacement map. And so if you're working along with me, go up to the filter menu, choose blur, and choose gaussian blur, and I came up with a radius value of 20 pixels, so we really want to soften the heck out of this image. If this were a higher resolution image, you could go higher if you want to, but a radius of 20 generally works in just about all cases. Alright, so I'll go ahead and click okay to accept that change. And then I'll go up to the window menu and choose the channels command to bring up the channels panel. And notice that because this is an RGB image we have a red, green and blue channel. Now the thing about a displacement map is it bends an image, in our case, those horizontal lines downward if it's black, and upward where it's white, and no bend occurs in the gray areas. Which means that any of these channels is going to work out just fine. However, for the most predictable results, you generally want to make sure your brightest or your darkest color is medium gray. So everything is bending in approximately the same direction. And that's just a rule of thumb by the way. So I'm going to switch back to the RGB image and I'll go to the image menu, choose adjustments, followed by the levels command. When we're applying levels, it's a static adjustment, because we need to keep this image flat in order to serve as a displacement map. So I'll go ahead and choose levels, or you can press control L, or command L on a Mac, and then you want to switch to the red channel and go ahead and increase this first output levels value to 128. So the idea is that the darkest color is going to be medium gray, the lightest color is going to be white, and so everything is going to be moving to some extent or other in the same direction, which again, just makes things a little more predictable. Alright, now I'll switch to the green channel and do the same thing. So change that value to 128, and then switch to the blue channel and change it's first value to 128. And we're doing this on a channel by channel basis so that we affect each and every channel independently, at which point I'll click okay. Alright, now what you want to do is save off each one of these channels as an independent image, and the easiest way to do that is to click on the red channel for example, and then go up to the image menu, choose mode and choose gray scale. At which point, Photoshop's going to ask if you want to discard the other channels. So it's going to get rid of the green and blue channels and just keep the red channel as a gray scale image. That's exactly what you want, so go ahead and click okay, and notice we now have a single gray channel, and this is a gray scale image as indicated by the word gray up here in the title tab. Now you want to go up to the file menu and choose save us, and go ahead and name this file something like this. GBlur20 128-255, because after all, those are our luminance levels, followed by 1R. The one keeps the files in order, the R stands for red. Now you do want to save this as a Photoshop document. As a flat PSD file. The reason being, that's just the way things work. Displacement commands are a very old feature inside Photoshop. Then I'll just go ahead and click Save and replace this file. And then if you want to create a green version and a blue version as well, then just press control, alt, Z. That's command, option, Z on a Mac. To back step, so you regain access to your full color image such as it is, then click on a green channel, go up to the image menu, choose mode, followed by gray scale. In response to Photoshop's message, just go ahead and click okay. You can even turn on the don't show again check box if you like, and then go up to the file menu, choose Save As, and now you've got your old file name to work with, so you can just change those last two characters to 2G, again, just to keep things in order, and then click on the Save button. I'm going to replace that guy as well because I've created these files in advance, and so forth. Alright, now we need to create that pattern of horizontal lines, and I'm going to do that by going up to the file menu and choose the New Command, or you can just press control N, or command N on the Mac. You want to set the width and height values both to 20 pixels, very important that we're working with pixels here. Resolution value doesn't matter. Color mode of RGB is just fine. You probably do want to go ahead and assign a color profile of sRGB in my case. Then I'll go ahead and click Create in order to create that file. But really all that matters is that we've got a file that measures 20 pixels wide by 20 pixels tall. Now, still armed with my regular marquee tool, I'm going to go ahead and draw a big rectangle that measures the entire width of this tiny little image, and 16 pixels tall. So notice the width and height values above my cursor, that little heads up display there. 20 by 16, then tap the D key to get your default colors. So the foreground color is black and the background color is white, and then press alt, backspace, or option delete in order to fill that selection with black, and then you can press control D, or command D on a Mac to deselect the image. Alright, now we want to turn this little guy into a pattern. So go to the edit menu and choose Define Pattern, and I'm going to go ahead and call this guy H lines and then 16K let's say in parenthesis, and 4w to indicate that we have 16 black pixels and four white ones, then I'll click okay. And now I'll switch back to my base image. I'll click on that URL layer and press the backspace key or the delete key on a Mac to get rid of it. And then I'll go up to the layer menu and choose new fill layer followed by pattern, and this way I can name the pattern as I create it. And I'll just go ahead and call this guy H lines and click okay, and with any luck, you should see that most recent pattern that you created, which in my case I have a somewhat long list here. In my case it's that H lines pattern. Can't really see the too tip because it's behind the pop up panel, but it is what I'm looking for. And then I'll go ahead and click okay, and we end up with this network of lines. Alright, now I want to go up to the filter menu, choose distort, and then choose displace, but you can't apply this command to a pattern layer. So what you have to do is first convert it to a smart object. So I'll just go ahead and click that button. And that way we now have a smart object as indicated by this little page icon in the bottom right corner of the thumbnail. Now for our purposes, you can change this horizontal scale value to anything you like, and that's because when you're working with horizontal lines, this value is not going to make any difference. But just for the sake of keeping everything as clean as possible, I'll set this to zero, and then I came up with a vertical scale value of 77. You want to go ahead and stretch the displacement map to fit, although, it's actually not necessary, because the two files are the same size. And then, instead of making the undefined areas repeat the edge pixels, which will leave a little gap down at the bottom, you want to wrap around. And then click okay, and now you just want to go ahead and find one of your files. For example, if I go with the green channel here, 2G, and click on the open button, I end up with this effect here. So you can see how the lines are bending around the face and if you really want to see what's going on, change the blend mode there from normal to overlay, and if that effect is too harsh, you can go with soft light. But overlay works really well for this image. So I'll switch it back like so. Now you also have an option to switching to a different channel that is the red version of the displacement map for example, or the blue one. And to make that happen, just double click on the word displace here inside the layers panel to bring back the displaced dialogue box. You can change that vertical scale value if you want to. I'm going to leave it alone though. And click okay, and now I'll just select a different image such as 1R, and click open in order to apply it instead. And you can see that we've made a slight difference. This is the green channel displacement, and this is the red channel displacement, and I'm just switching back and forth between them by pressing control Z, or command Z on a Mac. Alright, and I don't want this filter mask so I' going to right click on it and choose delete filter mask. Obviously I'm just doing that because I'm a fuss budget and I hate having a bunch of clutter inside the layers panel and then I decided I wanted to invert this particular layer, the H lines layer, and I did that just by pressing control I, or command I on a Mac, and as you can see, that goes ahead and adds the invert item to this specific smart filter. So we're just affecting this one layer and the way that it overlays on top of the background image. Alright, now I'll press shift F in order to switch to the full screen mode. And I'll zoom on in as well, and that's how you wrap contour lines around the surface of a person's face using old school displacement maps here inside Photoshop. Alright now if you're a member of Lynda.com/LinkedInLearning I have a total of two, count them two follow up movies. In the first one we'll combine our contour map along with a gradient map to achieve this intense colorization effect here. And the second one we'll go old school and we'll combine the contour map with an arbitrary map that you create using a curves adjustment layer. If you're looking forward to next week, we'll still be playing around with contour maps and we're going to take this effect and turn it into this. Deke's techniques, each and every week. Keep watching.

Contents