ColorWeb-CG icon indicating copy to clipboard operation
ColorWeb-CG copied to clipboard

Canvas, bitmap rendering context and readback

Open svgeesus opened this issue 5 years ago • 3 comments

Originally raised on the TAG review of Lab

@dbaron wrote:

ImageBitmapRenderingContext including readback APIs (e.g., the format of raw bitmap data that you get back)

discussion of those issues to be added to Canvas API seciton of the report

svgeesus avatar Apr 28 '20 13:04 svgeesus

originally noted here

gs to audit to ensure that the platform has good support throughout for out-of-sRGB colors:

svgeesus avatar Apr 28 '20 13:04 svgeesus

@ccameron-chromium Does the proposal at https://github.com/WICG/canvas-color-space/blob/master/CanvasColorSpaceProposal.md include a readback API as suggested by TAG?

palemieux avatar Jan 11 '21 21:01 palemieux

Yes, that adds a mechanism for reading back data outside of the sRGB gamut (ImageData can be uint8, uint16, or float32 now, and its gamut may be srgb, display-p3, or rec2020). Of note is that float32 ImageData can use numbers outside of the range of [0, 1] to represent any color (in any gamut).

The spec also says "The functions toDataURL and toBlob should produce resources that best match the fidelity of the underlying canvas (subject to the limitations of the implementation and the requested format)."

ccameron-chromium avatar Jan 11 '21 22:01 ccameron-chromium