APPARATUS FOR THE COMPRESSION OF DITHERED IMAGE DATA

Abstract: A method and apparatus for data compression in a digital imaging process is disclosed. More specifically, a method is disclosed whereby a more efficient reduction of memory space is obtained when a dithered image is of the so called "grey scale" type. The binary bits representing the pixels of the di­ thered image are differentiated to obtain groups of ones or zeros, so that these groups may be represented by a code, thereby saving memory space. One embodiment uses the Ex­ clusive OR function in the differentiation process.

Description: This invention relates generally to an apparatus for digital imaging devices and more specifically to compression of binary data representing images or pictures. Prior art digital imaging systems like the PIC system of Wang Laboratories, Inc. are used to digitize pictures, charts, graphs and other images. In the imaging process the specimen is scanned for brightness and converted to a pattern of light and dark picture elements (pixels). The pixels are created by comparing the specimen with threshold values and determining the status of the pixel based on whether the brightness of the location in question exceeds the threshold value. (see also US-A-4,086,620) Dithering is an image processing technique which creates a two level picture that gives the illusion of a grey scale (multilevel) picture by appropriately controlling the spatial density of light and dark pixels. The dithering is employed by applying a dither algorithm which consists of a pattern of threshold values in the form of a matrix, varying from the darkest to the brightest to a continuous tone or multilevel picture. The brightness of each pixel is compared with the elements in the dithering matrix, and thresholded accordingly, thus reducing the test specimen to a series of light and dark pixels which are represented by binary numbers. Because of the large number of pixels required to make an acceptable image, a method of data compression is often used, called run-length encoding. Here, strings of identical binary bits are stored in memory as a code to reduce the number of bits in memory. However, it has been discovered that run-length encoding works poorly when the continuous tone, or grey scale specimen contains large areas having a high number of alternating light and dark regions all of varying brightness. In these originals, there are no long strings of identical bits which may be encoded to achieve a compression of the image data, i.e., a reduction of the number of bits necessary to represent the image or picture. Accordingly, a principal object of this invention is more efficient data compression in a digital imaging system, in order to reduce the required memory space. Also, a principal object of this invention is a feasible apparatus for data compression in a digital imaging system when the image is of the grey scale type (the brightness is in the middle range between that of a dark pixel and a light pixel). Another object of this invention is the conversion of grey scale digitized images into a form conducive to the effective use of run-length encoding. A further object is the compression of grey scale images, and decompression of said compressed image without any loss of the original image. Yet another object of this invention is an inexpensive and straightforward apparatus for accomplishing the above advantages by combining commercially available components into a novel system. The foregoing and other objects of the claimed invention are achieved by differentiating the digital binary data representing a dithered image, with one method using the exclusive OR logic gate to accomplish the differentiation. Differentiating the bytes representing grey scale images has the effect of producing long strings of identical bits. The data is then in a form for efficient use of run-length encoding, and is encoded accordingly. When the data is retrieved from memory it is decoded and thereafter integrated by again applying the exclusive OR gate or the like, thereby restoring the compressed data to its original state. The foregoing and other advantages and features of the present invention are apparent from the specification, the drawings and the two taken together. The drawings are: Fig. 1 is an isometric drawing of an example of a digital imaging system such as may be used in conjunction with the present invention. Fig. 2 is a schematic representation of the steps included in the present invention. Fig. 3 is a more detailed version of the step entitled "compression/decompression" in Fig. 2. Fig. 4 is a close-up of the pattern of pixels (cells) in a region of a dithered image. Fig. 5 is an example of a dithering matrix used in the dithering process. Fig. 6 is a sample of a small area of pixels representing a portion of the specimen to be digitized in Fig. 1, and shows regions with constant levels of brightness. Figs. 7a, 7b, and 7c are illustrations of example sections of dithered images, with three constant brightness level cases shown. Figs. 8a, 8b, and 8c, respectively, are illustrations of the binary representation of the dithered images in Figs. 7a, 7b, and 7c. Figs. 9a, 9b, and 9c, respectively, are illustrations of the differentiated versions of the first four lines of each case presented in Figs. 8a, 8b, and 8c. Digital imaging is a process whereby a visual object or scene is converted to binary bits which control the brightness or reflection density of pixels representing the image. In a typical digital imaging system such as shown in Fig. 1, a specimen 20 mounted on a pad 20a, is scanned by a scanner 12, used to detect brightness levels in the picture. The picture is represented by binary numbers by referencing each area representing a pixel to a brightness level (a threshold level). When the brightness of the scanned area exceeds the brightness of the threshold level, the corresponding pixel is turned to the "ON" setting. If the brightness is less than or equal to the threshold level, the corresponding pixel is turned to the "OFF" mode. By scanning the object and thresholding the brightness levels, a binary representation is obtained, which can be stored in memory, displayed on a screen with pixels, or graphically reproduced. Dithering is a process whereby the digital image is obtained by thresholding the pixel areas in accordance with a pattern, and superimposing the resulting pixels to create an illusion of a multi-level picture. By varying the spatial density of the pixels various levels of brightness are obtained. Digital images often require a large amount of memory space in order to adequately and accurately represent the object. Accordingly, the prior art discloses methods of replacing the digital image with a series of codes representing groups of pixels. One well known method of compressing the data is to use Huffman run-length encoding described in detail in chapter 5 of Digital Document Processing , by Hou, H.S., John Wiley & Sons, New York, 1983, which is hereby expressly incorporated by reference herein. Dithered images are characteristically full of high spatial frequency components (i.e., frequent alternation between light and dark pixels). As a result there are usually few areas containing pixel uniformity. Here, run-length encoding is of little value in compression of the data, and in extreme cases of high frequency images, run-length encoding may actually increase the data required to represent the image. It is desirous to convert the data representing a dithered image into a form more conducive to the application of run-length encoding in order to lower the amount of required memory space. The present invention accomplishes this pre-encoding state by the process of differentiating between each byte in a line of pixels with a reference byte. The invention disclosed is not restricted to any particular byte size, with a byte having as few as one bit or any other number of bits. The presently preferred embodiment is to use a byte size equal to the length or width of the dither pattern which is eight bits. A digital imaging system such as the PIC system available from Wang Laboratories, Inc., Lowell, MA 01851, is shown in Figure 1 supported on Table 16 and is labeled 10. Its major components are a monitor 11, scanner 12, printer 13, keyboard 14, and console 15. During use, the operation is controlled by the user by operation of the keyboard 14. The user gives instructions to the console 15, which contains a microprocessing unit having several means for controlling the system. The monitor 11 has a screen 18, which the user views while communicating with the system. A further description of system 10 is given in U.S. patent application serial no. 440,668, filed November 10, 1982, also assigned to the present assignee, which is hereby expressly incorporated herein by reference. Figure 2 shows a schematic representation of the processes comprising the invention. The following steps as illustrated in Figure 2 are used: the specimen is converted to a dithered (and digitized) image with the dithering means 30 and then stored in a memory means such as bit map 32; the bit map image is compressed with the compressor means 34 and then stored in its compressed state in storage means 36 such as a magnetic disk storage device. Whenever the user desires to print or display the image, it is retrieved from storage element 36, decompressed with decompressor 34, and then placed into a bit map memory 32. Figure 3 shows the components for a data compressor (and decompressor). Briefly, the dithered image in the bit map memory 32 is applied to and differentiated by differentiation means 34a (preferably an exclusive OR gate). The output of the differentiation means is applied to the encoding/decoding means 34b where it is stored in an intermediate buffer, if necessary, and is encoded per the Huffman encoding scheme, or some other scheme. The long strings of ones and zeroes are represented by binary words as a result of the encoding. After compression, the data is placed in memory or storage element 36. During retrieval of the dithered, compressed image, the stored data is retrieved from storage means 36 and then decoded by means 34b. It is then integrated by the differentiating/integrating means 34a to produce the original bit map representation of the image, and then fed back into the bit map memory 32. At this point, the image can be displayed, printed, edited or sent back to storage means 36. Referring back to Figure 1 to begin the imaging process, a specimen 20 is placed under the scanner 12. Scanner 12 is comprised of a camera 21 and a lamp 22. The lamp 22 places light onto the specimen 20 which is reflected back to camera 21. Camera 21 takes a succession of pictures of specimen 20, one line at a time. The number of lines and the number of pixels is generally related to the resolution of the image that can be displayed on the screen 18 and or printed on printer 13. Dithering is accomplished by comparing each pixel of the specimen photographed by the camera 12 with a number representing a unique value of intensity. The values range from a level equal to the intensity of a pixel in the "OFF" state to a pixel in the "ON" state. These values are considered threshold values because when the intensity of the corresponding area of the specimen is greater than the intensity of the compared value, the resulting pixel at that point is turned to the "ON" state. When the intensity of the corresponding area of the specimen is less than or equal to the intensity of the dithered value, the resulting pixel is turned to the "OFF" state. A dithering matrix such as shown in Figure 4 is used in the thresholding process. The matrix contains a pattern of threshold values to be used repeatedly until the thresholding process is complete. The values in the first or top horizontal row of the matrix are cyclically applied to the first row of pixels across the width of the image. The values in the second through eighth rows are likewise cyclically applied to the pixels of the next seven rows. The entire process is repeated for the ninth through the sixteenth line and so forth until the entire image is dithered. The specimen is now in the form of digital, binary value pixels, such as shown in Figure 5. The small squared 37 represent the pixel elements of an image and the larger cells 38 correspond to the region to which the 8 x 8 dither matrix of Figure 4 was applied. The image is digitized by the micro processor by assigning a binary number for each pixel. In the preferred embodiment a binary digit "1" signifies that the pixel is turned on, while "0" signifies that the pixel is off. The digitized image can be stored in a memory 36 of CPU or console 15. Once the imaging process is complete and, the image stored, the user may "edit" the image by giving the system a series of commands from keyboard 14. The image may be displayed on screen 18, or printed on printer 13. Figure 6 illustrates an example of a small area or region of a dithered image made of a specimen 20, having constant brightness where an 8 x 8 dithering matrix is used, which includes 64 levels of brightness. Constant 48 level is defined to mean a level of brightness representing 48/64 of the highest level of brightness, with 0 representing the darkest of dark and 63 representing the lightest of light. Obviously, the brightness levels of pixels coming from camera or scanner 12 may vary, for example, from 0 to 255, or some other image selected for a given system design. Constant 16 level is defined as a level of brightness which is 16/64 of the highest level of brightness. Constant level 32 is defined as 32/64 of the highest level of brightness or an area with intermediate brightness. Figures 7a, 7b and 7c, respectively, show examples of dithered images with constant levels 48, 16 and 32. Figures 8a, 8b and 8c show binary representatives of the examples in Figure 7. The "X" symbols indicate the "ON" state for the pixel at the spatial position at which it appears. As can be seen from Figures 8a and 8b, long strings of identical bits appear in the case of constant level 16 and constant level 48. The strings can be replaced by a code using Huffman's run-length encoding, for example, which greatly reduces the space requirement for the images. On the other hand, no strings of identical bits appear in the constant level 32 case; therefore, run-length encoding cannot be used effectively. It is observed that regions near the medium brightness levels (grey scale regions) are not conducive to run-length encoding and that the closer an area is to medium brightness the fewer strings of identical bits are produced. The present invention solves the problem by employing differentiation to place the dithered images in a form conducive to run-length encoding. The differentiation is done on a line by line basis with the first byte in each line left unchanged. Every byte in the line is compared with the reference byte (the byte left unchanged) and is replaced by the derivative of the byte with respect to the reference. The preferred embodiment employs at least one exclusive OR (XOR) logic gate or the equivalent logical operator to accomplish differentiation. The nature of the XOR gate is such that it gives an output only when the two inputs are different. Figures 9a, 9b and 9c, respectively, are differentiated for intermediate data corresponding to the data in Figures 8a, 8b and 8c. As can be seen by Figures 9a, 9b and 9c, long strings of identical bits are produced even for the difficult 32 level case. The data is now in an intermediate state suited for Huffman run-length encoding and subsequent storage in a minimum of storage space. Referring to Figures 2 and 3, during the retrieval process, the stored data (now in a compressed form) is decoded by means 34b and is integrated by differentiation means 34a. The integrated data is placed into the bit map memory 32 and is the same as its original form. Integration is accomplished by again using the XOR gate on a line by line basis, in the same manner as for differentiation. The effect is complete restoration of the pre-compressed data of Figures 8a, 8b, and 8c, as clearly shown by applying the XOR function in the prescribed fashion to the data in Figures 9a, 9b, and 9c.

