Apply Graphics to Textured Surfaces With Displacement Maps

by on 31st March 2011 with 18 Comments

Do you ever wonder how Photoshop masters create such realistic compositions? Seemingly simple tasks such as throwing some text onto a brick wall can easily lead to lackluster results if you don’t know what you’re doing.

So what sets you apart from the pros? Why are their final results so believable while yours reek of Photoshop? The simple answer is that they know more tricks than you! Let’s fix that.

The Problem

The situation is typical, you have some graphics and a photograph and you want to put the two together. You start by grabbing a photograph. Like the example below, photographs of real objects often don’t contain perfectly smooth surfaces and textures.

screenshot

From here you create some text, then scale and rotate it into place. At this point, your composition isn’t looking very believable.

screenshot

The text is obviously just placed on top, there’s really no illusion that it’s actually printed onto the shirt, which is what we’re going for. Printed text would capture the light from the room, the texture of the shirt and the folds of the fabric.

The typical first step is to reduce the opacity of the text layer. This helps a little, some of the background is now bleeding through. The illusion is still fairly week though and not exactly anything to brag about.

screenshot

The level of realism is still lacking. A simple drop in opacity does nothing towards our goal of curving that text to make it look like it’s wrapping around the wrinkles. The end result should look much more like this:

screenshot

Notice how the “h” isn’t just letting the wrinkle show through, the shape of the letter is actually distorted to mirror the wrinkle. The bleed of the shirt through the letters is also much more believable than a simple opacity reduction.

So how do you achieve this effect and how long will it take? It turns out you can do it quite easily with Photoshop in a matter of minutes. Let’s see how with a new, more extreme example.

Bricks and Smiles

To start off our project, I created a simple smiley face graphic in Illustrator and threw it onto the picture below from photographer Stuart Crawford.

screenshot

Again, the goal here is to make the graphic look like it’s actually a part of the scene. I chose the wall image because it makes this task quite difficult. There are lots of deep crevices and the pattern itself is quite inconsistent due to the aged, broken nature of the bricks. The trick to doing this without lots of work is the Displace filter.

Creating a Displacement Map

Using the Displace filter requires two integral elements: the document that you want to manipulate and the displacement map. Basically, you use the displacement map in a similar fashion to how you would use a layer mask, with black and white values each having a specific meaning.

With a layer mask, white values create opaque pixels and black values create transparent pixels. A displacement map is a bit more complex. In my own experimentation, 60% appears to be neutral (you would think 50%), while anything lighter than that displaces up and anything darker displaces down.

If this seems confusing, don’t worry, it’ll all make sense when we apply a displacement map to our image. If you look at the image of the brick wall again, you might be tempted to think that it would take forever to build a displacement map that mirrors all of that texture. However, we can actually use a modified version of the bricks to displace our graphics.

To accomplish this, first make sure only the brick layer is showing. Then go into your channels palette and find the channel with the most contrast. In our case, the red channel. Now create a copy this channel.

screenshot

Now, right-click on your recently copied channel and choose “Duplicate.” I know we already created one copy but our end goal is to create a new document from this channel. Choosing the “Duplicate” command brings up the dialog below where we can tell Photoshop to turn this channel into a new document. Make sure you match the settings shown below and then hit “OK.”

screenshot

Once you’ve got the black and white brick image as a new document, add a Gaussian blur. This may sound a bit strange but in the end it will help. I’m working with a really large image so I cranked my blur, but you’ll likely only need to hit around 1px if you’re working with a small document.

screenshot

Applying a Displacement Map

That’s all we need to do to create our map! You could work on the contrast a bit more if your image lacks definition, but ours should work pretty well as is.

Save and close the map as it’s own PSD then switch back over to your original bricks doc with the smiley face. Now select the smiley face layer and go to Filter>Distort>Displace. The following dialog should pop up. The default settings should work fine so hit “OK” and then a file select menu will pop up. Choose the BrickMap.psd file you created earlier.

screenshot

At this point, you should see the distortion effect. However, it might not initially look like we’ve done a very good job. We went from a clean smiley to a sloppy smiley, neither of which look like they’re on the wall! If you take a closer look though, you can see that the distortions do map pretty well to the bricks.

screenshot

To make the effect more believable, you’ll have to experiment a little with blending modes. Which will work best depends entirely on the actual content you’re working with. Overlay, Screen, Multiply, and Color Dodge are good places to start. For my white graphic and dark background, Color Dodge at 80% fill gives a pretty decent result.

