Re: [csswg-drafts] [css-color] [filter-effects] Should no-op filters produce different output from no filter? (#7100)

At the risk of derailing this discussion, my feeling on this issue is that we should add a feature to the web where the "working color space" of an element may be specified. This would be similar to a Canvas2D's color space. The behavior is equivalent to: all inputs are converted to that space, and then all interpolation (blending, filters, etc) is done in that space.

The default working color space today is "something not too perceptibly different from sRGB". The wiggle room there is so that compositors, etc, can make concessions to efficiency (e.g, working directly in the output device's color space).

With the ability to specify a working color space, the page's author can decide if they prefer "srgb-linear" or if they want "lab", or any of the other options we are exposing. There is no "right" space for interpolation for all applications (the main dividing line is content to have luminance that is physically linear versus perceptually uniform).

An issue that came up here is "what precision should we provide?". When exposing "display-p3" to Canvas2D, this was also a concern. The phrasing there came out as: Should the selection of a buffer's color space imply a certain precision for that buffer? That was a hard question, and we punted by only exposing "display-p3", where, like "srgb", the most reasonable default would be 8-bit-per-color (we excluded "rec2020" both because the transfer function for it had some contention, but also because 8-bit-per-color is not a reasonable default for that space). For a space like "srgb-linear", 8-bit-per-color is very-not-good. When a developer selects that, should we have a table of "minimum precision for each color space"? Or should the developer have to specify a minimum precision (and default to 8-bit if unspecified, which will look bad, but, if all browsers make it look bad, developers will not accidentally do it).



Re this question:
> For GPU accelerated you're feeding through P3 color values when using srgb matrix?

To clarify, this is: Suppose the user specifies a color filter matrix M. Suppose we have an input color x in P3 space. What is the output in P3 space?

Option A: (1) let y= x converted to sRGB, (2) let z=M*y, (3) let w= z converted to to P3, write w to the P3 output buffer
Option B: write M*x to the P3 output buffer

My understanding is that we do Option B in all paths (GPU and CPU).

-- 
GitHub Notification of comment by ccameron-chromium
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7100#issuecomment-1118785982 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 5 May 2022 16:35:41 UTC