Bug 20956 - Getting a more formal definition for imageSmoothingEnabled
Getting a more formal definition for imageSmoothingEnabled
Product: HTML WG
Classification: Unclassified
Component: HTML Canvas 2D Context
PC Windows NT
: P2 normal
: ---
Assigned To: Jay Munro
HTML WG Bugzilla archive list
Depends on:
  Show dependency treegraph
Reported: 2013-02-11 23:19 UTC by Jay Munro
Modified: 2013-03-04 18:43 UTC (History)
5 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Jay Munro 2013-02-11 23:19:48 UTC
With imageSmoothingEnabled checked in, there's been discussion of improving on the description. This bug is to track that.
Comment 1 Tab Atkins Jr. 2013-02-11 23:28:48 UTC
As the canvas property was set up with the same basic use-cases as the CSS property, perhaps just reference one of the values in http://dev.w3.org/csswg/css4-images/#the-image-rendering.  "true" means "image-rendering: auto;", "false" presumably means "image-rendering: pixelated;".
Comment 2 Jay Munro 2013-02-25 21:56:41 UTC
Wouldn't we be looking at more of a model where false doesn't attempt any smoothing, rather than a nearest neighbor to create a pixelated image? The way I read the CSS spec, on scaling up, the image gets pixelated, on scaling down, it looks like smoothing = true.
Comment 3 Tab Atkins Jr. 2013-02-25 22:06:35 UTC
There's no such thing as "doesn't attempt any smoothing" when scaling down.  You have more colors than you can deal with, and you have to resolve that somehow.

Scaling down, smoothing algorithms are much better than some dumb version of NN.  You don't have the same problems as when scaling up.
Comment 4 Jatinder Mann [MSFT] 2013-02-26 23:18:06 UTC
I recommend using the following normative text:

"If the imageSmoothingEnabled attribute is set to false, the user agent must use nearest-neighbor interpolation when rescaling images drawn by the drawImage() method or rescaling patterns created by the createPattern() method. If the imageSmoothingEnabled attribute is set to true, the user agent may use any filtering algorithm, e.g., bilinear or bicubic filtering.

The imageSmoothingEnabled attribute, on getting, must return the last value it was set to. On setting, it must be set to the new value. When the CanvasRenderingContext2D object is created, the attribute must be set to true."
Comment 5 Jay Munro 2013-03-04 18:43:49 UTC
New text added.