[MPEG-OTSPEC] COLRv1 to gray/alpha question (& color-blindness question)

Chris Lilley chris at w3.org
Thu Jul 20 12:47:04 CEST 2023


(I don't seem to have got the message from Alexei, just the reply to it)

On 2023-07-19 23:08, Hin-Tak Leung wrote:
> On Wednesday, 19 July 2023 at 15:27:20 BST, Podtelezhnikov 
> <apodtele at gmail.com> wrote:
>
>
> > Hin-Tak,
>> > This is probably both a spec question & a technical question. What 
>> is the recommendation for COLRv1 when the rendering target media is 
>> not capable of color?
>
> > Are you asking about RGB to gray conversion? There are multiple 
> specs with slightly different formulas and barely noticeable 
> differences, with and without gamma correction. I’m is all pretty 
> arbitrary without settled consensus.

Pardon my French but that is utter hogwash. "without settled consensus" 
indeed!

The palette colors are explicitly in the sRGB colorspace, and thus their 
conversion to luminance is precisely and unambiguously defined. First 
undo gamma encoding, then take the weighted sum. See

https://drafts.csswg.org/css-color-4/#predefined-sRGB

and

https://drafts.csswg.org/css-color-4/#color-conversion-code

>
> > Gray = 0.3R + 0.6G + 0.1B
>
> > is good enough.
Large errors, mostly from ignoring the effects of gamma encoding. You 
seem to be vaguely remembering the equation for the NTSC colorspace. 
Please do not spread this sort of easily disprovable, wildly incorrect 
misinformation.

For sRGB, once transformed to linear-light, the factors are actually

0.21263900587151027 R + 0.715168678767756 G + 0.07219231536073371 B

-- 
Chris Lilley
@svgeesus
Technical Director @ W3C
W3C Strategy Team, Core Web Design
W3C Architecture & Technology Team, Core Web & Media
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.aau.at/pipermail/mpeg-otspec/attachments/20230720/741a33a3/attachment.html>


More information about the mpeg-otspec mailing list