[Public WebGL] gamma/color profile and sRGB

Florian Bösch [email protected]
Fri Nov 21 00:19:02 PST 2014


On Thu, Nov 20, 2014 at 11:36 PM, Kenneth Russell <[email protected]> wrote:

> How would an API like this work in the browser? The browser's window
> can be dragged from screen to screen, changing the answer this API
> returns.
>
You could have a canvas.addEventListener('gammaRamp', function(ramp){...})
which triggers whenever the majority of the canvas finds itself on a
different display.

The browser is supposed to transform colors specified in the sRGB
> color space ( http://www.w3.org/TR/css3-color/ ) to the display's
> color profile. In practice, only Safari and IE handle this correctly
> today, and they rely on the OS's colorspace support to do so. There's
> an ongoing effort in Chrome to handle multiple displays' color
> profiles correctly, and to do so on all operating systems. Not sure
> about work in this area in Firefox.
>
There's two things to do actually.

   1. Make sure that no color space conversion is applied if the WebGL
   context returns plain values. This would make roll-your-own colorspace
   handling easier.
   2. Make sure that the correct color space conversion is applied if the
   WebGL context does return in sRGB (for which we're currently lacking any
   mechanism)

For WebGL 2.0 I think a new context creation attribute is needed to
> let the application allocate an sRGB back buffer. The browser's
> compositor would handle that differently when drawing it to the
> screen. More guidance from experts in colorspace handling is needed.
>

We've had the discussion on explicit drawing buffer creation a while ago
(in a different context). Where it partained to attaching a context to
different drawing buffers, which would be quite useful. Does the canvas CR2
spec handle this case by now? Could we have an interface to explicitely
create drawing buffers? It would sometimes be useful to be able to draw on
different drawing buffers with different attributes (for testing and other
things).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://khronos.org/pipermail/public_webgl_khronos.org/attachments/20141121/7281b7ac/attachment.html>


More information about the public_webgl mailing list