Path: utzoo!censor!geac!jtsv16!uunet!cs.utexas.edu!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!apple!Apple.COM!lsr From: lsr@Apple.COM (Larry Rosenstein) Newsgroups: comp.sys.mac.programmer Subject: Re: PICT2 Message-ID: <4308@internal.Apple.COM> Date: 22 Sep 89 18:15:51 GMT References: <3084@ur-cc.UUCP> Distribution: usa Organization: Objects-R-Us, Apple Computer, Inc. Lines: 37 In article <3084@ur-cc.UUCP> tonyg@merlin.cvs.rochester.edu (Tony Giaccone) writes: > So if that's the case why doesn't the copybits install a copy of the > current color table into the PICT2. Or, if it does how come PICTViewer > doesn't use that Color Table when it displays the file? It certainly seems > to use the color tables in other PICT2 files. I don't get it. If you were to dump the picture, I think you would find that your custom color table was present. A pixmap always has an associated color table. What happens is that the CopyBits from your picture to the screen follows the normal Color QuickDraw rules. That is, Color QuickDraw maps the desired colors to the closest ones that the display can show. Color QuickDraw never modifies the current color table in the process of drawing. If you were using a 24-bit display, then you would get the desired colors, because all colors are achievable. This is a known weakness in the PICT format. What programs needs to do is get the "appropriate" color table for the picture, set up that palette, and then draw the picture. The problem is that there is no standard for getting the "appropriate" color table. Some programs store the CLUT as a separate resource, and read that resource to construct the palette. (You could use the resource type understood by the Palette Manager.) Another approach is to scan through the picture and build up a CLUT based on the colors actually used. For a bitmap image this is OK, since the CLUT is stored in the pixmap. For an arbitrary picture it is not as easy to do. Larry Rosenstein, Apple Computer, Inc. Object Specialist Internet: lsr@Apple.com UUCP: {nsc, sun}!apple!lsr AppleLink: Rosenstein1