fsset@bach.lerc.nasa.gov (Scott E. Townsend) (06/22/91)
I've been experimenting with different color systems and I'm having some trouble translating to/from YIQ. I've looked in Foley & Van Dam (1st edition) and it wasn't quite enough help. Specifically, is there some relation or limit for the I and Q components? If I take an arbitrary set of Y, I, and Q I don't see a smooth mapping to RGB. It appears that there's some relation/constraint between I & Q (which would make sense if I & Q stand for in-phase & quadrature, but that's some radar background sneeking-in. I haven't seen a definition for what the I and Q stand for) From the definition in Foley & Van Dam things should be smooth, but displaying the results of yiq_to_rgb() at 8 bits per component doesn't look so smooth. (yiq_to_rgb is taken from SGI's libgutil.a. I've seen the source and it looks simple & reasonable) Any enlightenment from the net? -- ------------------------------------------------------------------------ Scott Townsend | Mail Stop: 5-11 NASA Lewis Research Center | Email: fsset@bach.lerc.nasa.gov Cleveland, Ohio 44135 |
bdb@becker.UUCP (Bruce D. Becker) (06/28/91)
In article <1991Jun21.203745.8532@eagle.lerc.nasa.gov> fsset@bach.lerc.nasa.gov (Scott E. Townsend) writes: |I've been experimenting with different color systems and I'm having some |trouble translating to/from YIQ. I've looked in Foley & Van Dam (1st edition) |and it wasn't quite enough help. | |Specifically, is there some relation or limit for the I and Q components? |If I take an arbitrary set of Y, I, and Q I don't see a smooth mapping |to RGB. It appears that there's some relation/constraint between I & Q |(which would make sense if I & Q stand for in-phase & quadrature, but that's | some radar background sneeking-in. I haven't seen a definition for what | the I and Q stand for) | |From the definition in Foley & Van Dam things should be smooth, but displaying |the results of yiq_to_rgb() at 8 bits per component doesn't look so smooth. |(yiq_to_rgb is taken from SGI's libgutil.a. I've seen the source and it |looks simple & reasonable) Perhaps it's determined by where the YIQ data came from. If it was captured from some NTSC signal then it may have less than 8 bits per component quantization as a result of the digitization process. |Any enlightenment from the net? +- -+ -1 +- -+ | 0.30 0.59 0.11 | | Y | [ R G B ] = | 0.60 -0.28 -0.32 | . | I | | 0.21 -0.52 0.31 | | Q | +- -+ +- -+ The inverted coefficient matrix is a particulatization of the CIE XYZ primaries, selected in such a way that an ideal set of NTSC display phosphors and reference white color is represented, and such that the Y scale has no color information, only luminance (note that the coefficients in Y sum to one, while those of I & Q sum to zero). The net effect of YIQ is as if the RGB cube were stood on end at the black point with the white point vertical, and with the scales of the RGB axes modified to create a non-cubic parallelopiped; the black-white axis is the Y vector. I & Q define a plane such that the length of a vector perpendicular to the Y axis at any given luminance determines color saturation, and its orientation determines hue. CIE XYZ calculations are discussed in Appendix III of Conrac's "Raster Graphics Handbook", Van Nostrand; the details of NTSC YIQ derivations are discussed in Section 20 of "Electronic Engineer's Handbook", McGraw-Hill, as well as other references. -- ,u, Bruce Becker Toronto, Ontario a /i/ Internet: bdb@becker.UUCP, bruce@gpu.utcs.toronto.edu `\o\-e UUCP: ...!utai!mnetor!becker!bdb _< /_ "Elvis sighted wearing Stevie Ray Vaughan mask" - Notional Enchorier