vishniac@wanginst.UUCP (Ephraim Vishniac) (04/08/85)
My thanks to the several people who responded to my query about the use of PackBits to create MacPaint-format documents. While I still haven't mastered PackBits, I did find an easy way of creating documents in an acceptable format. The trick is that the data doesn't have to be compressed, even if it is compressible. So, just stick a 71 (decimal, that's 0x47 for you C fans) in front of each pixel-line of 72 bytes. You'll wind up with a file about 53K long. To compress it, just open it with MacPaint and then save it - MacPaint will do the compression. Using this method lets us do the conversion on another machine without re-implementing packbits. Summary of stupid MacPaint format: 512 byte header (all zero) 720 lines, each 73 bytes: 0x47 followed by 72 bytes of image data total: 53,072 bytes. -- Ephraim Vishniac [apollo, bbncca, cadmus, decvax, harvard, linus, masscomp]!wanginst!vishniac vishniac%Wang-Inst@Csnet-Relay