The image-rendering property defines how the browser should render an image if it is scaled up or down from its original dimensions. By default, each browser will attempt to apply aliasing to this scaled image in order to prevent distortion, but this can sometimes be a problem if we want the image to preserve its original pixelated form.

img {
  image-rendering: auto;
  image-rendering: crisp-edges;
  image-rendering: pixelated;

About those three possible values:

  • auto: default value that uses the browser’s standard algorithm to maximize the appearance of an image.
  • crisp-edges: the contrast, colors and edges of the image will be preserved without any smoothing or blurring. According to the spec this was specifically intended for pixel art. This value applies to images scaled up or down.
  • pixelated: as the image changes size the browser will preserve its pixelated style by using nearest-neighbour scaling. This value only applies to images that are scaled up.

This property can be applied to background-images, canvas elements as well inline images. It's important to note however that testing these values at this time is particularly confusing because of the lack of consistent browser support.


Here's a very small inline image that's made up of four colored pixels:


If we change the width of this inline image to 300px then in Chrome (41) we'll find the browser has attempted to optimize the image as best it can:

To preserve its original pixelated look we can use the following pixelated value, like so:

img {
  image-rendering: pixelated;

This results in the browser choosing an alternative algorithm with which to process the image. In this example Chrome will remove the default aliasing:

Unfortunately after a lot of testing it seems that browsers interpret the crisp-edges and pixelated values in very confusing ways at the moment so it's important to note once again that this specification is in its very early days. For instance Chrome appears to render pixelated images in the same way that Firefox and Safari will render images with crisp-edges.

QR code example

Another use case of this property might be for QR codes where you want to increase its size without distorting it by using the standard anti-aliasing. Make sure to check this example in full screen mode to see the image stretch:

See the Pen Image-rendering demo by Robin Rendle (@robinrendle) on CodePen.

Toggle example

In the Pen below it’s possible to toggle between these values and see the discrepancies between browsers:

See the Pen Image rendering demo by Robin Rendle (@robinrendle) on CodePen.

Other resources

Browser support

crisp-edges currently requires vendor prefixes (-moz-crisp-edges) to get the best support possible.

This browser support data is from Caniuse, which has more detail. A number indicates that browser supports the feature at that version and up.



Mobile / Tablet

iOS SafariOpera MobileOpera MiniAndroidAndroid ChromeAndroid Firefox

At the time of this update, Firefox 61 supports crisp-edges but not pixelated and Chrome 68 supports pixelated but not crisp-edges.


  1. User Avatar
    Permalink to comment#

    You say ” In this example Chrome will remove the default anti-aliasing:” But wouldn’t it be called ‘aliasing’. Aliasing technically is a blending of two different things together on the edges of those things right? So the browser performs ALIASING on images that are scaled up right? Just a a little confused. Thanks

    • User Avatar
      Permalink to comment#

      You’ve got it backwards. Aliasing is what happens when a signal is digitized and values close to each other become the same value because the digital resolution simply doesn’t allow anything to exist “between” the pixels or sample points. Anti-aliasing is what’s done to combat this.

  2. User Avatar

    Why are vendor prefixes used, when you make it seem like image-rendering: pixelated; is all you need? Your QR-Code example CSS says:

    .pixelated {
      image-rendering: pixelated;

    But when you inspect it with a webbrowser’s developer tools it says:

    .pixelated {
        -ms-interpolation-mode: nearest-neighbor;
        image-rendering: -webkit-optimize-contrast;
        image-rendering: -moz-crisp-edges;
        image-rendering: pixelated;

    Also the Browser support table lists Opera red (unsupported), but IE yellow (partially supported). It should be the other way around, like the text in the table says.

  3. User Avatar

    Hi there,
    I came across your website while looking for a solution to my problem with blurry images in WordPress. They are blurry only in Chrome, IE and Firefox display them as they should look like…

    On the forum I’ve found that:

    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) */

    Where exactly should I put it to apply the code to all images on my WP page and will that fix the blurriness in Chrome?


    • User Avatar
      Permalink to comment#

      Been a while since this was posted but thought I’d answer anyway. Just like the above article implies, the easiest and most basic way to implement this is to put your css code into your main stylesheet under the “img” selector. If in WordPress that would be in your theme’s primary style.css.

      img {
      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) */

  4. User Avatar
    Permalink to comment#

    This would have been such a great feature; however, once again browser difference makes one feel outdated!

  5. User Avatar
    Permalink to comment#

    Image-rendering: -webkit-optimize-contrast doesn’t works in Chrome now. I don’t know why.

    • User Avatar
      Permalink to comment#

      Works for me in chrome

    • User Avatar
      Permalink to comment#

      image-rendering: -webkit-optimize-contrast;
      image-rendering: crisp-edges;
      Will both work in Chrome.
      In fact crisp-edges is likely to give the image a moire effect in Windows.
      The webkit-optimize-contrast renders better in Chrome and will override crisp-edges.

  6. User Avatar
    Sam Keddy
    Permalink to comment#

    Complete lack of support in Edge. Thanks Microsoft. Guess I’ll just tell my users to download a different browser.

Leave a Comment

Posting Code!

You may write comments in Markdown. This makes code easy to post, as you can write inline code like `<div>this</div>` or multiline blocks of code in triple backtick fences (```) with double new lines before and after.

Code of Conduct

Absolutely anyone is welcome to submit a comment here. But not all comments will be posted. Think of it like writing a letter to the editor. All submitted comments will be read, but not all published. Published comments will be on-topic, helpful, and further the discussion or debate.

Want to tell us something privately?

Feel free to use our contact form. That's a great place to let us know about typos or anything off-topic.