A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/imageSmoothingQuality below:

CanvasRenderingContext2D: imageSmoothingQuality property - Web APIs

CanvasRenderingContext2D: imageSmoothingQuality property

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.

Value

One of the following:

"low"

Low quality.

"medium"

Medium quality.

"high"

High quality.

The default value is "low".

Examples Setting image smoothing quality

This example uses the imageSmoothingQuality property with a scaled image.

HTML
<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