-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Conversation
source
Outdated
<p>To implement "<span data-x="dom-ResizeQuality-pixelated">pixelated</span>", 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 an interpolation method.</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be located together with the enum value definition above.
Also, in the note directly above this it says that for pixelated there is a specific algorithm, which doesn't really appear to be the case. We should probably fix that while here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can certainly move it up with the enum. I was unsure where to put it.
Pixelated is more specific than the others, but I agree it is not fully defined. Could I address that by changing "... using an interpolation method." to "... using bilinear interpolation." The latter is the actual intent.
Or am I misunderstanding and you're saying it's not formatted as an algorithm with numbered steps etc. I could do that too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you specify the interpolation method I think that's clear enough for now.
At some point what happens should be defined as part of the overall algorithm that manipulates an image, but that's the larger rewrite I failed at completing many years ago. 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. New version up that I think addresses the issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ping. Just trying to wrap things up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unable to push my editorial tweaks because "Allow edits from maintainers" is not checked for this PR. Can you enable that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not seeing the checkbox to allow edits in the location that GiitHub docs say it should exist (below the Notifications component). Am I missing something? Is there another way to communicate the edits?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason it's not on by default is because you're doing this from an organizational fork instead of an individual one. But in the past other Igalians like @Ms2ger have succeeded in finding and checking the box...
Anyway, I'll just give you the diff instead.
iff --git a/source b/source
index 12624faf..17ae0c22 100644
--- a/source
+++ b/source
@@ -115842,11 +115842,10 @@ <h3 split-filename="imagebitmap-and-animations">Images</h3>
smoothing as necessary to avoid distorting the image when the target size is not a clean multiple
of the original.</p>
- <p>To implement "<span data-x="dom-ResizeQuality-pixelated">pixelated</span>", 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>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
@@ -115864,7 +115863,8 @@ <h3 split-filename="imagebitmap-and-animations">Images</h3>
<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, except for "<span data-x="dom-ResizeQuality-pixelated">pixelated</span>" as described above.</p>
+ be used, except for "<code data-x="dom-ResizeQuality-pixelated">pixelated</code>" as described
+ above.</p>
</div>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, not sure that I did find the checkbox; I may have had to move my PRs to my own fork. I'll delete the organisational fork once this PR is in. (Grumbles at GitHub)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. Edits applied. Much annoyance with GitHub authentication.
The definition of pixelated image scaling in https://html.spec.whatwg.org/multipage/imagebitmap-and-animations.html#dom-resizequality-pixelated was broken by an earlier edit. Fix it by adopting the CSS definition of pixelated from https://drafts.csswg.org/css-images-3/#valdef-image-rendering-pixelated. Effort was made to integrate the CSS definition into the existing content (createImageBitmap does not support the same set of smoothing options as CSS)..
Fixed: #3485
/imagebitmap-and-animations.html ( diff )