How to disable interpolation when scaling a canvas with CSS?

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

How to disable interpolation when scaling a canvas with CSS, we will look at in this article.

How to disable interpolation when scaling a canvas with CSS?

When scaling a canvas with CSS, we can set the image-rendering style to pixelated to disable interpolation .
For instance, we can 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

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

Leave a Reply