Xref: utzoo comp.sys.mac:21009 comp.sys.mac.programmer:2587 comp.lang.postscript:1026 Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!purdue!decwrl!sun!imagen!daemon From: geof@apolling (Geof Cooper) Newsgroups: comp.sys.mac,comp.sys.mac.programmer,comp.lang.postscript Subject: Re: PostScript run-length encoding (again) Message-ID: <1933@imagen.UUCP> Date: 29 Sep 88 18:47:03 GMT Sender: daemon@imagen.UUCP Lines: 15 The "frame maker" postscript driver does something like this. What they do is to encode an image as a single byte of command followed by N bytes of argument. The "image" procedure reads the first byte and looks it up in a table of procedures, then executes the procedure, which must consume the "right" amount of input (maybe they have a length field in there too). The procedures do things like replicate a given 8-bit pattern, fill in with zeros, fill in with ones, etc.. The processing time for this is a few percent slower for the interpreter overhead, but most images spend all their time scaling the image, so it isn't too signficant. This kind of compression can help a LOT if an image has significant regions of constant gray (can you say "margins" boys and girls?). Have fun,