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.
From here you create some text, then scale and rotate it into place. At this point, your composition isn’t looking very believable.
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.
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:
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.
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.
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.”
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.
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.
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.
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.
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.
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:
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.
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.
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!
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.