Limited availability
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>
JavaScript
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);
};
Result Specifications Browser compatibility See also
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4