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: Apply img and blob colorSpaceConversion to all sources. #10577

Open
ccameron-chromium opened this issue Aug 26, 2024 · 1 comment

Comments

@ccameron-chromium
Copy link
Contributor

ccameron-chromium commented Aug 26, 2024

What is the issue with the HTML Standard?

Among the steps in createImageBitmap is the following:

  • If image is an img element or a Blob object, let val be the value of the colorSpaceConversion member of options, and then run these substeps:
    • If val is "default", the color space conversion behavior is implementation-specific, and should be chosen according to the default color space that the implementation uses for drawing images onto the canvas.
    • If val is "none", output must be decoded without performing any color space conversions. This means that the image decoding algorithm must ignore color profile metadata embedded in the source data as well as the display device color profile.

At the time of writing of the spec, the only non-sRGB content on the web were images. As a consequence, the spec leaves as ambiguous how the color spaces of all other sources (e.g, videos, canvases, ImageData, etc) should be handled.

(See this comment for a more thorough discussion -- there is also a "don't imply that YUV to RGB conversion would be skipped" aspect).

The proposal in this issue is to remove the "If image is an img element or a Blob object" clause from the text (see this proposed commit), so that we remove this ambiguity in a way that treats all content the same.

Further clarifications of the behavior of createImageBitmap with colorSpaceConversion:"none" are needed, but I've separated out those issues into #10578.

@fserb
Copy link
Contributor

fserb commented Aug 27, 2024

tagging @whatwg/canvas but it seems that there was already consensus on the WebGL meeting around this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants
@fserb @annevk @ccameron-chromium and others