You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: css3-images/Overview.src.html
+43-2Lines changed: 43 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -646,7 +646,44 @@ <h3 id="image-orientation">Orienting an Image on the Page: the 'image-orientatio
646
646
</pre>
647
647
</div>
648
648
649
-
<h3id="object-fit">The 'object-fit' Property</h3>
649
+
<div>
650
+
<h3id=image-rendering>Determining How to Scale an Image: The 'image-rendering' Property</h3>
651
+
652
+
<tableclass=propdef>
653
+
<tr>
654
+
<th>Name:
655
+
<td><dfn>image-rendering</dfn>
656
+
<tr>
657
+
<th>Value:
658
+
<td>auto | optimize-contrast
659
+
<tr>
660
+
<th>Initial:
661
+
<td>auto
662
+
<tr>
663
+
<th>Applies to:
664
+
<td>All elements
665
+
<tr>
666
+
<th>Inherited:
667
+
<td>Yes
668
+
<tr>
669
+
<th>Media:
670
+
<td>visual
671
+
<tr>
672
+
<th>Computed Value:
673
+
<td>specified value
674
+
</table>
675
+
<p>The 'image-rendering' property provides a hint to the user-agent about what aspects of an image are most important to preserve when the image is scaled, to aid the user-agent in the choice of an appropriate scaling algorithm. When specified on an element, it applies to all images given in properties for the element, such as background images, list-style images, or the content of replaced elements when they represent an image that must be scaled. The values of the 'image-rendering' property are interpreted as follows:</p>
676
+
<dl>
677
+
<dt>''auto''</dt>
678
+
<dd>The image should be scaled with an algorithm that maximizes the appearance of the image. In particular, scaling algorithms that 'smooth' colors are acceptable, such as bilinear interpolation. This is intended for images such as photos.</dd>
679
+
<dt>''optimize-contrast''</dt>
680
+
<dd>The image should be scaled with an algorithm that maximizes the contrast of the image, preserving sharp lines and not smoothing colors or introducing blur to the image in the process. This is intended for images such as pixel art.</dd>
681
+
</dl>
682
+
<p>This property does <em>not</em> dictate any particular scaling algorithm to be used. For example, with ''image-rendering:auto'', a user agent may scale images with bilinear interpolation by default, switch to nearest-neighbor interpolation in high-load situations, and switch to a high-quality scaling algorithm like Lanczos interpolation for static images that aren't moving or changing. Similarly, with ''image-rendering:optimize-contrast'', a user agent may scale images with nearest-neighbor interpolation by default, and switch to EPX interpolation in low-load situations.</p>
683
+
<p>This property previously accepted the values ''optimizeSpeed'' and ''optimizeQuality''. These are now deprecated; a user agent may accept them as valid values, but must treat them as aliases for the ''auto'' value.</p>
684
+
</div>
685
+
686
+
<h3id="object-fit">Sizing Replaced Elements: The 'object-fit' Property</h3>
0 commit comments