Browse Prior Art Database

Simple Image Compression Technique

IP.com Disclosure Number: IPCOM000119226D
Original Publication Date: 1991-Jan-01
Included in the Prior Art Database: 2005-Apr-01
Document File: 3 page(s) / 119K

Publishing Venue

IBM

Related People

Damon, BW: AUTHOR [+2]

Abstract

Disclosed is a method that speeds the printing of image data on low end printers balancing the required processing time with the slow transmission time. The following approach yields limited compression but at a small processing penalty that allows both the PC sending the data and the printer receiving it to minimize processing time.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 50% of the total text.

Simple Image Compression Technique

      Disclosed is a method that speeds the printing of image
data on low end printers balancing the required processing time with
the slow transmission time.  The following approach yields limited
compression but at a small processing penalty that allows both the PC
sending the data and the printer receiving it to minimize processing
time.

      The limited compression of images described takes advantage of
the image or APA datastream control form for IBM Personal Printers.
The image controls for the QUIETWRITER* printer encoded images in a
series of 8 pel vertical swathes.

      The image in the figure is typical of PC image applications.

      If a single 8-bit value (chosen because it seldom appears in
real images) is used to indicate that the next byte represents a
replication value for the following byte, the image may be expressed
in a smaller number of bytes. Assume the following rules to
"compress" the above image.
 1.   Store the previous command length in file to ease checking.
 2.   Use x'04' to indicate that a replication count follows:
x'0404AA' would then be replaced by x'AAAAAAAAAA'.
 3.   If the data byte x'04' occurs in the data stream three or less
consecutive times, it is replaced by x'04ct' where 'ct' is one less
than the number of times the x'04' is repeated.
 4.   Only replace other strings if they occur 4 times in succession.
 5.   If a byte is replicated more than 256 times in succession
replace with x'04FFxx', where x'xx' is the byte being replicated.
Then, restart the compression.

      The "image" in the figure would normally be encoded as follows
(assuming 120x120 APA):
ESC 'L' 126 0
x'04847C0404040404040A11207F7F111111111111F1010101010101'
x'0101010101FF82818080809F9292928C8080808080808080808080'
x'8080FF'
x'0F0000000000000000000080C0C000000000000000000000000000'
x'0000000000F88808080808C8484848880808080808080808080808'
x'0808F8'

      The resulting data after compression requires only 65 bytes of
data instead of 133.
ESC 'L' 59 0 129 0
x'0400847C0405040A11207F7F040511F1040A01'
                     x'FF82818080809F9292928C040C80'
                     x'FF'
                     x'0F04090080C0C0041100'
                     x'F88808080808C84848488040C808'
                     x'F8'

      The code required to encode the image with this scheme is
fairly trivial (See Pseudo Listing 1).  The code required to decode
the image with this scheme is also trivial (See Pseudo Listing 2).
Even though the compression savings is not as large as may be
obtained with other compression schemes, such as MMR or RL4, the
encoding and decoding simplicity of this algorithm provides
significant savings in low-end PC printers and PCs.

      While it is possible that some images will actually require
more bytes to represent using this algorithm, most t...