Path: utzoo!attcan!uunet!husc6!endor!olson From: olson@endor.harvard.edu (Eric K. Olson) Newsgroups: comp.sys.mac.programmer Subject: Re: Utilities for RGB to 8-Bit Message-ID: <4662@husc6.harvard.edu> Date: 25 May 88 16:21:33 GMT References: <92@ai.etl.army.mil> <6604@cit-vax.Caltech.Edu> <2863@polya.STANFORD.EDU> <4647@husc6.harvard.edu> Sender: news@husc6.harvard.edu Reply-To: olson@endor.UUCP (Eric K. Olson) Organization: Lexington Software Design, Lexington, MA Lines: 46 In a recent article I write: >In a recent article Marc T. Kaufman writes: >>In article <6604@cit-vax.Caltech.Edu> wetter@tybalt.caltech.edu.UUCP (Pierce T. Wetter) writes: >> >>-> I have a 24-bit color image on VAX with UNIX: >>-> I want to display this on Mac II, 8-bit video. >> >>> Sure, get one pixel at a time from your unix file, then SetRGBColor to >>> red*256, green*256, blue*256, then SetPixel(x,y). This saves programmer time >>> at the expense of user time. >> >>You might prefer SetCPixel, which does both operations at once. > >Both these techniques use the current ITable (Inverse Color Mapping Table), >which is only 4 bits each of Red, Green, and Blue. To get slightly better >results, you can use MakeITable() to get 5 bits each (for a total of 15 bits >of inverse mapping). But you still don't get the best colors, and you don't >get a color table chosen to match the data. Sorry, folks, I jumped the gun on this one. To quote my brand new copy of Inside Mac V (release version), page 138, "For Example, even if the color table were loaded with 256 levels of gray, a 4-bit inverse table can only discriminate among 16 of the levels. To solve this problem without having to use special-case sets of colors with hidden colors, inverse tables carry additional information about how to find colors that differ only in the less significant bits. As a result, when the Color2Index routine is called, it can find the best match to the full 48-bit resolution available in a colorSpec. Since examining the extra information takes time, certain parts of Color Quickdraw, notably drawing in the arithmetic tranfer modes, don't use this information, and hence won't find the hidden colors." I don't know what this extra information is or how it works. Note that if you use my technique of CopyBitsing in the three planes with the (Arithmetic) tranfer mode AddPin, the problem with the inverse table resolution being too low still holds. Sorry if I led anyone astray. -Eric Lexington Software Design: Tomorrow's Software Yesterday Eric K. Olson olson@endor.harvard.edu harvard!endor!olson D0760 (Name) (ArpaNet) (UseNet) (AppleLink)