freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: COLRv1 to gray/alpha question (& color-blindness question)


From: Alexei Podtelezhnikov
Subject: Re: COLRv1 to gray/alpha question (& color-blindness question)
Date: Wed, 19 Jul 2023 20:41:28 -0400

> > 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.
>
> > Gray = 0.3R + 0.6G + 0.1B
>
> > is good enough.
>
> I am talking about 32-bit RGBA to 8-bit gray conversion, and I gave two 
> examples/directions - throwing away the RGB part (and use the alpha channel 
> as a mask on the current foreground colour), or throw away the A part, and 
> doing 24-bit colour to gray conversion like you suggested (or even just gray 
> = (r+g+b)/3).

Alpha is colorless until blended. Therefore any conversion of RGB to
alpha will produce random blending results because assuming black
foreground is wrong even on gray surfaces. Hence, the blending should
be done in color (on gray surface r=g=b), then the final result can be
converted to gray once again for display as above. This is essentially
what should happen in ftgrid/ftview if you choose 8-bit display,
e.g.,"-d 800x600x8".

A.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]