Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

96
Views
SVG Filter using feImage as input to feDisplacementMap

I am trying to use svg filters to add a displacement map to an image. This is my code:

<svg width="300" height="300">
    <filter id="a" filterUnits="userSpaceOnUse" x="0" y="0" width="300" height="300">
      <feImage xlink:href="https://i.imgur.com/TKNyL9Q.jpg" result="heatmap"/>
      <feDisplacementMap scale="15" xChannelSelector="R" yChannelSelector="G" in2="heatmap" in="SourceGraphic"/>
    </filter>
    <image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="https://s3-us-west-2.amazonaws.com/s.cdpn.io/222579/beagle400.jpg" height="300" width="300" filter="url(#a)" />
  </svg>

This is supposed to take the beagle image and apply a grid displacement map to it but it has no effect.

Oddly, switching in with in2 in the <feDisplacementMap> tag does work but in reverse showing a grid image with a beagle map fine.

Here is a codepen example.

Why does it only work one way?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

it seems the in & in2 parameters need to match up with the source graphic itself not the .heatmap.

I amended the on the first: 'Beagle with heatmap filter' to this:

<feDisplacementMap scale="15" xChannelSelector="R" yChannelSelector="G" in2="SourceGraphic" in="SourceGraphic"/><!-- -->
    </filter>

Let me know if this is the result you was looking for?

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!