Re: [csswg-drafts] [css-images-3] Allow dithering as a gradient-painting strategy (#4793)

The CSS Working Group just discussed `Allow dithering as a gradient-painting strategy`, and agreed to the following:

* `RESOLVED: Add this to Images 3 and 4`

<details><summary>The full IRC log of that discussion</summary>
&lt;dael> topic: Allow dithering as a gradient-painting strategy<br>
&lt;dael> github: https://github.com/w3c/csswg-drafts/issues/4793<br>
&lt;dael> TabAtkins: webkit uses dithering to make gradients better. This is great. Spec does not allow and dictates every pixel. Technically wk violates but I think spec should allow in both css and canvas<br>
&lt;smfr> (and svg gradients)<br>
&lt;chris> q+<br>
&lt;dino> Related PR on WPT - https://github.com/web-platform-tests/wpt/pull/21647<br>
&lt;dael> TabAtkins: If no one objects I'd like to add a few paragraphs to images to allow dithering. Not sure if you want to say yeah you can dither or if we want to put some restrictions where you should be close like we do for box shodow.<br>
&lt;dbaron> A downside of this means it becomes even more difficult to reftest gradients...<br>
&lt;dael> bkardell_: If it displays and you only have 256 colros no dithering?<br>
&lt;dael> TabAtkins: css doesn't recognize less the 24 bit color. Otherwise no it does define what the display color should be<br>
&lt;dael> dino: CSS spec defines theoretical color. If you display on black and white that's not css problm<br>
&lt;dael> dino: I referenced PR where i changed test to allow dither. It's 2 out of 256 slots can be different in any channel. In practice our dithering is in that range an not all bands.<br>
&lt;bradk> That was me talking, not Brian<br>
&lt;dael> dino: Reason we do this is b/c it does make gradients look better.<br>
&lt;TabAtkins> s/bkardell_ /bradk/<br>
&lt;AmeliaBR> q?<br>
&lt;dino> ack dino<br>
&lt;dael> Rossen_: Let's see if we can move to resolve<br>
&lt;dauwhe> q?<br>
&lt;dael> Rossen_: Sorry chris I didn't see the queue<br>
&lt;bradk> Sorry<br>
&lt;Rossen_> ack chris<br>
&lt;dael> chris: I agree we should allow this. Surprised reading of spec means disallowed. This is wide practice where you need to do things like dither. FOr testing we need to sample on small area so it averages and youg et mean result. I'd be astonished if we disallow<br>
&lt;dael> leaverou: Shouldn't disallow better visual result for testing<br>
&lt;fantasai> +1 to leaverou<br>
&lt;dael> TabAtkins: No one is arguing don't allow diteher. I defined what the color of a gradient should be and didn't think about jiggering it around.<br>
&lt;smfr> you can still do reference testing with some SVG filter stuff to batch the pixel values<br>
&lt;Rossen_> s/jiggering/dithering/<br>
&lt;dael> chris: Disagreement I have is 5%, what does that mean. 2 counts in rgb is noticable in some places. I was suggesting delta-e, maybe that's hard to do. 5% is meaningless.<br>
&lt;dael> TabAtkins: I don't care that much, you won't dither badly. It's what boundries can we put on tests to pass a good impl and not pass a bad one. We did 5% on shadows b/c that lets you say here's the ideal and get close to it. I was going for same deal where it detects when you've gone widely off<br>
&lt;dael> AmeliaBR: Do we have useful reftests for shadow blurring or is that arbitrary rule in spec?<br>
&lt;dael> TabAtkins: Don't know<br>
&lt;dael> dbaron: At least one test which I wrote<br>
&lt;bradk> Are  monitors with larger than normal color gambits not allowed to display more colors in the gradients?<br>
&lt;dael> chris: In general hardly have tests for gradients b/c hard to figure out how to do automatic reftest<br>
&lt;fantasai> Here is dbaron's test http://test.csswg.org/suites/css-backgrounds-3_dev/nightly-unstable/html4/box-shadow-blur-definition-001.htm<br>
&lt;dael> dino: You use svg image and then mask out areas tht should be solid. We have tests in wk<br>
&lt;dino> s/dino/smfr/<br>
&lt;dael> dbaron: Is there a spacial requirements for the dithering? Is it color distance, spacial distance or both?<br>
&lt;chris> can you sent those wk tests to wpt?<br>
&lt;dael> TabAtkins: I had example text and my intention was color distance of ideal color<br>
&lt;dael> dbaron: wk test depends on spacial distance<br>
&lt;dael> TabAtkins: Can you describe that?<br>
&lt;chris> q+<br>
&lt;dael> dbaron: That's what I head from smfr but maybe he can exlain. I thought her said it was for solid segments and masking pieces of boundry<br>
&lt;Rossen_> ack dbaron<br>
&lt;dael> smfr: With continuous gradients you can do component transfer on top to posterize the gradient, convert a range to a flat color. Hides some issues but let's you test interp color stops<br>
&lt;dael> TabAtkins: Artifical banding to get close to idea<br>
&lt;dael> smfr: Correct<br>
&lt;chris> q?<br>
&lt;dino> If you pick the components correctly, you can emphasize the banding in the gradient, and then mask out the relevant portions.<br>
&lt;dael> chris: Two types of dithering. One is higher precision. Calc color and dither to get mix.<br>
&lt;dbaron> smfr also said before the minuted part that they or (or you can) do that for solid parts<br>
&lt;dael> chris: More common is dither position on gradient so if you have linear instea dof a vertical line you fuzz that. I think FF is doing that. We need to allow both<br>
&lt;dael> chris: smfr or dino can you confirm?<br>
&lt;dael> chris: [repeats] I'm assuming you're doing the latter, dither on gradient axis.<br>
&lt;dael> smfr: I don't think it's directional, jut adding noise<br>
&lt;dael> dino: When I suggested test that yous' how I'm testing, not what we do. It's a noise filter on result<br>
&lt;dael> chris: I see<br>
&lt;dael> smfr: It's not wk it's the underlying graphics that's using gq shaders and stuff<br>
&lt;fantasai> Fwiw wrt :--statename vs :state(statename), I think latter is better, clearer, more consistent with ::highlight(), easier to extend<br>
&lt;dael> chris: Seem to have consensus spec shoudl say this, question of how<br>
&lt;smfr> example of a test using feCompontentTransfer: https://codepen.io/smfr/pen/OJVpwoR<br>
&lt;Rossen_> q?<br>
&lt;Rossen_> ack chris<br>
&lt;dael> AmeliaBR: Can we resolve on general spec and then get people to give specific examples of how to test?<br>
&lt;dael> Rossen_: Yep.<br>
&lt;dael> Rossen_: Obj to Add this to Images ?<br>
&lt;dael> TabAtkins: I'll put it in 3 and 4<br>
&lt;dael> Rossen_: Obj to Add this to Images 3 and 4<br>
&lt;fantasai> chris, let's talk about diff specs? I can't solve a problem I don't understand<br>
&lt;smfr> s/gq shaders/gpu shaders/<br>
&lt;dael> RESOLVED: Add this to Images 3 and 4<br>
&lt;dael> TabAtkins: Anyone with tests they can contribute to wpt please convert them so they can be used as ref tests<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4793#issuecomment-591560266 using your GitHub account

Received on Wednesday, 26 February 2020 18:00:20 UTC