SVG HTML

Convolve Matrix Filter

This SVG example illustrates how to apply a convolve matrix filter.

ConvolveMatrixFilter.svg

<svg width="400" height="200" xmlns="http://www.w3.org/2000/svg">
  <filter id="idConvolveMatrixFilter">
    <!-- A sharpening filter -->
    <feConvolveMatrix kernelMatrix=
      "-1  -1  -1
       -1   9  -1 
       -1  -1  -1"/> 
  </filter>
  <!-- Original Version -->
  <circle cx="100" cy="100" r="75" fill="gray" stroke="lightgray" stroke-width="10"></circle>
  <!-- Filtered Version -->
  <g style="filter: url(#idConvolveMatrixFilter)" transform="translate(200, 0)">
    <circle cx="100" cy="100" r="75" fill="gray" stroke="lightgray" stroke-width="10"></circle>
  </g>
</svg>
 

Output

 
 

© 2007–2024 XoaX.net LLC. All rights reserved.