Repository navigation
Description
Description
Major engines implement createImageBitmap(), but they differ in observable behaviour. I hope this is a good fit for Interop.
These differences affect applications and sites that resize photos before upload, apply EXIF orientation, crop images or sprites, process images in workers, capture video frames, or prepare data for graphics APIs.
The proposed scope covers:
- Supported
ImageBitmapSourcetypes. - Cropping, negative dimensions, out-of-bounds pixels, and output dimensions.
- Resizing and the quality keywords inherit order, e.g. medium < high.
imageOrientation: "from-image"and"flipY".colorSpaceConversionandpremultiplyAlpha.- Invalid input and promise settlement.
- Origin cleanliness, closing, serialization, and transfer.
- Window and Worker behaviour covered by WPT.
The scope excludes:
- Performance.
- Exact output for
"low","medium", and"high", since HTML does not require particular interpolation algorithms. imageOrientation: "none", which is not in the current HTML enum.
This proposal revisits the Interop 2025 proposal for createImageBitmap, which I also submitted. I've tried to narrow the scope and add details about tests and how they map to browser bugs, which was some of the feedback I got last year.
My think because of quality issues, it's been overlooked by developers. Manipulating images is applicable in many areas. I think usage would be higher if it just worked better and more consistently across browsers.
Hence this proposal!
Evaluator site and examples
I've published a mini-site (and code) for testing differences across browsers, as well as published my findings. The source + code is open, so easy to review.
Site:
Code:
Findings
These are with my test image, but the code works with any uploaded image.
- 'pixelated' and 'low' modes yields similar results across browsers
- With Chrome there is little difference between 'high' and 'medium'.
- WebKit's 'medium' result is near the reference while 'high' is worse.
- For edge, 'medium' also seems better than 'high'.
Specification
web-feature
createimagebitmap
Test Links
Results
Tests
The dashboard contains 20 files and 314 subtests. Experimental runs pass 298
in Chrome, 299 in Edge, 291 in Firefox, and 259 in Safari.
Some related tests cover WebCodecs VideoFrame and wide-gamut canvas sources:
Someone more knowledgeable than me should decide if the the video source failures and the failure for SVG images without a natural size are relevant and should be in the test selection.
Test gaps
From what I can tell, there are coverage gaps include cropping combined with EXIF orientation, SVG Blob decoding, more Worker source and option combinations, preserving crops through VideoFrame, and stronger colour and alpha checks.
A somewhat elusive thing that's a bit special about this API, is image quality during e.g. resize. If the output isn't "good", developers cannot use it. Sadly, the spec itself doesn't mandate a particular algorithm, but maybe there are still things we can do to improve this area?
I understand that SSIM, SSIMULACRA2, or another perceptual metric may not be on the table.
But for example Chrome has had an issue where 'medium' yielded better results than 'high'. See my test site linked above.
If this isn't considered a great fit for the WPT suite, maybe just doing a shared investigation across the participating browsers against a fixed image corpus, and making sure it's somewhat aligned, i.e. that 'high' or 'medium' doesn't deviate too much across browsers.
Additional Signals
When I asked for feedback on my previous proposal, I was asked for better analysis of WPT coverage and more evidence of developer impact. So I've tried to beef up that section a bit.
Pica, a widely used browser image-resizing library, disables
createImageBitmap() resizing by default. Its documentation says that the
result depends on the browser and recommends its JavaScript and WebAssembly
path for predictable output:
Chromium issue 41313833 documents poor createImageBitmap() downscaling,
including cases where "medium" produced better results than "high". It has
59 comments and several reproductions:
https://issues.chromium.org/issues/41313833 (merged into https://issues.chromium.org/issues/40044062).
Firefox still has an open bug for the unimplemented resizeQuality option:
Other open reports include:
- Chromium: https://issues.chromium.org/issues/40773069
- Chromium: https://issues.chromium.org/issues/362431889
- Chromium: https://issues.chromium.org/issues/339759426
- Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=1797567
- Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=1880753
- WebKit: https://bugs.webkit.org/show_bug.cgi?id=202458
- WebKit: https://bugs.webkit.org/show_bug.cgi?id=237895
- WebKit: https://bugs.webkit.org/show_bug.cgi?id=288115
With better interoperability I think many developers would prefer this API over the more complicated and memory intensive approaches with Canvas or WebAssembly.
Thanks for reading and holding my fingers crossed for this year! 💯
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsTodo
Activity
github-actions commentedon Sep 12, 2026
This comment was automatically generated based on the information you provided. Please don't edit it.
Below is additional information about the web feature (from the web-features project) which is referenced in your proposal.
If this doesn't accurately correspond to your proposal, please update your initial comment to include
web-features: <feature-id>.To find feature IDs, use the web-features explorer.
Feature createImageBitmap
createImageBitmap()global method creates anImageBitmapobject from a source such as an image, SVG, blob, or canvas. AnImageBitmapobject represents pixel data that can be drawn to a canvas with lower latency than other types, such asImageData.jgraham commentedon Sep 18, 2026
The HTML spec doesn't have any normative requirements for resizeQuality:
Without testable requirements, it's hard to include that in Interop; if you think that web developers need more deterministic algorithms then it might be worth filing an issue on the HTML spec.
For the browser bugs you mention it would be good to know which, if any, wpt tests they correspond to. The worry is that selecting this area might cause a bunch of edge cases represented in the tests to be fixed, but not actually address the underlying problems you care about.
sandstrom commentedon Sep 18, 2026
@jgraham I agree that the current low/medium/high language is not sufficient for a scored WPT. But that means the quality part needs investigation, not that it is outside interoperability work.
Seems to be some precedent. For example:
jgraham commentedon Sep 18, 2026
Yes, you can definitely split this proposal into a focus area part and an investigation part; if you want to do that please file a separate issue for the latter.
When assessing proposals clarity on the intended scope is really helpful because it means that people are on the same page about what the proposal actually requires. For focus area proposals that ultimately means what's covered by the tests, and mismatches between what the proposal hopes to cover and what the tests actually cover can be a negative signal because it suggests that even if you select the proposal you might not actually solve the underlying problem.
sandstrom commentedon Sep 18, 2026
@jgraham Alright, I see your point, and thanks for engaging! 😄
But if we stay on the 'focus area part' a bit longer.
I'm no web spec wizard, but if you ask me, even a spec that doesn't mandate an algorithm, when you have different quality levels named 'low', 'medium' and 'high', the only reasonable interpretation should be that 'high' should yield higher-quality results than 'medium', right? (honest question, let me know if you disagree)
Because right now, 2 out of 4 browsers tested will yield better results in medium than on high.
I can see why it might happen. For example, I think an implementation on 'medium' might grab a mathematically averaged, smaller version from its internal mipmap tree, smoothing out the harsh transitions and producing a cleaner/sharper downscaled result.
But this isn't about how it happens, my objection is that it's hard for developers to use across browsers, because you need to know details if each browser implementation to know whether you should pick 'medium' or 'high' for the best result. Also might vary between upscale and downscale.
To me, this feels like an interop problem and a testable requirement, even when leaving the fact that algo is not specified in spec. The 'order' of the quality enum does signal something meaningful, which isn't true.
I've published a mini-site (with source code) where you can upload any image and see results for each quality factor (or compare browsers).
If you want to quickly batch say 10 images across all browsers and compare, ask your agent to use e.g. Playwright CLI to do it quickly.
Site:
https://sandstrom.github.io/create-image-bitmap-comparison/
Code:
https://github.com/sandstrom/create-image-bitmap-comparison/
jgraham commentedon Sep 24, 2026
I agree that seems natural, but I can also imagine lots of reasons that it might not work out in practice (e.g. for specific inputs your fast "medium" algorithm might give better output than your slower "high" algorithm).
So I agree that you could reasonably file browser bugs and complain about the current behaviour if it doesn't match expectations. And I agree it's annoying! It's just hard to include in Interop until there's actual spec text to document agreement about what the required constraints are, and web-platform-tests that check those requirements.
ccameron-chromium commentedon Sep 29, 2026
I would like to get the spec into a better place here. In particular:
drawImage,texImage2D, etc).I would like to see this cleaned up, but it needs to be cleaned up in the spec first.