The imageSmoothingQuality property of the CanvasRenderingContext2D interface, part of the Canvas API, lets you set the quality of image smoothing.
Note: For this property to have an effect, imageSmoothingEnabled must be true.
One of the following:
"low"Low quality.
"medium"Medium quality.
"high"High quality.
The default value is "low".
This example uses the imageSmoothingQuality property with a scaled image.
<canvas id="canvas"></canvas>const canvas = document.getElementById("canvas");
const ctx = canvas.getContext("2d");
let img = new Image();
img.src = "canvas_create_pattern.png";
img.onload = () => {
ctx.imageSmoothingQuality = "low";
ctx.drawImage(img, 0, 0, 300, 150);
};CanvasRenderingContext2DCanvasRenderingContext2D.imageSmoothingEnabledimage-rendering