W3C home > Mailing lists > Public > public-fx@w3.org > April to June 2021

Re: [compositing] Incorrect recommended implemntation of mix-blend-mode: saturation

From: Chris Lilley <chris@w3.org>
Date: Sat, 3 Apr 2021 19:48:27 -0400
Message-ID: <11428348-ee76-b1e2-89f6-9ac5836ea9b8@w3.org>
To: public-fx@w3.org

On 2021-04-02 07:00, Callum Morrisson wrote:
> RE: https://www.w3.org/TR/compositing-1/#valdef-blend-mode-saturation 
> <https://www.w3.org/TR/compositing-1/#valdef-blend-mode-saturation>
> The math used in the functions:
> Lum(C) = 0.3 x Cred + 0.59 x Cgreen + 0.11 x Cblue
> and
> Sat(C) = max(Cred, Cgreen, Cblue) - min(Cred, Cgreen, Cblue)
> seems to be taken from the calculations for Luma and Chroma 
> (respectively) in the LCH color space (as seen here 
> <https://en.wikipedia.org/wiki/HSL_and_HSV#Hue_and_chroma> and here 
> <https://en.wikipedia.org/wiki/HSL_and_HSV#Luma,_chroma_and_hue_to_RGB>).

Not at all. LCH doesn't have a "Luma" and your two links go to

which, as the name implies, are about HSL and HSV.

The "Lum" here is

a) not CIE Luminance
b) uses the weights for the obsolete NTSC colorspace
c) operates directly on gamma-encoded values.

The closest would be 1960's YIQ luma.

> However, the expectation would be that it's derived from 
> lightness/luminance and saturation from the HSL or HSV/HSB color spaces.

I don't see why, those spaces are also pretty messed up. (HSL Lightness 
s the same for blue and yellow, for example).

Chris Lilley
Technical Director @ W3C
W3C Strategy Team, Core Web Design
W3C Architecture & Technology Team, Core Web & Media
Received on Saturday, 3 April 2021 23:52:20 UTC

This archive was generated by hypermail 2.4.0 : Saturday, 3 April 2021 23:52:21 UTC