Path: utzoo!attcan!uunet!cs.utexas.edu!usc!apple!well!gors From: gors@well.UUCP (Gordon Stewart) Newsgroups: comp.graphics Subject: Re: How to map 24-bit RGB to best EGA/VGA palette? Keywords: RGB EGA VGA color Message-ID: <13319@well.UUCP> Date: 24 Aug 89 15:36:36 GMT References: <3129@cbnewsm.ATT.COM> <7743@cbmvax.UUCP> Reply-To: gors@well.UUCP (Gordon Stewart) Distribution: na Organization: Whole Earth 'Lectronic Link, Sausalito, CA Lines: 28 The classic paper on this subject is in SIGGRAPH notes (1982?) by Paul Heckbert, (paraphrased) "Color Image Quantization for Frame Buffer Display." Several improvements are possible: some of these are mentioned in the article, such as using different criteria for selecting a sub-range to partition. I myself have a color-selection algorithm which obviates truncating the pixels to 15 bits. It doesn't use a histogram, but a multi-way partition method, and if applied using Heckbert's criterion (longest box),it is equivalent to the Heckbert method using a 24-bit histogram. The process, as described in Heckbert, is two-fold (possibly three-fold)" 1) Select the best N colors; 2) Render the image via mapping function; opt. 3) While rendering, apply a dithering scheme to trade spatial for color resolution (effective if the target N colors are few - say, 16 or less - though this varies from image to image) -- {apple, pacbell, hplabs, ucbvax}!well!gors gors@well.sf.ca.us (Doolan) | (Meyer) | (Sierchio) | (Stewart)