Open ccameron-chromium opened 2 months ago
It should also be clarified that YUV to RGB conversions will be performed (it's the rest of the color space conversion that will not be performed).
Are there tests covering this?
cc @whatwg/canvas
There are some tests of uploading images with "strange" colorspaces in https://github.com/KhronosGroup/WebGL . Specifically, the assets are under https://github.com/KhronosGroup/WebGL/tree/main/sdk/tests/resources , and the more strenuous ones have names like small-square-with-colorspin-profile.jpg
and small-square-with-colorspin-profile.png
. Feel free to copy these into any new tests for the HTML spec. Tests of other media types like videos still need to be written.
Are there tests covering this?
There is also wpt/html/canvas/element/manual/imagebitmap/createImageBitmap-colorSpaceConversion.html, which tests this with 2D canvas. It currently only does HTMLImageElement
and Blob
, but I'm updating it to include ImageData
, HTMLCanvasElement
, and HTMLVideoElement
.
Maybe off topic, but it would be awesome if the interop 2024 team could iron out the problems surrounding createImageBitmap
.
It would be a great API if it was usable, for example for image resizing after taking a photo using the camera, via <input type='file' multiple accept='image/*' capture='environment'>
.
However, there are a bunch of bugs open on both Firefox, Chromium and Safari, around image quality issues, EXIF rotation and other things.
I think if those could be solved, this API would enable a lot of great utility! But right now, it isn't quite there.
@sandstrom good idea, but indeed the wrong place. Please suggest that over at https://github.com/web-platform-tests/interop/issues as a new issue.
@annevk Thanks! 😄
@annevk I've added an issue here:
https://github.com/web-platform-tests/interop/issues/731
It's my first submission, anything obvious that I've missed?
What is the issue with the HTML Standard?
When
createImageBitmap
is called withcolorSpaceConversion:"none"
, the spec indicates the following:It would be helpful to to clarify that the result will be an
ImageBitmap
that has been stripped of its color space information, and is therefore treated like all other images that have no color profile metadata (see here in canvas and here in CSS color). In particular, the raw RGB color values from the source will be treated as though they are in the sRGB color space.Most likely this is best accomplished via an informative note, as is the case in the canvas section.