Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site utah-cs.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!ihnp4!pesnta!hplabs!utah-cs!jwp From: jwp@utah-cs.UUCP (John W Peterson) Newsgroups: net.micro.mac Subject: Re: MacPaint Format? Message-ID: <3250@utah-cs.UUCP> Date: Tue, 19-Mar-85 18:41:18 EST Article-I.D.: utah-cs.3250 Posted: Tue Mar 19 18:41:18 1985 Date-Received: Thu, 21-Mar-85 03:13:40 EST References: <638@tty3b.UUCP> Organization: Univ of Utah CS Dept Lines: 27 Here it is. (This came out on INFO-MAC several months ago). ----------- For those interested, here is a description of the format of MACpaint files. This format is the common interchange format for full-page bitmap images on the MACintosh. The first 512 bytes of the file are the header. The first four bytes comprise the version number, followed by 38*8 = 304 bytes of patterns. The remaining 204 bytes of the header are reserved for future expansion. If the version number is zero, the patterns are ignored. Hence, programs that wish to create files to be read into MACpaint can just write out 512 bytes of zero as the header. Following the header are 720 compressed scanlines of data which form the 576 wide by 720 tall bitmap. The bitmap is compressed as follows ; Any run of three or more equal bytes is compressed into a count byte and a single data byte. Runs of unequal bytes are passed on literally, preceded also by a count byte. I.E. count = -1..-127 --> replicate byte 2..128 times count = 0.. 127 --> copy 1..128 bytes uncompressed count = -128 ignored for backward compatibility That's it. A nice simple scheme. Thanks to Bill Atkinson for providing this info.