CSS `image-rendering: pixelated;` works not as described in ~~docs~~

W3 states that using
pixelated
value of CSS
image-rendering
property has effect only if image is upscaled. However, this is apparently not the case in Chromium and it does not work in Firefox too.

If the image is scaled down, it will be the same as auto
https://www.w3schools.com/cssref/css3_pr_image-rendering.php

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>image-rendering</title>
</head>
<body>

    <h2>1:1 size</h2>
    <code>image-rendering: auto</code>
    <img src="https://www.w3schools.com/cssref/smiley.gif" style="image-rendering: auto;">
    <code>image-rendering: pixelated</code>
    <img src="https://www.w3schools.com/cssref/smiley.gif" style="image-rendering: pixelated;">

    <hr>

    <h2>upscaled</h2>
    <code>image-rendering: auto</code>
    <img src="https://www.w3schools.com/cssref/smiley.gif" style="width: 100px; image-rendering: auto;">
    <code>image-rendering: pixelated</code>
    <img src="https://www.w3schools.com/cssref/smiley.gif" style="width: 100px; image-rendering: pixelated;">

    <hr>

    <h2>downscaled</h2>
    <code>image-rendering: auto</code>
    <img src="https://www.w3schools.com/cssref/smiley.gif" style="width: 10px; image-rendering: auto;">
    <code>image-rendering: pixelated</code>
    <img src="https://www.w3schools.com/cssref/smiley.gif" style="width: 10px; image-rendering: pixelated;">

</body>
</html>
image-rendering_chromium.png
image-rendering_firefox.png
Was this page helpful?