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

createImageBitmap #731

Open
sandstrom opened this issue Sep 19, 2024 · 0 comments
Open

createImageBitmap #731

sandstrom opened this issue Sep 19, 2024 · 0 comments
Labels
focus-area-proposal Focus Area Proposal

Comments

@sandstrom
Copy link

sandstrom commented Sep 19, 2024

Description

Iron out the problems surrounding createImageBitmap.

Background

createImageBitmap has been around for a while, but the implementations has several flaws, around image quality, EXIF handling, handling of color spaces, etc. These issues makes the API difficult to use in practice.

A few examples of API use-cases:

  • Extract sprites from a sprite sheet
  • Take snapshots from a video feed
  • Resize images on-device before uploading to a server (for example from <input capture…)
    • On-device image resize is quite tricky, with the only work-arounds being complicated canvas use, which often will run into limitations, for example iOS canvas memory limits.
  • Crop images on-device
  • Take non-rotated image pixels with an associated EXIF tag and output rotated pixels (without any EXIF), or put differently strip EXIF and apply rotation to image data.
    • This is useful since many server-side systems prefer to handle all images without accompanying exif rotation data.

Problem

Copied below are a few examples of browser bugs. These are not the only issues, but should give a few examples.

I think if all the issues around this method could be ironed out, it would enable a lot of great utility! But right now, it isn't quite there.

Specification

https://html.spec.whatwg.org/dev/imagebitmap-and-animations.html

Additional Signals

Can I Use

https://caniuse.com/createimagebitmap

Browser bugs

A few examples from the three top browser engines:

Chromium
Firefox
Safari
@sandstrom sandstrom added the focus-area-proposal Focus Area Proposal label Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
focus-area-proposal Focus Area Proposal
Projects
Status: No status
Development

No branches or pull requests

1 participant