How to disable interpolation when scaling a canvas with CSS?

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.