home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / graphics / 8134 < prev    next >
Encoding:
Internet Message Format  |  1992-07-25  |  2.5 KB

  1. Path: sparky!uunet!mcsun!uknet!mucs!lilleyc
  2. From: lilleyc@cs.man.ac.uk (Chris Lilley)
  3. Newsgroups: comp.graphics
  4. Subject: Re: Convert YUV data to RGB
  5. Message-ID: <5452@m1.cs.man.ac.uk>
  6. Date: 24 Jul 92 18:25:09 GMT
  7. References: <1992Jul22.032423.13011@cs.cornell.edu>
  8. Sender: news@cs.man.ac.uk
  9. Reply-To: lilleyc@cs.man.ac.uk (Chris Lilley)
  10. Organization: Department of Computer Science, University of Manchester UK
  11. Lines: 54
  12.  
  13. In article <1992Jul22.032423.13011@cs.cornell.edu>
  14. soam@freyja.cs.cornell.edu (Soam Acharya) writes: 
  15.  
  16. >I am looking for pointers in converting digital YUV data to standard RGB
  17. >format.  Now, I believe there are multiple ways by which YUV data may be
  18. >represented.  For example, the pbmplus toolkit has a program that converts
  19. >Abekas YUV bytes into a portable pixmap but I am not sure whether this is 
  20. >the same YUV format used by the Sun VideoPix board which uses the SAA9051
  21. >Digital Decoder chip to convert composite video into 4:1:1 YUV data.  By
  22. >4:1:1 format I mean for example 8-bit data where there are 8 bits of Y for
  23. >every 2 bits of U and V.  
  24.  
  25. >So, my question is: does there exist a standard way of converting the YUV
  26. >data ( once I have extracted the Y, U and V components ) to RGB regardless
  27. >of the format in which the YUV information was actually represented?
  28.  
  29. As far as I know, YUV is standard. It is the basis of European PAL television
  30. broadcast composite video signals. It is also used by US broadcast
  31. composite signals, after converting UV to IQ.
  32.  
  33. While the decoding is the same, the meaning of the resulting RGB is
  34. different. If the information came from the US, it should be colour
  35. corrected for an NTSC monitor. If it is European, it will be set for EBU
  36. monitors. Some US material is set for the SMPTE monitors - there is no way
  37. of telling, though ;-)
  38.  
  39. in matrix form:
  40.  
  41.     R        1.0    0.0    1.1402    Y
  42.     G    =    1.0    -0.3959    -0.5810    U
  43.     B        1.0    2.0294    0.0    V
  44.  
  45. You invert the matrix to go the other way.
  46.  
  47. Those monitors are (in CIE 1931 x,y chromaticity space)
  48.  
  49. %%    xR    yR    xG    yG    xB    yB    xW    yW    YW
  50. gamma
  51. %%------------------------------------------------------------------------------------
  52. %%    BREMA standard EBU phosphors (European colour television monitor,
  53. D65)
  54.     0.64    0.33    0.29    0.60    0.15    0.06    0.3127    0.3290
  55. 100.0    2.2
  56. %%    NTSC standard phosphors for US television monitors (illuminant C)
  57.     0.67    0.33    0.21    0.71    0.14    0.08    0.310    0.316
  58. 100.0    2.2
  59. %%    SMPTE (Society of Motion Picture and Television Engineers)
  60. recommended practice
  61.         0.630   0.340  0.310    0.595   0.155   0.070   0.3127    0.3290
  62. 100.0     2.2
  63.  
  64. sorry about the line width, there ;-)
  65.  
  66. Chris
  67.