TeamPhotoshop
Reviews, updates and in depth guides to your favourite mobile games - AppGamer.com
Tutorials

Distorting images with displacement maps. Part 1

Oct 18th 2005
Using Displacement Maps to Distort an Image:

1.
One of the great (and yet agonizing) things about Photoshop is that it's so complex, you'll probably never use all its features. It can take over your life. I'm serious. If you have little or no life, and like goofing around with images, go plunk down your money for Photoshop and you can spend years exploring all its potential.

Distorting images using displacement maps is just one of those things that once you start playing with, you'll spend hours trying out different effects. There are many variables to work with so although it's a cliche, it's true here: the possibilities are endless.

In the examples to the left here, you can see my original image of a clue less guy perched over a chessboard. The radial gradient I used as a displacement map is in the middle, and the end result below. I think you'll agree, he considerably more taxed now. What a headache!

Let's figure out how to do this!

 

 2.
Displace is one of the Distort effects in Photoshop's Filter Menu. What you do is pick an image, apply the Displace Filter, then pick another image that will be used to distort the first.

I mentioned there were a lot of variables which determine how that final image comes out. Variable #1: Choose an image. This is a no-brainer, but of course what is seen in a digital file is a choice to consider. A displacement map that has a really cool effect on one image may not do much for another, simply because of the nature of what is seen in your image. The composition; the size and placement of the elements; whether it's a photograph or graphic- that kind of thing. I chose this zebra as my first guinea pig.

Variable #2: The physical size and resolution of the image is also a factor. This is another obvious one and I won't go into it her too much. You just need to understand that the distortion effect on my 300 ppi zebra image would be different if the same image was only 72ppi.

Once I've decided to inflict this zebra with some digital suffering, I choose Filter: Distort: Displace. The first thing I see is the Displace dialog box (see left). These are Variable #s 3, 4 , 5, & 6. We'll get into each of them later, but this box just lets you have some control over how the image will distort, and to what extent. After you click OK, you get to pick an image to use as a displacement map. (I'll define that for you in a bit- I don't want to overwhelm you.) I had made this image earlier by making a simple "X" with the line tool, defined it as a pattern, and filled a larger image with it by tiling it over and over.



Photoshop uses this image, called a displacement map, to determine how to distort a selection. After all that hard work, we finally get to see what effect it all has on the image. See how the diamond grid has distorted the image of the zebra? I've shown you a closer up view below there to the left so you can appreciate the distortion better. It sort of looks like he's behind a chain link fence, but the fence is made of fine pieces of glass. I'm impressed.

We've just scratched the surface. Let's examine this digital wonder more in depth.

 3.
Variable #s 3 & 4 were the Horizontal and Vertical Scaling. Very simply explained these control the quantity of distortion. You can see in the image to the left, that if I set the scaling to 60%



rather than 20% as above, the pixels of the zebra image have been displaced farther up and to the left.

This doesn't do a heck of a lot for this image (I liked the 20% result better), but for some, it might be just what you want. In the chess player image above, I think I used 60%.

 4.
There's another way to increase the amount of distortion of an image- my multiplying the effect. Here I had the Horizontal and Vertical scaling set to 20% and you can see from my History Palette



that I applied the 20% displacement three times. Although you might think it would look the same as 60% scaling, it's obviously not.

It's just another of those darn variables to consider that affects the outcome.

 5.
I'm going to apply some variations of the image I chose as a displacement map, so that we can better understand the outcome. Here's how the distortion occurs: In my grayscale images, the dark values displace the pixels downward and the light values displace the pixels upward according to the value you put into the Vertical Scale percentage box. Also, the percentage you put into the Horizontal Scale box, will determine the amount that the darker values move the pixels to the right and the lighter values move the pixels to the left. (So above, since my diamond grid was mostly white, we noticed the greater up-left displacement as streaks of pixels along the right and bottom edges of the zebra image.) Got all that?

When you bring colors into the picture in your displacement map image then the up-down displacement works the same as above but the displace filter only takes the value information from the first channel of your channels palette. The right-left displacement works the same as above, but the filter only takes the information from your image's second channel. My head's starting to hurt, so we'll stop there.

In this displacement map variation, I blurred the original image for more value variation. So what you see within the small diamond shapes (of the zebra image) is more of a distortion than before, because in the displacement map (the grayscale diamond grid) those areas no longer contain just white, but a gradation from white (in the center of the diamond) through gray towards black (near the lines).

 6.
Now in this variation, I took my original diamond grid image and applied a filter to it that gave it a rippled look. In the zebra image, below it, I've given you a close-up view so that you can see the results better.

 7.
I kind of liked what was happening inside the diamonds in step 5 above, but I wanted more. I took my blurred grid and scaled it down to about 1/4 its original size. Then, when I was applying the Distort Filter, I selected



Tile
in the dialog box. Rather than stretching my displacement map image to fit the zebra image perfectly, now the filter will leave it at actual size and simply repeat it over and over, much like wall or floor tiles.

This looks pretty interesting. There's kind of a 1960's Op Art effect going on in a photographic image. Cool Beans. Well I've overloaded you with information and images, but there's still much more to say about using Displacement Maps. We've got to try some different maps, including color on more images, including artwork. Plus I'll tell you where you can find some ready-made displacement maps. All this can be yours if you join me for part two,

More Fun With Displacement Maps.