Skip to content

Allow 2dcontexts to use deeper color buffers #299

Closed as not planned
Closed as not planned
@grorg

Description

@grorg

It is now common to come across displays that support more than 8 bits per channel. HTML Image elements can use these wider-gamut displays by embedding a color profile in the resource. The CSS Working Group is adding a way to specify the profile used in a color definition, and ensuring that colors are not clipped to 0-255.

That leaves Canvas objects. We need at least a few things in order to use better colors in canvas:

  1. When calling getContext("2d", options) we need to specify in the options that we want a deeper backing store. This could be done a few ways (a boolean indicating 10bpp, explicitly saying the depth, or some keywords).
  2. A way to ask an existing canvas object (or the context) how deep its backing store is.
  3. Alternative forms of getImageData and putImageData that are not restricted to 0-255 bytes. For example, we might need a ImageDataFloat that uses floats in the 0-1 range, and get/setImageDataFloat methods.

All existing methods that take images or ImageData would still keep the existing behaviour. That is, if you create a deep canvas and putImageData into it, that data is assumed to be in sRGB.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions