[comp.lang.postscript] RLE sampled-image compression

wiml@milton.u.washington.edu (William Lewis) (09/11/90)

   It seems that one of the periodic, recurring discussions in this
newsgroup is the "Gee, I wish I could compress my bitmaps so they
didn't take so long to transmit, but then it takes too long to 
decompress them" discussion. Last time this came around I had an idea;
I still haven't gotten around to actually *trying* it yet, so I thought
I'd post it to the net and see if anyone else has thought similarly.
The idea is basically to use RLE compression and use the builtin 
RLE decompressor in the dashed-line functions. Obviously, for images
with a lot of short runs, this wouldn't work: only for images with average
runs of 16 pixels or more, I think. Still, for many images, this is
quite acceptable. A standard decompression might go like this:

[
 [ 0 1 12 36 14 12 7 9 3 16 ]
 [ 32 1 0 1 2 32 4 53 2 11 18 ]
 [ 1 2 3 1 2 3 1 12 12 18 16 1 12 19 1 0 43]
 ...
]
{ 0 setdash 0 0 moveto 30 30 lineto stroke } bind
forall

   ...assuming I've not left out anything obvious. This would be
equivalent to the "imagemask" operator; things would have
to be whitefilled first and multiple colors/grays done separated and
done in several passes... Has this been done before? Does it look like 
it would be practically useful (given a reasonably intelligent 
bitmap-to-"rle-eps" convertor)? Comments? Implementations? =8)

-- 
wiml@milton.acs.washington.edu       Seattle, Washington  | No sig under
(William Lewis)   |  47 41' 15" N   122 42' 58" W  |||||||| construction

janm@echo.prl.philips.nl (Jan Mulders) (09/20/90)

In article <7320@milton.u.washington.edu>, William Lewis writes:

>   It seems that one of the periodic, recurring discussions in this
>newsgroup is the "Gee, I wish I could compress my bitmaps so they
>didn't take so long to transmit, but then it takes too long to 
>decompress them" discussion. Last time this came around I had an idea;
>I still haven't gotten around to actually *trying* it yet, so I thought
>I'd post it to the net and see if anyone else has thought similarly.
>The idea is basically to use RLE compression and use the builtin 
>RLE decompressor in the dashed-line functions. . . .

It is a nice idea, but the Laserwriter limits the length of the setdash
input array to 11. That's far too little for useful images.

				Jan Mulders
Jan Mulders
		E-mail: janm@nlgvax.prl.philips.nl
Philips Research Geldrop, Willem Alexanderlaan 7B, 5664 AN Geldrop,
The Netherlands.