--- title: image slug: Web/SVG/Element/image tags: - Elemento - Gráficos SVG - Referencia - SVG translation_of: Web/SVG/Element/image ---
O elemento SVG <image>
carrega imagens dentro de documentos SVG. Ele pode exibir arquivos {{glossary("raster image")}} ou outros arquivos SVG.
The only image formats SVG software must support are JPEG, PNG, and other SVG files. Animated GIF behavior is undefined.
SVG files displayed with <image>
are treated as an image: external resources aren't loaded, :visited styles aren't applied, and they cannot be interactive. To include dynamic SVG elements, try <use> with an external URL. To include SVG files and run scripts inside them, try <object> inside of <foreignObject>.
Note: The HTML spec defines <image>
as a synonym for <img> while parsing HTML. This specific element and its behavior only apply inside SVG documents or inline SVG.
{{svginfo}}
<img>
, this attribute is required.<img>
, this attribute is required.<image>
implements the {{domxref("SVGImageElement")}} interface.
Basic rendering of a PNG image in SVG:
<svg width="200" height="200" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <image href="https://mdn.mozillademos.org/files/6457/mdn_logo_only_color.png" height="200" width="200"/> </svg>
{{EmbedLiveSample("Example", 250, 260)}}
Specification | Status | Comment |
---|---|---|
{{SpecName('SVG2', 'embedded.html#ImageElement', '<image>')}} | {{Spec2('SVG2')}} | Allows omitting height and width |
{{SpecName('SVG1.1', 'struct.html#ImageElement', '<image>')}} | {{Spec2('SVG1.1')}} | Initial definition |
{{Compat("svg.elements.image")}}