screenshot

See how the graphic is much more believably a part of the scene now? The dips and curves create the illusion of depth and go far beyond simply reducing a layer’s opacity. Speaking of which, notice how I reduced the fill of the layer, not the opacity. Oddly enough, you get much better results when working with blending modes if you reduce a layer’s fill.

Going Further

There’s always more that you can do to push the believability of a composition even further. For instance, with my scene, the Color Dodge filter is creating some pretty crazy highlights that simply don’t look realistic. Also, I don’t think enough of the brick is showing through.

To battle this, I command-clicked on that brick channel that we made earlier to create a selection from it. Then I applied the selection as a mask to smiley face layer. This went a little too far so I duplicated the smiley layer and set the fill for both at 80%. Here’s the result:

screenshot

Optionally, if you want to grunge it up a little more. You can create a Soft Light layer filled with 50% gray (neutral to this blending mode) and masked to the face layer. Then grab a soft brush and paint areas of black and white to add contrast to the composition. I also threw in a slight blur so my edges weren’t so crisp.

screenshot
screenshot

To really get a feel for how well this technique works, I encourage you to experiment on your own with different settings, blending modes, layer effects etc. The displacement filter really does take a whole lot of work out of creating textured compositions. Check out the impressive distortion that resulted when I applied a flag graphic to the same brick wall using the techniques above.

screenshot

If I would’ve attempted this level of distortion manually, it would’ve taken me hours to achieve a result half as good. With Displace, this took under a minute!

Conclusion

To sum up, any time you’re combining flat graphics with a realistic texture, you’re going to run into some problems with realism. Displacement maps are one of the most powerful tools in your arsenal to help solve these issues because they can quickly and easily apply the distortions of the texture to the graphic.

Never stop there though. Always go further and tweak away at your image by manipulating the highlights, messing up clean edges, exploring new blending modes and anything else you can think of to make the final image mirror reality. Even if each change only makes the slightest different, they’ll start to add up and the result will be an impressive composition.

Comments & Discussion

18 Comments

  • http://www.timothywhalin.com Timothy Whalin

    Nice tutorial! Thanks for sharing. :)

  • Jonnathan

    This looks like a great trick to keep handy. Looking forward to trying it out.

  • http://grafiik.net Garrett Ross

    Exactly what I was looking for without knowing I was looking for it! Very useful, thank you.

  • http://www.cleanbaked.com Chris McClean

    I just learned something new, thanks! :]

  • tripdragon

    Eh. You could also learn how to blend by opening up the adjustments layers dialog and alt or command clicking the bottom sliders to cut them into fades. it’s grey by default. butu it has each channel as well.

  • Pingback: Apply Graphics to Textured Surfaces With Displacement Maps « « Big Engine Media Big Engine Media

  • Mauricio

    Excellent! I always wanted to do this but the only step I needed was the displacement map. Now I am 80% happier than I was before. Thank you very much for the tutorial.

  • http://papercuts.meoworks.com Yvonne

    Great stuff, thank you!

  • http://www.geoffmuskett.com Geoff muskett

    Great tutorial. Looks like I’ll be displacing my maps more often.

  • http://marilynadorno.com/ Marilyn

    More tricks!! I love that… thanks for sharing!

  • Pingback: Must Read Links for Web Designers and Developers – Volume 9 | Tech King

  • http://www.maiconweb.com Maicon Sobczak

    Very helpful tutorial.

  • Pingback: 使用置换地图给材质表面添加图案 | Design lol 全球设计精华分享

  • Pingback: Apply Graphics to Textured Surfaces | TechRetriever

  • http://alanhough.photoshelter.com/ Alan Hough

    Thanks for the tutorial, it has taken away the mystery
    and it worked well.

  • http://beardybot.co.uk Sandy

    Though this isn’t a comment on your tutorial, I find it absolutely bizarre that Photoshop is still lagging behind GIMP in the displacement stakes. In GIMP there’s more variety and a preview window, but best of all? You can displace using any layer. No need for new faffing around with new documents. Just a few clicks and it’s done.

  • Pingback: Tweet-Parade (no.17 Apr 2012) | gonzoblog.nl

  • Pingback: THE EARLY KERNER

Subscribe
Membership
About the Author