Claims: An apparatus for data compression of binary bits representing the pixels (37) of a dithered image (Fig. 6) in a digital imaging process characterized by in every scan line of pixels, means for differentiating between corresponding bits of bytes from a specified reference byte located in the scan line to be used unchanged in each differentiation and every other byte in the scan line to generate intermediate image data representing said dithered image, the original state of said reference byte being included in said intermediate image data and means for encoding (34b) said intermediate image data. The apparatus for data compression in claim 1 characterized in that said differentiating means (34a) comprises at least one logic gate means. The apparatus for data compression in claim 2 characterized in that said logic gate is the Exclusive OR means. The apparatus for data compression in claim 1, 2 or 3 characterized in that said encoding means (34b) comprises means for encoding (34b) said intermediate image data using Huffman run-length encoding. The apparatus for data compression in claim 1, 2, 3 or 4 characterized in that the number of bits in each byte (38) equals the number of bits in each line of the dithering pattern (Fig. 4) used in dithering. The apparatus for data compression in claim 1 further characterized by means for storing (36) said encoded group lengths and means for retrieving said stored, encoded group lengths. The apparatus for data compression in claim 1 further characterized by means for storing (36) said encoded group lengths, means for retrieving said stored, encoded group lengths and means for decoding (34b) said retrieved, encoded group lengths. The apparatus for data compression in claim 1 further characterized by means for storing (36) said encoded group lengths, means for retrieving said stored, encoded group lengths, means for decoding (34b) said retrieved, encoded grouß lenghts and in every scan line of pixels means for differentiating (34a) between corresponding bits of bytes from said reference byte of the scan line and every other byte of the retrieved bits, while leaving the reference byte unchanged to obtain bits representing the original scan line. The apparatus for data compression in claim 8 characterized in that said differentiating means (34a) comprises at least one logic gate. The apparatus for data compression in claim 9 characterized in that said logic gate is the Exclusive OR.

Inventors: EL-SHERBINI, AHMED MOSTAFA
Applicants: WANG LABORATORIES INC.
Application year: 1985
Main classification: H04N1
IPC codes: G06T9, H04N1