--- title: image-rendering slug: Web/CSS/image-rendering tags: - CSS - CSS Bild - CSS Eigenschaft - Experimentell - NeedsMobileBrowserCompatibility - Referenz - SVG translation_of: Web/CSS/image-rendering ---
Das image-rendering
CSS Property schlägt dem user agent vor, wie er eingebundene Bilder darstellen sollte. Dieses Property gilt für alle Bilder welche einem HTML untergeordnet sind, betrifft allerdings nur skalierte Bilder. Wenn ein Bild zum Beispiel 100x1000px groß ist, es aber mit einer Größe von 200x200px eingebunden wird, so Rechnet der Browser nach dem durch das Property festgelegten Algorythmus um.
{{cssinfo}}
{{csssyntax}}
image-rendering: auto image-rendering: crisp-edges image-rendering: pixelated image-rendering: inherit
auto
crisp-edges
pixelated
optimizeQuality
and optimizeSpeed
present in early draft (and coming from its SVG counterpart) are defined as synonyms for the auto
value./* applies to GIF and PNG images; avoids blurry edges */ img[src$=".gif"], img[src$=".png"] { image-rendering: -moz-crisp-edges; /* Firefox */ image-rendering: -o-crisp-edges; /* Opera */ image-rendering: -webkit-optimize-contrast;/* Webkit (non-standard naming) */ image-rendering: crisp-edges; -ms-interpolation-mode: nearest-neighbor; /* IE (non-standard property) */ }
div { background: url(chessboard.gif) no-repeat 50% 50%; image-rendering: -moz-crisp-edges; /* Firefox */ image-rendering: -o-crisp-edges; /* Opera */ image-rendering: -webkit-optimize-contrast;/* Webkit (non-standard naming) */ image-rendering: crisp-edges; -ms-interpolation-mode: nearest-neighbor; /* IE (non-standard property) */ }
78% 100% 138% downsized upsized
78% 100% 138% downsized upsized
78% 100% 138% downsized upsized
Specification | Status | Comment |
---|---|---|
{{SpecName('CSS3 Images', '#the-image-rendering', 'image-rendering')}} | {{Spec2('CSS3 Images')}} |
Though initially close from the SVG image-rendering
property, the values are quite different now.