The most popular algorithm by far for color quantization, invented by Paul Heckbert in 1979, is the *median cut* wikipedia algorithm.
Many variations on this scheme are in use. Before this time, most color quantization was done using the population algorithm or population method, which essentially constructs a histogram of equal-sized ranges and assigns colors to the ranges containing the most points. A more modern popular method is clustering using octrees, first conceived by Gervautz and Purgathofer and improved by Xerox PARC researcher Dan Bloomberg. wikipedia