Intent to Experiment: Canvas color management

200 views
Skip to first unread message

Christopher Cameron

unread,
Feb 16, 2021, 3:59:34 PM2/16/21
to blink-dev

Contact emails

ccam...@google.comyi...@google.comfs...@google.comju...@google.com

Explainer/Specification

https://github.com/WICG/canvas-color-space/blob/master/CanvasColorSpaceProposal.md

API spec

Yes

Summary

Adds the ability for 2D canvas, WebGL, and WebGPU to specify a color space and storage format, enabling wide color gamut and high dynamic range content.



Blink component

Blink

TAG review

None

TAG review status

Pending

Risks


Interoperability and Compatibility

None

Gecko: No signal
WebKit: No signal
Web developers: No signals


Goals for experimentation

Allow third party developers to use the API and provide feedback.



Reason this experiment is being extended

None



Ongoing technical constraints

None



Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?

Yes

Is this feature fully tested by web-platform-tests?

Yes (testing of implemented features)

Tracking bug

https://crbug.com/1083693

Launch bug

https://crbug.com/1178707

Link to entry on the Chrome Platform Status

https://www.chromestatus.com/feature/5807007661555712

Rik Cabanier

unread,
Feb 16, 2021, 5:49:44 PM2/16/21
to Christopher Cameron, blink-dev
Hi Christopher,

I'm excited to see this moving forward!

Does canvas color management also apply to WebXR content?
What would happen if you request a wide gamut canvas but the device is not able to create a WebXR session with that feature?


--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAGnfxj87SYantY%3D4Cw4AFdD4Yk4rO5hW8vUhdU33%2BJtwbE%2Bdhg%40mail.gmail.com.

Christopher Cameron

unread,
Feb 17, 2021, 3:59:16 AM2/17/21
to Rik Cabanier, blink-dev
On Tue, Feb 16, 2021 at 2:49 PM Rik Cabanier <caba...@gmail.com> wrote:
Hi Christopher,

I'm excited to see this moving forward!

Does canvas color management also apply to WebXR content?

I think yes (I'm not an expert in WebXR, so I may be reading this wrong). I think that a XRWebGLRenderingContext would get whatever color space was specified in its underlying WebGLRenderingContext )or WebGL2RenderingContext
 
What would happen if you request a wide gamut canvas but the device is not able to create a WebXR session with that feature?

If one requests a WCG canvas, but WCG is not supported, then the "extra" colors are clamped to the monitor's color space. There exists a media query that can be used to determine if the user will be able to see a wider gamut than sRGB. Developers can use this to target an appropriate gamut.

(A similar media query for HDR is in development, I believe).

Rik Cabanier

unread,
Feb 17, 2021, 1:26:35 PM2/17/21
to Christopher Cameron, blink-dev
On Wed, Feb 17, 2021 at 12:59 AM Christopher Cameron <ccam...@google.com> wrote:



On Tue, Feb 16, 2021 at 2:49 PM Rik Cabanier <caba...@gmail.com> wrote:
Hi Christopher,

I'm excited to see this moving forward!

Does canvas color management also apply to WebXR content?

I think yes (I'm not an expert in WebXR, so I may be reading this wrong). I think that a XRWebGLRenderingContext would get whatever color space was specified in its underlying WebGLRenderingContext )or WebGL2RenderingContext

Great! Would you mind including this in your explainer?
I wonder if we need to update the WebXR spec to refer to your spec. 
 
What would happen if you request a wide gamut canvas but the device is not able to create a WebXR session with that feature?

If one requests a WCG canvas, but WCG is not supported, then the "extra" colors are clamped to the monitor's color space. There exists a media query that can be used to determine if the user will be able to see a wider gamut than sRGB. Developers can use this to target an appropriate gamut.

My question was more on what if a color space is supported for the 2D browser, but not when going immersive. 
Maybe `MakeXRCompatible` [1] could switch the framebuffer layout?

Christopher Cameron

unread,
Feb 17, 2021, 2:11:25 PM2/17/21
to Rik Cabanier, blink-dev
On Wed, Feb 17, 2021 at 10:26 AM Rik Cabanier <caba...@gmail.com> wrote:


On Wed, Feb 17, 2021 at 12:59 AM Christopher Cameron <ccam...@google.com> wrote:



On Tue, Feb 16, 2021 at 2:49 PM Rik Cabanier <caba...@gmail.com> wrote:
Hi Christopher,

I'm excited to see this moving forward!

Does canvas color management also apply to WebXR content?

I think yes (I'm not an expert in WebXR, so I may be reading this wrong). I think that a XRWebGLRenderingContext would get whatever color space was specified in its underlying WebGLRenderingContext )or WebGL2RenderingContext

Great! Would you mind including this in your explainer?
I wonder if we need to update the WebXR spec to refer to your spec. 

I'll add WebXR considerations to it.
 
 
What would happen if you request a wide gamut canvas but the device is not able to create a WebXR session with that feature?

If one requests a WCG canvas, but WCG is not supported, then the "extra" colors are clamped to the monitor's color space. There exists a media query that can be used to determine if the user will be able to see a wider gamut than sRGB. Developers can use this to target an appropriate gamut.

My question was more on what if a color space is supported for the 2D browser, but not when going immersive. 
Maybe `MakeXRCompatible` [1] could switch the framebuffer layout?

I'd have to find out what MakeXRCompatible does at the OS level -- depending on the performance guarantees we give, there may indeed be limitations

Yoav Weiss

unread,
Feb 18, 2021, 9:44:49 AM2/18/21
to Christopher Cameron, blink-dev
What's the timeframe for experimentation? Do you have partners lined up?

On Tue, Feb 16, 2021 at 9:59 PM 'Christopher Cameron' via blink-dev <blin...@chromium.org> wrote:

Contact emails

ccam...@google.comyi...@google.comfs...@google.comju...@google.com

Explainer/Specification

https://github.com/WICG/canvas-color-space/blob/master/CanvasColorSpaceProposal.md

API spec

Yes

Summary

Adds the ability for 2D canvas, WebGL, and WebGPU to specify a color space and storage format, enabling wide color gamut and high dynamic range content.



Blink component

Blink

TAG review

None

TAG review status

Pending

Did you file for a TAG review? I don't think we should block this intent on this, but it would be good to let the TAG know about this before I2S time.
 


Risks


Interoperability and Compatibility

None

Gecko: No signal
WebKit: No signal

Can you ask for signals? bit.ly/blink-signals 

Web developers: No signals

The explainer says that there are demands from developers for this. Seems like that should count as a signal.
 


Goals for experimentation

Allow third party developers to use the API and provide feedback.



Reason this experiment is being extended

None



Ongoing technical constraints

None



Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?

Yes

Is this feature fully tested by web-platform-tests?

Yes (testing of implemented features)

Can you link to the test suite?
This is not a public issue, so I don't think it's relevant here.
 


Link to entry on the Chrome Platform Status

https://www.chromestatus.com/feature/5807007661555712

Christopher Cameron

unread,
Feb 18, 2021, 1:41:23 PM2/18/21
to Yoav Weiss, blink-dev
On Thu, Feb 18, 2021 at 6:44 AM Yoav Weiss <yo...@yoav.ws> wrote:
What's the timeframe for experimentation? Do you have partners lined up?

We have two partners who would like to use the feature via OT, ideally in Chrome 90.

yo...@yoav.ws

unread,
Feb 18, 2021, 2:44:30 PM2/18/21
to blink-dev, Christopher Cameron, blink-dev, yo...@yoav.ws
Origin trials are time bound. When are you planning for the trial to end?

Christopher Cameron

unread,
Feb 18, 2021, 4:14:13 PM2/18/21
to yo...@yoav.ws, blink-dev
On Thu, Feb 18, 2021 at 11:44 AM yo...@yoav.ws <yo...@yoav.ws> wrote:
Origin trials are time bound. When are you planning for the trial to end?

We plan to be done by 93 or 94.

Chris Harrelson

unread,
Feb 18, 2021, 11:10:06 PM2/18/21
to Christopher Cameron, yo...@yoav.ws, blink-dev
On Thu, Feb 18, 2021 at 1:14 PM 'Christopher Cameron' via blink-dev <blin...@chromium.org> wrote:


On Thu, Feb 18, 2021 at 11:44 AM yo...@yoav.ws <yo...@yoav.ws> wrote:
Origin trials are time bound. When are you planning for the trial to end?

We plan to be done by 93 or 94.

You need to pick one and stick to it. Please read the intent-to-experiment documentation and fill out all the fields, not just the minimum possible.
"Use and provide feedback" is not a good enough reason. Why can't these partners provide feedback by just testing locally behind a flag? What do you hope to learn from their feedback?
 


Reason this experiment is being extended

None



Ongoing technical constraints

None



Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?

Yes

Is this feature fully tested by web-platform-tests?

Yes (testing of implemented features)

Can you link to the test suite?
 

This is not a public issue, so I don't think it's relevant here.
 


Link to entry on the Chrome Platform Status

https://www.chromestatus.com/feature/5807007661555712

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAGnfxj87SYantY%3D4Cw4AFdD4Yk4rO5hW8vUhdU33%2BJtwbE%2Bdhg%40mail.gmail.com.

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.

Christopher Cameron

unread,
Feb 25, 2021, 2:04:14 AM2/25/21
to Yoav Weiss, blink-dev, Yi Xu, Fernando Serboncini, Justin Novosad, Thomas Nattestad
I didn't notice all of the inline questions here -- sorry for the short reply earlier!

Adding nattestad to help with partner questions (and fserb, junov, and yiyix for other questions).

On Thu, Feb 18, 2021 at 6:44 AM Yoav Weiss <yo...@yoav.ws> wrote:
What's the timeframe for experimentation? Do you have partners lined up?

We have a handful of partners -- I'll circle back with a list once I make sure they're okay with being listed (it's likely not an issue, but I have chronic foot-in-mouth with these things).
 

On Tue, Feb 16, 2021 at 9:59 PM 'Christopher Cameron' via blink-dev <blin...@chromium.org> wrote:

Contact emails

ccam...@google.comyi...@google.comfs...@google.comju...@google.com

Explainer/Specification

https://github.com/WICG/canvas-color-space/blob/master/CanvasColorSpaceProposal.md

API spec

Yes

Summary

Adds the ability for 2D canvas, WebGL, and WebGPU to specify a color space and storage format, enabling wide color gamut and high dynamic range content.



Blink component

Blink

TAG review

None

TAG review status

Pending

Did you file for a TAG review? I don't think we should block this intent on this, but it would be good to let the TAG know about this before I2S time.

No, we have not filed for a TAG review.
 
 


Risks


Interoperability and Compatibility

None

Gecko: No signal
WebKit: No signal

Can you ask for signals? bit.ly/blink-signals 

I have not received formal signals, but informal indications have been positive. This specification has been developed with contributions from Gecko engineers. It is being actively discussed in W3C color group biweekly calls, with Gecko and WebKit engineers involved.


Web developers: No signals

The explainer says that there are demands from developers for this. Seems like that should count as a signal.

Yes, this has been requested by several partners. Deferring to Thomas to list some.

 


Goals for experimentation

Allow third party developers to use the API and provide feedback.



Reason this experiment is being extended

None



Ongoing technical constraints

None



Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?

Yes

Is this feature fully tested by web-platform-tests?

Yes (testing of implemented features)

Can you link to the test suite?

There are several tests in fast/canvas/color-space for end-to-end testing. There also exist the usual assorted unit tests.

 

This is not a public issue, so I don't think it's relevant here.

Oh, that's a Chrome launch bug (which is restrict-view-google) -- is there a different type of launch bug?

Thomas Nattestad

unread,
Feb 25, 2021, 2:21:07 PM2/25/21
to blink-dev, Christopher Cameron, blink-dev, Yi Xu, Fernando Serboncini, Justin Novosad, Thomas Nattestad, yo...@yoav.ws
As requested, jumping in with context on why we want to pursue this OT for partners. We have partners lined up eager to use this API - I can get these partners to add their interest and specific names if that is required, but I believe it isn't. 

We did hear directly from these partners why devtrial / behind a flag is not sufficient and I can pass this along. The partner is expecting to do a beta for some of their users and they can't request these users to go and flip flags. They expect their users to take images and compare the color between the picture and what is shown in the app. They'd like to avoid those comparisons coming up as different and this feature is required for that. 

Let me know any additional details we'd need to provide - happy to provide additional details or take questions :) 

Chris Harrelson

unread,
Feb 25, 2021, 2:40:32 PM2/25/21
to Thomas Nattestad, blink-dev, Christopher Cameron, Yi Xu, Fernando Serboncini, Justin Novosad, yo...@yoav.ws
On Thu, Feb 25, 2021 at 11:21 AM 'Thomas Nattestad' via blink-dev <blin...@chromium.org> wrote:
As requested, jumping in with context on why we want to pursue this OT for partners. We have partners lined up eager to use this API - I can get these partners to add their interest and specific names if that is required, but I believe it isn't. 

 They expect their users to take images and compare the color between the picture and what is shown in the app. They'd like to avoid those comparisons coming up as different and this feature is required for that. 

I see. Is there a risk that this feature would not solve the problem for their users? If so, can you give an example of a potential risk to the current API shape that this experiment gives insight into?

Chris Harrelson

unread,
Feb 25, 2021, 3:34:44 PM2/25/21
to Thomas Nattestad, blink-dev, Christopher Cameron, Yi Xu, Fernando Serboncini, Justin Novosad, yo...@yoav.ws
Thomas clarified off-thread that this partner plans to monitor for beta users comparing results between their web app and an existing native app, to check fidelity of results. 
 
Makes sense to me, LGTM for an experiment from M90 to M93 (timelines also agreed on off-thread).

Reply all
Reply to author
Forward
0 new messages