Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.csd.uwm.edu!uxc.cso.uiuc.edu!uxc.cso.uiuc.edu!ux1.cso.uiuc.edu!phil From: phil@ux1.cso.uiuc.edu Newsgroups: comp.graphics Subject: Re: How to map 24-bit RGB to 256 co Message-ID: <5300026@ux1.cso.uiuc.edu> Date: 28 Aug 89 21:34:00 GMT References: <2009@uceng.UC.EDU> Lines: 29 Nf-ID: #R:uceng.UC.EDU:2009:ux1.cso.uiuc.edu:5300026:000:1285 Nf-From: ux1.cso.uiuc.edu!phil Aug 28 16:34:00 1989 > i.e. Calculate the 3-D histogram and use the 256 values with highest frequency. > Then map original image, pixel by pixel - using closest entry in 256 color > palette, into the displayable image. > > Problem 1: the histogram will be large (up to 262144 'bins') or more! > Problem 2: is Euclidian distance (at least in RGB color space) a good > measure of closeness of color ? I would think so. Also, two very close colors, with high frequency of occurence, could be represented by the SAME color out. You should examine the number of colors clustering around an area (in rgb color space) to see if it is tonal information that can be dithered instead, input quantization noise, or other legitimate occurences that need to be retained. I have no idea how to do this. > Problem 3: are the highest frequency colors in the histogram necessarily > the best to use? (Maybe there should be a minimum distance between > bins used - (dithering?) image dependent ...) When dealing with scanned input images, the number of bins actually used can be quite large, and most having only a small frequency. What out the bin bin "way out yonder" (in rgb color space) with a count of 1? What if there are a lot of the WOY bits? --Phil howard--