首先看看這本篇文章:http://blog.sina.com.cn/s/blog_4bfac6ef0100yr3p.html
要點:DisplacementMapFilter需要有一個灰度圖像(也可以是RBG或RGBA圖像中的一個顏色或alpha通道,這個通道本身是一個8位的繪圖圖像)作為置換映射圖,
並基於這個映射圖的像素對另外一個圖像進行扭曲。映射圖像中比中性灰亮的像素,目標圖像中對應位置的像素向左上角移動。較暗的像素向右下角移動
在下面的例子中,我加載了一張新的圖像,以便於輕松看到置換效果。我用drawing API繪制了一個圓形,並將這個圖形渲染到背景為黑色的BitmapData對象中(不用擔心——下一章才會講到這一點)。然后應用模糊濾鏡模糊圖像,這樣我們可以得到黑色到白色過渡之間的顏色,幾乎包括所有的中性灰色。將處理后的這個圖像作為置換圖像,然后在加載進來的”多彩棋盤”圖像上應用DisplacementMapFilter濾鏡,結果可以看到非常明顯的扭曲,如圖2-41所示:
接下來,我們看看它的應用:
This is the technique that will wrap your art around objects and (seemingly) magically make it hug every contour.
I also have a variation of this tutorial here where I wrap text around a photo.
Step 1
Begin with a texture, you must be in RGB mode. I have another tutorial under textures that shows you how to create this rock surface. You can also just download it if you wish.
Step 2
Click on the Channels palette and click on each channel until you find the one with the most contrast (dark to light). In this case it is the Red channel.
Step 3
We need to make a new document out of the channel.
Either right click/Control+click on the channel area of the channels palette, or click on the top right arrow to open the drop down menu. Choose “duplicate channel.”
Under destination>document, choose new.
Click ok
Step 4
You will now have a new document. This will become our displacement map. Apply a 0.7 Gaussian blur (Filter>blur>Gaussian blur) to lower the sharp detail a bit. This will make for a smoother image in the end.
Step 5
Save the document as a .psd, I called it displacementMap.psd, any name will work, just remember it and the location. I put mine on the desktop.
We have now created our displacement map for use later on.
Step 6
On our original document, click on the “RGB” to restore the default channel display.
Step 7
Open the layers panel and add your artwork or text on a new layer. This is the content that you want to warp. Make sure you have everything you want to warp on one layer. If you have text, rasterize it now. (Right click on the layer palette next to the name and choose “rasterize layer” from the pop up menu.
Step 8
Now lets apply the displacement map…
Filter>Distort>Displace
Step 9
Use the settings shown here when the Displace palette opens.
Click ok
Step 10
You will now see a browser asking you to choose a displacement map. Navigate to the desktop and load the image we created at the beginning of this tutorial.
Click open
Step 11
You will now see your artwork distort to hug the texture of the rock.
Lets jazz it up a bit.
Step 12
Choose Overlay mode to add some realistic blending.
Duplicate the distorted layer to add a bit more strength to the effect. I dropped the opacity of the top layer to 30 to tone it down a bit.
Here is the result on the blending mode.
See how the color blends in with the texture.
Step 13
Here is exactly the same image but with a variation. I added an inner shadow layer style to the top layer
I hope you had fun with this tutorial and learned a lot.