Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the definition of pixelated for createImageBitmap. #10491

Merged
merged 4 commits into from
Aug 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -115930,9 +115930,15 @@ dictionary <dfn dictionary>ImageBitmapOptions</dfn> {
interpolation quality to use when scaling images.</p>

<p>The "<dfn enum-value for="ResizeQuality"><code
data-x="dom-ResizeQuality-pixelated">pixelated</code></dfn>" value indicates a preference to scale
the image that maximizes the appearance. Scaling algorithms that "smooth" colors are acceptable,
such as bilinear interpolation.</p>
data-x="dom-ResizeQuality-pixelated">pixelated</code></dfn>" value indicates a preference for
scaling the image to preserve the pixelation of the original as much as possible, with minor
smoothing as necessary to avoid distorting the image when the target size is not a clean multiple
of the original.</p>

<p>To implement "<code data-x="dom-ResizeQuality-pixelated">pixelated</code>", for each axis
independently, first determine the integer multiple of its natural size that puts it closest to
the target size and is greater than zero. Scale it to this integer-multiple-size using nearest
neighbor, then scale it the rest of the way to the target size using bilinear interpolation.</p>

<p>The "<dfn enum-value for="ResizeQuality"><code data-x="dom-ResizeQuality-low">low</code></dfn>"
value indicates a preference for a low level of image interpolation quality. Low-quality image
Expand All @@ -115950,7 +115956,8 @@ dictionary <dfn dictionary>ImageBitmapOptions</dfn> {
<p class="note">Bilinear scaling is an example of a relatively fast, lower-quality image-smoothing
algorithm. Bicubic or Lanczos scaling are examples of image-scaling algorithms that produce
higher-quality output. This specification does not mandate that specific interpolation algorithms
be used unless the value is "<span data-x="dom-ResizeQuality-pixelated">pixelated</span>".</p>
be used, except for "<code data-x="dom-ResizeQuality-pixelated">pixelated</code>" as described
above.</p>

</div>

Expand Down