## Re: [stella] tia hue luminance

 Subject: Re: [stella] tia hue luminance From: Adam Wozniak Date: Mon, 29 Sep 2003 09:19:15 -0700 (PDT)
```On Sat, 27 Sep 2003, Eric Ball wrote:
> But if you are interested, here are the NTSC formulas.
>
> R8 = 255 * ( Y + 1.402 * Pr )
> G8 = 255 * ( Y - 0.344136 * Pb - 0.714136 * Pr )
> B8 = 255 * ( Y + 1.772 * Pb )
>
> where
> Y = ( COLU AND 15 ) / ( luminance )
> Pb = saturation * cos ( hue )
> Pr = saturation * sin ( hue )
> hue = 180 degrees - ( COLU / 16 - 1 ) * 24 degrees
> saturation = 0 if ( COLU / 16 == 0 ), otherwise some value between 0 & 0.5
> luminance = some value 14 or greater
>
> (base formula from http://www.poynton.com/PDFs/ColorFAQ.pdf)

If you pick a nonzero saturation, you can get r8 and b8 to become
negative in cases where ( COLU AND 15 ) is zero.  In cases where
saturation is large, r8 and b8 are negative for small values of
( COLU and 15 ).

I could not find values for luminance and saturation which did not
yeild any negative values.

Should negative values be chopped to zero, or is there some problem
with these equations?

--