Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!decwrl!nsc!voder!apple!darin From: darin@Apple.COM (Darin Adler) Newsgroups: comp.sys.mac.programmer Subject: Re: PackBits, what does it do? Message-ID: <9366@apple.Apple.Com> Date: 7 May 88 07:27:47 GMT References: <29435@aero.ARPA> <1026@redwood.UUCP> <9173@reed.UUCP> <885@viper.Lynx.MN.Org> Reply-To: darin@apple.UUCP (Darin Adler) Organization: Apple Lines: 23 In article <885@viper.Lynx.MN.Org> john@viper.Lynx.MN.Org (John Stanley) writes: > I'd appreceate information on what exactly the PackBits format is. This is described in Macintosh Technical Note #171: PackBits Data Format. The data consists of a byte count followed by a run of bytes. If the byte count is positive, it is followed by that many bytes + 1. If the byte count is negative, the following byte is repeated that many times + 1. For example: packed data: FE AA ; -2, repeat 3 times 02 80 00 2A ; 2, use next 3 bytes FD AA ; -3, repeat 4 times 03 80 00 2A 22 ; 3, use next 4 bytes F9 AA ; -7, repeat 8 times unpacked data: AA AA AA 80 00 2A AA AA AA AA 80 00 2A 22 AA AA AA AA AA AA AA AA -- Darin Adler AppleLink:Adler4 UUCP: {sun,voder,nsc,mtxinu,dual}!apple!darin CSNET: darin@Apple.com