Re: [csswg-drafts] [css-color-6] add color functions for some (or all) compositing/blending operations (#8431)

From my reading of the compositing spec, blend is applied, values clamped to maximum and minimum, then source-over for the alpha blending. The clamp will obviously cause differences if just an extended sRGB space is used:

Below shows `color(rec2020 0 1 1 / 0.5)` layered on top of `color(rec2020 1 0 1 )`.  Blending is processed in sRGB, Display-P3, and Rec. 2020 (in that order). Gamut mapping is applied afterward.

<img width="214" alt="Screenshot 2024-08-29 at 1 28 59 PM" src="https://github.com/user-attachments/assets/c75d37ff-73ed-4b20-a5aa-81d3d740124d">

If we remove the clamp after blend to try and allow the extended sRGB to behave better, the results are different, but still vary depending on the compositing space.

<img width="251" alt="Screenshot 2024-08-29 at 1 32 23 PM" src="https://github.com/user-attachments/assets/a6cbaf94-489e-4bb7-8b9e-84c37ea3836c">

If we process `color(srgb 0 1 1 / 0.5)` layered on top of `color(srgb 1 0 1 )` in sRGB, and `color(display-p3 0 1 1 / 0.5)` layered on top of `color(display-p3 1 0 1 )`  in Display P3, and do the same for Rec. 2020, the results seem more like you'd expect.

<img width="221" alt="Screenshot 2024-08-29 at 1 37 44 PM" src="https://github.com/user-attachments/assets/58b5fb9e-a22b-494a-8ee8-083ac6b58d7f">

I imagine that allowing different compositing spaces depending on your working gamut would make sense.









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


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

Received on Thursday, 29 August 2024 19:42:33 UTC