Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!rutgers!rochester!pt.cs.cmu.edu!nl.cs.cmu.edu!mlm From: mlm@nl.cs.cmu.edu (Michael L. Mauldin) Newsgroups: comp.graphics Subject: Re: 24-bit RGB color to 8-bit color ? Summary: Heckbert & Floyd-Steinberg Message-ID: <4822@pt.cs.cmu.edu> Date: 26 Apr 89 03:36:33 GMT References: <538@rna.UUCP> <735@rocksanne.UUCP> Organization: Carnegie-Mellon University, CS/RI Lines: 32 In article <735@rocksanne.UUCP>, kirby@bozo.wbst128.xerox.com (Mike Kirby (co-op)) writes: > > Does anyone have a program to take an image with 24-bit color info > >and build an 8-bit color map that is "good" (find the 256 color map entries > >that produce the least error) ? > Something like a 24-8 floyd-steinberg error diffusion algorithm, > or some other method of dithering or error diffusion would probably > have much better results then a histogram derived colormap. The FBM package has an implementation of Heckbert's median cut algorithm to choose colors and Floyd-Steinberg to dither. The routine is called fbquant, and the package is available from: Host: nl.cs.cmu.edu (128.2.222.56) User: anonymous Password: name@site Directory: /usr/mlm/ftp/ Filename: fbm.tar.Z Transfer: 'image' Note: you must 'cd' to /usr/mlm/ftp directly, you cannot access either /usr, or /usr/mlm alone. Don't forget to specify 'image' format transfer. The only 24bit formats it can read are Sun rasterfiles and Amiga Digi-view "raw" files. It can output a variety of formats including Sun, GIF, and Amiga IFF. The software is in the queue for comp.sources.unix, so if you're not in a hurry it'll get to you on its own. Michael L. Mauldin (Fuzzy) School of Computer Science ARPA: Michael.Mauldin@NL.CS.CMU.EDU Carnegie Mellon University Phone: (412) 268-3065 Pittsburgh, PA 15213-3890 --