Subject: Re: grayscale
From: Pierre Abbat (phma@oltronics.net)
Date: Sat Apr 21 2001 - 17:53:59 CDT
On Sat, 21 Apr 2001, Patrick Lam wrote:
>Note that we use the formula (red+green+blue)/256 for grayscaling (at
>least in PS output), but that's not the correct ratio that corresponds to
>human colour perception.  What is the correct ratio?  A quick google
>search didn't turn up the result.
Here are the conversion matrices between RGB and YCbCr as used in JPEG:
( RGB goes from 0 to 255 each. YCbCr go normally from -127 to 128.
  Conversion matrices :
   0.299            0.587           0.114
  -0.168735891648  -0.331264108352  0.5               RGB to YCbCr
   0.5             -0.418687589158 -0.0813124108417
   1                0               1.402
   1               -0.344136286201 -0.714136286201    YCbCr to RGB
   1                1.772           0
    299/1000        587/1000        114/1000
   -299/1772       -587/1772          1/2
      1/2          -587/1402       -114/1402
      1/1             0/1          1402/1000
      1/1        -25251/73375   -209599/293500
      1/1          1772/1000          0/1
  The largest value of Cb for Y and Cr 0 is 0x48; of Cr for Y and Cb 0 is 0x5b. )
phma
This archive was generated by hypermail 2b25 : Sat Apr 21 2001 - 17:49:06 CDT