• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

10. Filters > The feDisplacementMap Element

The feDisplacementMap Element

This fascinating filter uses the color values of its second input to decide how far to move the pixels in the first input. You specify which color channel should be used to affect the x-coordinate of a pixel with the xChannelSelector attribute; the yChannelSelector attribute specifies the color channel used to affect the y-coordinate. The legal values for these selectors are "R", "G", "B", and "A" (for the alpha channel). You must specify how far to displace pixels; the scale attribute gives the appropriate scaling factor. If you don’t specify this attribute, the filter won’t do anything.

Example 10-14 creates a gradient rectangle as the second input. The displacement factor will be set to ten, the red channel will be used as an x offset, and the green channel will be used as a y offset. Figure 10-25 shows the result of applying this displacement to the flower.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint