- From: Christopher Cameron via GitHub <sysbot+gh@w3.org>
- Date: Fri, 19 Aug 2022 22:10:14 +0000
- To: public-css-archive@w3.org
A data point with respect to 2D canvas (which has supported display-p3 ImageData for a while now, on more than one browser).
Consider the following code which writes color(display-p3 1 0 0) to an sRGB canvas and reads it back.
```
var element = document.getElementById("MyCanvas");
var context = element.getContext('2d', {colorSpace:'srgb'});
var put_image_data = new ImageData(1, 1, {colorSpace:'display-p3'});
put_image_data.data[0] = 255;
put_image_data.data[1] = 0;
put_image_data.data[2] = 0;
put_image_data.data[3] = 255;
context.putImageData(put_image_data, 0, 0);
var get_image_data = context.getImageData(0, 0, 1, 1);
console.log(get_image_data);
```
This code returns the color [255, 0, 0, 255] (the clipped, not-gamut-mapped value) in all browsers that support ImageDataSettings. In all browsers that support color level 4 syntax, if you replace the `putImageData` with
```
context.fillStyle = 'color(display-p3 1 0 0)';
context.fillRect(0, 0, 1, 1);
```
then you still get the same (clipped, not-gamut-mapped) result.
When I was writing the spec change for WCG canvas, I was definitely intending "relative colorimetric intent" to mean "clipping" (although I now see that there are various definitions of various vagueness for this).
I'm pretty sure there are WPT tests that enforce this behavior, too (with inputs that are images, too).
--
GitHub Notification of comment by ccameron-chromium
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7610#issuecomment-1221127647 using your GitHub account
--
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Friday, 19 August 2022 22:10:16 UTC