Path: utzoo!utgpu!watmath!att!dptg!rutgers!cs.utexas.edu!uunet!seismo!esosun!cogen!celerity!celit!billd From: billd@fps.com (Bill Davidson) Newsgroups: comp.graphics Subject: Re: How to map 24-bit RGB to best EGA/VGA palette? Keywords: RGB EGA VGA color Message-ID: <593@celit.com> Date: 29 Aug 89 18:35:31 GMT References: <3129@cbnewsm.ATT.COM> <7743@cbmvax.UUCP> <13319@well.UUCP> <586@celit.com> <4862@eos.UUCP> <13381@well.UUCP> <126@vsserv.scri.fsu.edu> Sender: daemon@fps.com Reply-To: billd@fps.com (Bill Davidson) Distribution: na Organization: FPS Computing Inc., San Diego CA Lines: 58 In article <13381@well.UUCP> gors@well.UUCP (Michael Sierchio) writes: >Actually, doing R, G & B separately has a few problems -- that's "taxicab" >distance, rather than Euclidean distance, for one -- the other is that such >an error measure relies on a uniform color metric, and the RGB cube is not >uniform, in that equidistant colors in the color cube are not equidistant >to the "standard" observer's perceptual apparatus. and then: In article <126@vsserv.scri.fsu.edu> pepke@loligo.UUCP (Eric Pepke) writes: >One could try other color spaces, such as HSV for example. I have not done >this. However, I have done the brighness quantizations in perceptual space, >that is, brightness corrected for logarithmic eyeball response and the gamma >of the tube. I did not spend a lot of time on this, but the few pictures >that I tried indicated that the difference in quality was not worth writing >home about. Well guess what? Somebody has tried this. From my files: In article <8490@venera.isi.edu> raveling@venera.isi.edu (Paul Raveling) sez: [this is from May in response to someone suggesting HSV] Maybe, but it's not clear. About a year ago I tried some experiments using a different perceptual space suggested in a paper by Werner Frei, but got essentially the same end results as using RGB space. It's possible that limitations in the quantization algorithm could mask the benefits of using a different space; the best solution probably requires coordinated work to evolve both the color domain and algorithms using it. It's not clear that this is HSV but it was in response to someone who asked about it (I don't have the paper. Can you elaborate Paul?). This makes sense because most of the quantizations that you'll ever do involve colors which are going to be close in any color system. Colors which are close in RGB are also going to be close in HSV, HLS, YIQ, CMY, CIEXYZ, whatever. The relative distances will only change slightly and relatively rarely will they cross over. Remember that the boxes are going to be small almost all the time. Also, if you apply Floyd-Steinberg dithering the box choices only have to be "close" to their optimal value. In terms of matching a color to it's appropriate box, that's another matter but intuitively it doesn't seem to me that it's going to make that much of a difference. The RGB cube is not so skewed as to be irrelevant. Colors which are close in the cube will also be close perceptually. If you have 24-bit's then using some other model will probably improve your image significantly. If you have 20000 colors and only 8 bits to show them with then you're going to have a crude approximation no matter what you do. Quantization is going to eat the subtleties. Is Roy Hall on the net? If you're out there, what do you think of this subject? (I noticed that he barely touched the subject in his book and I was wondering why). An experiment I would *LOVE TO TRY* except I don't have any 24-bit frame buffers to play with is to compare the various quantization algorithms against the original 24-bit image. I'd also like to try and HSV scheme (and perhaps CIEXYZ) even though I don't especially have much faith in a change for better or worse (might make a good paper :-). --Bill Davidson