Path: utzoo!attcan!uunet!lll-winken!lll-lcc!ames!nrl-cmf!cmcl2!husc6!cca!mirror!rayssd!raybed2!applicon!bambi!peterson!peterson From: peterson@peterson.applicon.UUCP Newsgroups: comp.sys.mac.programmer Subject: Re: Utilities for RGB to 8-Bit Message-ID: <77900002@peterson> Date: 26 May 88 14:45:00 GMT References: <92@ai.etl.army.mil> Lines: 25 Nf-ID: #R:ai.etl.army.mil:-9200:peterson:77900002:000:1289 Nf-From: peterson.applicon.UUCP!peterson May 26 10:45:00 1988 The problem here is that you have a true 24 bit image and you want to display it as an 8 bit image. This has been an ongoing problem and there is no perfect solution. The previous two responses would work fine if you had only 256 pixels in your image, but that would be VERY small! One way to do this would be to do a scan through the image sampling it in 256 places (evenly). Then assign these colors to the Mac CLUT. Now display the image using the Mac's ability to find the closest color available for each pixel. This gives you a unique color map for each picture. Another way, as suggested, is dithering. The idea is to try to cover the entire 16 million colors with 256 by making a CLUT that has a very large range of colors. Doing this will make very large steps between shades and will make your picture look "banded." To reduce this banding, you have to alternate between the two nearest colors depending on how close the real color is to the available ones. There are many articles on dithering (also in "Fundamentals of Interactive Computer Graphics" by Foley & Van Dam). I hope this helps. I wish I could provide an algorithm, but that would take up too much space here! Joe Peterson Schlumberger Technologies Billerica, Ma UUCP: ...mit-eddie!applicon!peterson