VOOZH about

URL: https://www.geeksforgeeks.org/html/svg-xchannelselector-attribute/

⇱ SVG xChannelSelector Attribute - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

SVG xChannelSelector Attribute

Last Updated : 31 Mar, 2022

The xChannelSelector attribute in SVG is used to indicate color channel from in2 that is use to displace the pixels in in along the x-axis. Only <feDisplacementMap> element is using this attribute.

Syntax:

yChannelSelector = "R | G | B | A"

Attribute Values: The attribute accepts four values as mentioned above and described below:

  • R: It specifies that the red color channel of the given image defined in in2 will be used to displace the pixels of the image along the x-axis.
  • G: It specifies that the green color channel of the given image defined in in2 will be used to displace the pixels of the image along the x-axis.
  • B: It specifies that the blue color channel of the given image defined in in2 will be used to displace the pixels of the image along the x-axis.
  • A: It specifies that the alpha channel of the given image defined in in2 will be used to displace the pixels of the image along the x-axis.

Example 1: This example illustrates the use of the xChannelSelector attribute using the “R” attribute value.

Output:

👁 Image

Example 2: This example illustrates the use of the xChannelSelector attribute using the “R” attribute value.

Output:

👁 Image
Comment