files/en-us/web/svg/reference/attribute/xchannelselector/index.md
The xChannelSelector attribute indicates which color channel from {{SVGAttr("in2")}} to use to displace the pixels in {{SVGAttr("in")}} along the x-axis.
You can use this attribute with the {{SVGElement("feDisplacementMap")}} SVG element.
R
G
B
A
html,
body,
svg {
height: 100%;
}
<svg viewBox="0 0 440 160" xmlns="http://www.w3.org/2000/svg">
<filter id="displacementFilter">
<feImage
href="mdn.svg"
x="0"
y="0"
width="100%"
height="100%"
result="abc" />
<feDisplacementMap
in2="abc"
in="SourceGraphic"
scale="30"
xChannelSelector="R" />
</filter>
<filter id="displacementFilter2">
<feImage
href="mdn.svg"
x="0"
y="0"
width="100%"
height="100%"
result="abc" />
<feDisplacementMap
in2="abc"
in="SourceGraphic"
scale="30"
xChannelSelector="B" />
</filter>
<text x="10" y="60" font-size="50" filter="url(#displacementFilter)">
Some displaced text
</text>
<text x="10" y="120" font-size="50" filter="url(#displacementFilter2)">
Some displaced text
</text>
</svg>
{{EmbedLiveSample("Examples", "480", "200")}}
{{Specifications}}
{{Compat}}