Categories
CSS

How to disable interpolation when scaling a canvas with CSS?

Spread the love

Sometimes, we want to disable interpolation when scaling a canvas with CSS.

In this article, we’ll look at how to disable interpolation when scaling a canvas with CSS.

How to disable interpolation when scaling a canvas with CSS?

To disable interpolation when scaling a canvas with CSS, we can set the image-rendering style to pixelated.

For instance, we write

canvas {
  image-rendering: pixelated;
}

to select the canvas and set its image-rendering style to pixelated to disable interpolation on the canvas when scaling.

Conclusion

To disable interpolation when scaling a canvas with CSS, we can set the image-rendering style to pixelated.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *