Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

98
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda