ColorWeb-CG
ColorWeb-CG copied to clipboard
Canvas, bitmap rendering context and readback
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
originally noted here
gs to audit to ensure that the platform has good support throughout for out-of-sRGB colors:
(this one I'm pretty sure about) everything to do with canvas pixel manipulation, including the
ImageDatainterface, to have variants that allow getting canvas data that's outside of the sRGB gamutthe algorithm for serializing bitmaps, to ensure that it's possible to serialize any possible canvas accurately
@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?
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)."