[comp.sys.amiga] Converting 32-->16 and anything --> 4 colors

KENNEDAM%WWPS@dupont.com (Tony Kennedy) (03/18/89)

Hi all,
	I'm writing a program that converts iff to DEC Sixel files. What
I need is an algorithm that will convert 32 --> 16 colors and anything to 4
colors. Here's a rough outline of what I'm thinking...

32->16

find pairs of colors closest to each other. 
Count number of pixels for each color in the pair.
assign the color of the one with the greater number to the one with lesser.

For fewer colors find pairs or trios or quartets :-}

Think this'll work?

Any suggestions???

 __________________________________________________________________________
/                                                                         /|
>------------------------------------------------------------------------< |
|                      | Disclaimer:           |                         | |
|    Tony Kennedy      | What I say and what   |      ///                | |
|  Project Engineer    | my employer say are   |     /// AMIGA           | |
|   Setpoint, Inc.     | two different things. | \\\/// The computer     | |
|                      | So don't get them     |  \XX/ For the best      | |
|                      | confused.             |      of us.             | |
>------------------------------------------------------------------------< |
| INTERNET : kennedam%wwps%dupont.com@relay.cs.net                       | |
>------------------------------------------------------------------------< |
| A computer can make as many mistakes in 20 seconds as 20 men working   | |
| for 20 years.                                                          | |
>------------------------------------------------------------------------</