blob: f6c00eac7e4217f6fa91896add1fd71a5e2dcccc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
---
title: <feImage>
slug: Web/SVG/Element/feImage
tags:
- SVG
- SVG Filter
translation_of: Web/SVG/Element/feImage
---
{{SVGRef}}
La primitive de filtre [SVG](/fr/docs/Web/SVG) **`<feImage>`** extrait les données d'une image d'une source externe et retourne les pixels récupérés en sortie (autrement dit, si l'image récupérée est une image SVG, elle sortira comme raster)
## Contexte d'utilisation
{{svginfo}}
## Attributs
### Attributs globaux
- [Attributs de base](/fr/docs/Web/SVG/Attribute#Attributs_de_base)
- [Attributs de présentation](/fr/docs/Web/SVG/Attribute#Attributs_de_base)
- [Attributs de primitives de filtre](/fr/docs/Web/SVG/Attribute#Attributs_de_primitives_de_filtre)
- [Attributs XLink](/fr/docs/Web/SVG/Attribute#Attributs_de_primitives_de_filtre)
- {{SVGAttr("class")}}
- {{SVGAttr("style")}}
- {{SVGAttr("externalResourcesRequired")}}
### Attributs spécifiques
- {{SVGAttr("preserveAspectRatio")}}
- {{SVGAttr("xlink:href")}}
## Interface DOM
Cet élément implémente l'interface {{domxref("SVGFEImageElement")}}.
## Exemple
```html
<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="/files/6457/mdn_logo_only_color.png"/>
</filter>
</defs>
<rect x="10%" y="10%" width="80%" height="80%"
style="filter:url(#image);"/>
</svg>
```
{{EmbedLiveSample("Exemple", 200, 200)}}
## Spécifications
| Spécification | Statut | Commentaire |
| ------------------------------------------------------------------------------------------------ | -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| {{SpecName("Filters 1.0", "#feImageElement", "<feImage>")}} | {{Spec2("Filters 1.0")}} | Ajoute l'attribut {{SVGAttr("href")}} et déprécie {{SVGAttr("xlink:href")}}. Ajoute l'attribut {{SVGAttr("crossorigin")}}. |
| {{SpecName("SVG1.1", "filters.html#feImageElement", "<feImage>")}} | {{Spec2("SVG1.1")}} | Définition initiale |
## Compatibilité des navigateurs
{{Compat("svg.elements.feImage")}}
## Voir aussi
- {{SVGElement("filter")}}
- {{SVGElement("animate")}}
- {{SVGElement("animateTransform")}}
- {{SVGElement("set")}}
- {{SVGElement("feBlend")}}
- {{SVGElement("feColorMatrix")}}
- {{SVGElement("feComponentTransfer")}}
- {{SVGElement("feComposite")}}
- {{SVGElement("feConvolveMatrix")}}
- {{SVGElement("feDiffuseLighting")}}
- {{SVGElement("feDisplacementMap")}}
- {{SVGElement("feFlood")}}
- {{SVGElement("feGaussianBlur")}}
- {{SVGElement("feMerge")}}
- {{SVGElement("feMorphology")}}
- {{SVGElement("feOffset")}}
- {{SVGElement("feSpecularLighting")}}
- {{SVGElement("feTile")}}
- {{SVGElement("feTurbulence")}}
- [Tutoriel SVG: Les filtres](/fr/docs/Web/SVG/Tutoriel/filtres)
|