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

I'd actually been meaning to write up some tests for gradients to test the decision (edit:actually it's still merely a suggestion) in https://github.com/w3c/csswg-drafts/issues/4647, that gradients interpolate in the colorspace of their components if they're all the same, and Lab otherwise.

The approach I had in mind was this: https://jsbin.com/nowiwil/1/edit?html,css,output

Broadly: with 8-bit color, a wide enough gradient and no dithering, the mid-point of the gradient is effectively a solid block of color. Of course if dithering is introduced this approach won't be possible.

(aside: we use simple RGB-differencing when we compare our renderings against the reference images in our test harness. We did try switching to Delta-E, but the slowdown was absurd - a factor of 10 or so. No doubt things would be better in C, but there's bound to be a cost if you require Delta-E for differences)

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

Received on Wednesday, 26 February 2020 14:18:58 UTC