W3cubDocs

/SVG

<feImage>

The <feImage> SVG filter primitive fetches image data from an external source and provides the pixel data as output (meaning if the external source is an SVG image, it is rasterized.)

Usage context

Categories Filter primitive element
Permitted content Any number of the following elements, in any order:
<animate>, <animateTransform>, <set>

Attributes

Global attributes

Specific attributes

DOM Interface

This element implements the SVGFEImageElement interface.

Example

SVG

<svg
  viewBox="0 0 200 200"
  xmlns="http://www.w3.org/2000/svg"
  xmlns:xlink="http://www.w3.org/1999/xlink">
  <defs>
    <filter id="image">
      <feImage xlink:href="mdn_logo_only_color.png" />
    </filter>
  </defs>

  <rect x="10%" y="10%" width="80%" height="80%" style="filter:url(#image);" />
</svg>

Result

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
feImage Yes 12 4 Yes 9 Yes Yes Yes Yes No Yes Yes
href 50 12
YesDocument fragments (including references to fragments in the current document) are not supported (see bug 455986).
Yes 37 12.1 50 50
YesDocument fragments (including references to fragments in the current document) are not supported (see bug 455986).
No 12.2 5.0
preserveAspectRatio No No No No No No No No No No No No
xlink_href Yes 12
4Document fragments (including references to fragments in the current document) are not supported (see bug 455986).
Yes 9 No Yes Yes
YesDocument fragments (including references to fragments in the current document) are not supported (see bug 455986).
No No Yes

See also

© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/SVG/Element/feImage