Path: utzoo!attcan!uunet!cs.utexas.edu!sun-barr!newstop!sun!falk From: falk@sun.Eng.Sun.COM (Ed Falk) Newsgroups: comp.graphics Subject: Re: Color quantization: flesh tones Message-ID: <125134@sun.Eng.Sun.COM> Date: 22 Sep 89 06:52:04 GMT References: <6087@pt.cs.cmu.edu> <390037@hpfcdq.HP.COM> Organization: Sun Microsystems, Inc. - Mtn View, CA Lines: 61 In article <390037@hpfcdq.HP.COM>, jlg@hpfcdq.HP.COM (Jeff Gerckens) writes: > > > Has anyone experimented with psychological color preferences in > > > quantizing using Heckbert's median cut? Here's an example problem: > > > > > > In some images containing people's faces, where the face is > > > only a small part of the image, very few colors are assigned > > > to "flesh" color. The result is banding/loss of resolution in > > > an area of the image that is interesting to the viewer out of > > > proportion to its relative size. The problem is most severe > > > when quantizing to 32 or fewer colors. > > > > > > > Here's a thought; try converting RGB to the NTSC IYQ coordinates > > and quantize in IYQ space. I suggest this because NTSC chose > > the Y axis to be biased towards flesh tones and TV pictures transmit > > more power along that axis than along the Q axis (I is intensity). > > > > I'm sorry, but I don't have the transformation matrix from RGB to IYQ handy. > > > > -- > > -ed falk, sun microsystems, sun!falk, falk@sun.com > > Almost.... > > The Y axis in the NTSC encoding (IYQ) is the intensity, which was selected to > match the CIE-1931 XYZ intensity for the NTSC standard phosphors. Both the I > axis and the Q axis are named after the signal encoding technique used, being > In-phase and Quadrature, respectively. The I and Q axis carry the chromaticity > information, and are selected for encoding the most information on the I and > less on the Q. > > Use of this space will only affect your results if you weight the different > axis differently, since the linear transform to/from YIQ and RGB yields the > same results for any linear interpolation regardless of which space the > interpolation takes place in. All true. Mea Culpa. Here are the equations from the FCC regs: Y = .30R + .59G + .11B I = -.27(B-Y) + .74(R-Y) Q = .41(B-Y) + .48(R-Y) In matrix form, this is: |Y| | .300 .590 .110 | |R| |I| = | .599 -.277 -.322 | |G| |Q| | .213 -.525 .312 | |B| |R| | 1. .947 .624 | |Y| |G| = | 1. -.275 -.636 | |I| |B| | 1. -1.108 1.709 | |Q| The I axis was chosen to be the fleshtone axis, and about three times as much power is transmitted on this axis as on the Q axis. This way, a weak signal will not degrade flesh tones as much as other colors. -- -ed falk, sun microsystems, sun!falk, falk@sun.com "If you wrapped yourself in the flag like George Bush does, you'd be worried about flag-burning too"