Path: utzoo!attcan!uunet!husc6!bloom-beacon!bu-cs!purdue!decwrl!ucbvax!pasteur!ames!amdahl!apple!lsr From: lsr@Apple.COM (Larry Rosenstein) Newsgroups: comp.sys.mac.programmer Subject: Re: Utilities for RGB to 8-Bit Message-ID: <10627@apple.Apple.Com> Date: 20 May 88 20:34:51 GMT References: <92@ai.etl.army.mil> <6604@cit-vax.Caltech.Edu> Reply-To: lsr@apple.UUCP (Larry Rosenstein) Organization: Advanced Technology Group, Apple Computer Lines: 20 In article <6604@cit-vax.Caltech.Edu> wetter@tybalt.caltech.edu.UUCP (Pierce T. Wetter) writes: > > You might also want to do dithering, best simple dither is 50% of one > color + 50% of another color, but I don't know any dithering algorithms off >the top of my head. You might be able to achieve this effect by using the MakeRGBPat call which will construct a dithered color pattern. Then you can fill a 1 pixel rectangle with that pattern. This will be slower than calling SetCPixel, but might yield better results in some cases. Some things to note. I don't think MakeRGBPattern recognizes when the RGB color you input is actually in the color table. I think this is because the pattern you get back is not specific to any color table, but is computed when used. So you will want to call RealColor to see if the desired color is in the color table, and only make a pattern if it isn't. Also, you can save some time by reusing the pattern if the next pixel RGB is the same as the previous one. (You could even fill a larger rectangle of pixels with 1 call.)