Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!fluke!ssc-vax!coy From: coy@ssc-vax.UUCP (Stephen B Coy) Newsgroups: comp.sys.amiga.tech Subject: Re: Color compression routines (4096 to 256) wanted. Keywords: HAM, 256 color, Amiga, Sun Message-ID: <2625@ssc-vax.UUCP> Date: 27 Apr 89 20:06:13 GMT References: <33747@kilowatt.uucp> <11430@well.UUCP> Organization: Boeing Aerospace Corp., Seattle WA Lines: 31 In article <11430@well.UUCP>, ewhac@well.UUCP (Leo 'Bols Ewhac' Schwab) writes: > In article <33747@kilowatt.uucp> raz@kilowatt.uucp (Raz- Berry) writes: > > I need a basic flowchart > > on taking a 4096 color palette and converting it down to > > 256. Initially I was thinking that: > > > > [algorithm deleted for brevity] > > Suppose I have a simple HAM picture. The left half of the screen is > various hues of purple, and the right half of the screen is various hues of > blue. Separating these two fields is a vertical line, one pixel wide, that > is solid white. > > Now, if you were to do a histogram on this image, you'd probably > find the most popular 256 entries were hues of purple and blue, and white > would be right at the bottom of the list. However, that white line is a > prominent feature, because of its contrast with the rest of the image. So But rememeber, he's starting with a 4096 color palette which means only 16 hues of pure blue. Even allowing for going slightly off color you'll probably end up with less than 50 shades each of blue and purple. This still leaves over 100 palette entries for various shades of white. When DBW_render first appeared I coded up the algrothm as proposed for displaying the images on an Apollo with a 256/16M palette. The images looked fine. For mapping the non-popular colors onto the 256 color palette I used a simple distance function in RGB space. Obviously not the best but good enough. Stephen Coy uw-beaver!ssc-vax!coy