Method for quantization gray level pixel data with application of under compensated error diffusion

Abstract: A method and arrangement for the application of under compensated error diffusion to a pixel quantizing method in the conversion of image data from a number of input levels that is relatively large with respect to a number of desired output levels.

Description: This invention relates to conversion of images from gray scale pixel values to a reduced number of levels of pixel values, using error diffusion techniques that reduce visible artifacts normally noted with error diffusion. Image information, be it color or black and white, is commonly derived by scanning, initially at least, in a gray level format containing a large number of levels, e.g.: 256 levels for black and white and more than 16 million (256 3 ) levels for color, which is usually unprintable by standard printers. In the following. the term "gray level" is used to described such data for both black and white and color applications. Standard printers print in a limited number of levels, either a spot or a no spot in the binary case, or a limited number of levels associated with the spot, for example, four in the quaternary case. Gray level image data may be represented in a very large number of values. Accordingly, it is necessary to reduce gray level image data to a limited number of levels, so that it is printable. Besides gray level image information derived by scanning, certain processing techniques such as those described for example in EP-A-0 481 812 published 22/04/92 produce gray level pixel values which require conversion to a limited set of legal, or correct output values. One standard method of converting gray level pixel image data to binary level pixel image data is through the use of dithering or halftoning processes. In such arrangements, over a given area, each gray level pixel within the area is compared to one of a set of preselected thresholds, comprising a matrix of threshold values or a halftone cell. The effect of such an arrangement is that, for an area where the image is gray, some of the thresholds within the matrix will be exceeded, while others are not. In the binary case, the portions of the matrix, or cell elements, in which the thresholds are exceeded are printed as black, while the remaining elements are allowed to remain white. The effect of the distribution of black and white over the cell is integrated by the human eye as gray. Dithering presents problems, however, in that the amount of gray within an original image is not maintained exactly over an area, because the finite number of elements inside each halftone cell only allows the reproduction of a finite number of gray levels. The error arising from the difference between the threshold value and the actual gray level value at any particular cell is simply thrown away. This results in loss of image information. Dithering creates significant image artifacts because it ignores this error completely. A well known example is the banding or false contour artifact that can be seen in smooth image areas. Here, the image input gray level varies smoothly over an area while the halftoned image has to make a transition from one halftone dot (gray level) to another. This transition can clearly be seen as a band running through smooth image parts. Algorithms that convert gray images to binary or other number of level images attempting to preserve gray density exist, and include among them error diffusion, as taught, for example, in "An Adaptive Algorithm for Spatial Greyscale" by Floyd and Steinberg, Proceedings of the SID 17/2, 75-77 (1976) (hereinafter, "Floyd and Steinberg"). Another, more elaborate method would be the error diffusion techniques of US-A-5,045,952. Additional modifications to the error diffusion algorithm taught by Floyd and Steinberg have been proposed, eg.: a different weighting matrix, as taught, for example, in "A Survey of Techniques for the Display of Continuous Tone Pictures on Bilevel Displays" by Jarvis et al., Computer Graphics and Image Processing, Vol. 5., pp.13-40 (1976), and in "MECCA - A Multiple-Error Correction Computation Algorithm for Bi-Level Image Hardcopy Reproduction" by Stucki, IBM Res. Rep. RZ1060 (1981). Modifications of the error calculation and weight allocation have been taught, for example, in US-A-4,924,322 to Kurosawa et. al., US-A-4,339,774 to Temple, and US-A4,955,065,to Ulichney. Error diffusion attempts to maintain gray by making the conversion from gray pixels to binary or other level pixels on a pixel-by-pixel basis. The procedure examines each pixel with respect to a threshold, and the difference between the gray level pixel value and the threshold is then forwarded to a selected group of neighboring pixels, in accordance with a weighting scheme. The thus corrected image pixels are then considered input to the processing. In this way, the error calculated includes all errors previously made. An alternative error diffusion procedure is taught in "Images from computers" by M. R. Schröder (sometimes spelled Schroeder) in IEEE Spectrum, pp 66-78 (1969) (hereinafter Schröder). In this method the error is only calculated between the original input pixel and the output, neglecting all previously made errors. This method leads to a poorer gray level representation than Floyd and Steinberg but to higher image contrast. Modifications to the algorithm by Schröder are taught, for example, in "Design of Optimal Filters for Error-Feedback Quantization of Monochrome Pictures" by Jung Guk Kim and Gil Kim, Information Sciences 39, pp 285-298 (1986). In representing small variations in image appearance with an error diffusion technique, rather large areas of the image are required for the variation to be represented. Thus, while error diffusion is effective in maintaining gray over the image, it requires a rather large area of the image for the error compensation to be effective. Over such areas, undesirable textures and long range patterns, inherent in the distribution of error, may occur. It is believed that as the number of output levels increases, the need for error correction is reduced. Thus, error correction is essential in quantizing to a binary level, while less necessary for several level systems. In "2-level rendition of continuous-tone pictures" by Liu Yong-Kui, published in DISPLAYS, vol. 12, no. 2, pages 84-85, April 1991, an algorithm for error-diffusion or error-distribution is disclosed wherein 50% of the total error is distributed to each of two neighboring pixels, the right and the lower pixels. US-A-5 014 333 discloses an image processor which converts a multiple gray-level image to a bi-tonal image using both error diffusion and ordered dithering. The processor makes smooth transitions between error diffusion and ordered dithering to eliminate artifacts which arise from sharply attenuating either process. The error diffusion process is smoothly attenuated as the local area intensity approaches a light or dark maximum, and utilises a weighted error term to pass on the effect of the error between an input density value and a selected threshold. The ordered dithering process is smoothly attenuated as the local area high spatial frequency content increases. It is an object of the invention to provide a method and apparatus for the application of under compensated error diffusion to a pixel quantizing step in the conversion of image data from a number of input gray levels that is relatively large with respect to a number of desired output levels. According to one aspect of the present invention, there is provided a method of quantizing pixel values in a black and white or color image, in which the image or each separation of a color image is formed by a plurality of pixels, each pixel representing an optical density of the image at a location within the image, and having an original optical density value associated therewith selected from one of a set of "c" original optical density values, where "c" is a number of members larger than a desired output set of "d" optical density values, the method comprising the steps of: a) comparing the input optical density value of each pixel with the possible optical density values of the output and selecting one of these output values to represent the pixel; b) determining an error term that is a difference between the new optical density value and the original optical density value; c) applying said error term on a weighted basis to each optical density value in a predetermined set of neighboring pixels, thereby creating modified optical density values of said pixels; and d) using said modified optical density values as input optical density values; characterised in that step c) includes the further step of determining a preselected fraction of the error term which fraction is not the total error to be used as the quantity for error correction, the preselected fraction of the error term being applied on a weighted basis to each optical density value in the predetermined set. According to a second aspect of the present invention, there is provided an apparatus for quantizing pixel values in a black and white or colour image, in which the image or each separation of a colour image is formed by a plurality of pixels, each pixel representing an optical density of the image at a discrete location within the image, and having an original optical density value associated therewith selected from one of a set of "c" original optical density values that has a number of members larger than a desired output set of "d" optical density values, the apparatus comprising: a source of image data including pixels each having an original optical density value that is one of "c" original optical density values; an adder for determining the sum of an error term derived from the quantization of at least one previous pixel and the original optical density value; a comparator for comparing the sum to at least one reference value, and producing an output value that is a member of the desired output set of d optical density values; an error term comparator for comparing the output value and the sum, and producing an error term that is the difference therebetween; a memory storing the error term to be applied to each original optical density value in a predetermined set of neighboring pixels; and means for directing the value of said error term on a weighted basis to the adder for addition to each optical density value in the predetermined set of neighboring pixels; characterised in that the apparatus further includes means for determining a preselected fraction of the error term which fraction is not the total error to be applied on a weighted basis to each of a predetermined set of neighboring pixels. Thus, gray pixel values, where the value of the pixel has one of a relatively large number of input levels, are directed through an error diffusion quantization process, for the conversion to one of a relatively small number of values. Each pixel of the gray level data is modified by a correspondingly weighted error correction term or terms from previously processed pixels, generating a modified pixel value. This modified pixel value is compared to a set of threshold values, where the comparison determines that the output will be one of a limited number of output levels. The difference value between the modified pixel value and the output pixel value is distributed in accordance with a weighted distribution scheme through a matrix comprising a set of neighboring unprocessed pixels, increasing or decreasing the gray values of such pixels, which are referred to as modified pixel values. However, only a predetermined portion of the difference error is distributed, so that the effect of the quantizing error is limited. Image appearance is improved by limiting the extent of texture variation and long range patterns commonly associated with error diffusion techniques. In accordance with another aspect of the invention, error may be transferred in the described manner either one dimensionally, to the next pixel in the scan line, or two dimensionally, to a preselected group of pixels including at least one other scan line. In accordance with yet another aspect of the invention, transfer of about half the quantization error from a single pixel has proven to have aesthetically desirable results for a 5 output levels system. However, the amount of error to be transferred for aesthetic improvement is related to the number of output levels, so that an increasing amount of error distribution is desirable for systems with very few levels of output, while less error distribution is desirable for systems with larger numbers of output levels. In accordance with still another aspect of the invention, there is provided a method of quantizing gray level pixels, each pixel I n,ℓ defined at one of 256 levels of optical density, where the term 'optical density' will be used hereinafter to describe the set of values comprising the image data, be it density, intensity, lightness or any other image data representation. Each pixel of the gray level data is modified by a correspondingly weighted error correction term or terms ε n,ℓ from previously processed pixels, generating a modified pixel value. This modified pixel value I n,ℓ + ε n,ℓ is quantized to one of five possible output levels using a predetermined distance measure. Usually this is done by comparing it to a set of four threshold values, where the comparison determines that the output value B n,ℓ representing the pixel in consideration will be selected from one of five output levels. The difference value ε m between the modified pixel value I n,ℓ + ε n,ℓ and the output pixel value B n,ℓ is distributed in accordance with a weighted distribution scheme through a matrix comprising a set of neighboring unprocessed pixels, increasing or decreasing the gray values of such pixels, which are referred to as modified pixel values. However, only a predetermined portion of the error ε m is distributed, so that the effect of the quantizing error is limited. In accordance with one further aspect of the invention, a first effective error distribution scheme distributes half the quantizing error ε m to adjacent pixel ( n + 1, ℓ). In a second effective error distribution scheme half the quantizing error is distributed to a set of pixels in the adjacent scanline, and for pixel I n,ℓ , error might be distributed in accordance with 0.125ε m to pixel (n + 1, ℓ + 1), 0.25ε m to pixel (n, ℓ + 1), and 0.125ε m to pixel (n-1, ℓ + 1). These and other aspects of the invention will become apparent from the following descriptions to illustrate a preferred embodiment of the invention read in conjunction with the accompanying drawings in which: Figure 1 represents a prior art matrix for error diffusion weighted distribution; Figure 2 is a block diagram of a basic system for carrying out one embodiment of the present invention; and Figures 3A and 3B represents examples of two error diffusion matrices appropriate for use together in the reduction of gray levels of image, in accordance with the invention. Referring now to the drawings where the showings are for the purpose of describing the preferred embodiment of the invention and not for limiting same, a basic system for carrying out the present invention is shown in Figure 2. In the present case gray level image data from image input 8 is characterized as image data, each pixel of which is defined at a single level in a set of levels, the number of members in the set of levels being larger than desired. Each pixel will be processed in the manner described hereinbelow, to redefine each pixel in terms of a new, smaller set of levels. Here, color data might be represented by a number of independent channels which are handled independently, or the color data might be represented as vectorial data in a predefined color space, e.g.: RGB, ClELab etc., being submitted to vector operations in the thresholding, error calculation and correction. One common case of this method includes the conversion of data from a relatively large set of values to a smaller set of values for printing or other display technique. An input image of the type to be processed as hereinafter described, may be represented by a series of gray values (gray level pixels) arranged in an array of L lines, each line containing N gray value pixels. As used herein, I n,ℓ refers to a particular pixel in an image at position n, ℓ, and the gray value or intensity level of that pixel. The gray values are typically expressed as integers with one example falling in the range from 0 to 255, although greater or lesser number of levels are possible. An output image is considered to consist of pixels, each pixel corresponding to an output dot or element that is printed by a digital printer. In one embodiment that will be herein considered, image data is derived at 256 levels, and is quantized using the inventive method to one of 5 levels. Then, pulse width modulation is used to convert the 5 levels of image data to a binary output, suitable for printing with an electrostatographic or xerographic laser printing device having binary output. In electrostatographic or xerographic printing devices, the single small dots usually produced using error diffusion are not well reproduced. Using the pulse width modulation method to convert the 5 levels of image data to a binary output allows pixels to be clustered together for better print output. Other methods of quantizing the 5 levels of image data to binary levels, which take into account the values of adjacent pixels, including general dithering, may be used to produce a set of e printer output values, where, in one preferred embodiment the number of members in the set is 2. Of course, the present invention has value independent of such an additional quantization step, particularly in display technologies, and in printing technologies such as ink jet printing, where the print dot can be well reproduced. With reference to Figure 2, the image input 8, which may be any source of gray level image data, introduces input image I into the system on a pixel-by-pixel basis. Each input pixel has a corresponding error value ε n,ℓ added to the input value I n,ℓ at adder 10, where ε n,ℓ is the sum of error values of previous pixels, resulting in a modified image, represented by modified pixel values, temporarily stored at block 12. The modified image, the sum of the input value and the error value of previous pixels (I n,ℓ +ε n,ℓ ), is passed to threshold comparator 14. The modified image data is compared to threshold value(s) T, to determine an appropriate output level B n,ℓ for pixel I n,ℓ and in the present embodiment, which of five levels B n,ℓ will represent the gray level value. The threshold value(s) applied may be constant through the image or may vary either randomly, or in accordance with a dither pattern, as taught in "On the Error Diffusion Technique for Electronic Halftoning" by Billotet-Hoffmann and Bryngdahl, Proceedings of the SID, Vol. 24/3, (1983), pp. 253-258, or in accordance with input information as taught in U.S. Patent Application 07/396,272 entitled "Edge Enhanced Error Diffusion Algorithm" by R. Eschbach or in accordance with any other predetermined variation. Once output level B n,ℓ is determined and directed to output image storage 16 for eventual transfer to an output along line 18, the value of B n,ℓ is subtracted from the modified image value (I n,ℓ +ε n,ℓ ) to generate the quantization error level ε m from quantizing pixel(I n,ℓ +ε n,ℓ ). The subtraction operation is represented by the change sign block 20 and subsequent adder 22, with ε m representing the difference between the modified image value (I n,ℓ +ε n,ℓ ) and the output value B n,ℓ for pixel I n,ℓ . Error term ε m is then distributed at error determination block 24 to a predetermined set of neighboring pixels in accordance with the scheme, that the given coefficients K 1 ...K n : 0 < K 1 ε' m +...+K n ε' m < ε m where K 1 . . .K n are coefficients corresponding to the set of pixels to which error will be distributed, for the case of ε m larger than zero. For ε m smaller than zero, the "<" symbol is changed to a " > " symbol. There are several possible implementations of this scheme, two of which will be described here. In the first, the error value ε m is multiplied by a constant α < 1 to generate ε' m , using ε' m = αε m and Σ i K i = 1, the second implementation maintains ε m but uses Σ i K i < 1. The distribution matrix buffer 26 represents the matrix of stored values which will be used as weighting coefficients to generate ε n,ℓ as any pixel n, ℓ that passes. In two example cases, in accordance with the invention, the matrices of Figures 3A and 3B show two error distribution arrangements. In Figure 3A, quantizing error is distributed one-dimensionally to the adjacent unprocessed pixel in the scan line in accordance with a weighting scheme in which only 0.5ε m is directed to the adjacent pixel. Considering that pixel I n,ℓ +ε n,ℓ deviates from one of the possible output levels by not more than 12.5%, the error that can be passed is (0<|ε m |<12.5%) x 0.5, consequently, the error received by pixel I n + 1,ℓ is not more than ± 6.25% of the total dynamic range of the image, since all the error that is received by this pixel originated at pixel (n, ℓ). The effect of this is to change the level of the next pixel only when that pixel has a value that is very close to a threshold level or decision boundary. In accordance with this effect, the distribution of quantizing error has a limited cascading effect, beyond the initial pixel to which it is directed. Note that the numbers given are for clarity only. The actual deviations depend on the number of levels and the quantization decision. In Figure 3B, quantizing error is passed to three neighbors, as in the arrangement of Figure 2. Therefore for pixel I n,ℓ , error might be distributed in accordance with 0.125ε m to pixel (n + 1,ℓ + 1) , .25ε m to pixel ( n, ℓ + 1 ), and 0.125ε m to pixel ( n-1 ,ℓ + 1). Considering that pixel I n,ℓ + ε n,ℓ deviates from one of the possible output levels by not more than 12.5 % the maximum error that can be passed to pixel I n + 1 , ℓ + 1 , is (0<ε m <12.5%) x 0.125. Any pixel, however, receives error input from three different pixels, i.e. ε n,ℓ the error to I n,ℓ is the sum of error from I n-1 , ℓ-1 ; I n , ℓ-1 ; and I n + 1 , ℓ-1 . It can be seen that the maximum error received by I n,ℓ is again limited by 0.5 x (± 12.5%.) The effect of this is to change the level of the next pixel only when that pixel has a value that is very close to a threshold level or decision boundary. In accordance with this effect, the distribution of quantizing error has a limited cascading effect, beyond the initial pixel set to which it is directed. It will no doubt be appreciated that there are an enormous number of possible error distribution matrices available in error diffusion processes. What is required by this invention is that a predetermined portion of the error, less than 100%, is passed to the error receiving set of neighboring pixels, for the reason of limiting the area over which an error compensation is attempted. It will also be appreciated that while the description has referred to five level quantization, the systems which provide multi-level output pixels other than five may use the invention as described with appropriate modifications to the total error feedback to account for the number of pixel levels that can be produced in the output. Additionally, the system can be used to convert color data from a large set of possible color values to a smaller set of color values. The invention has been described with reference to a particular embodiment. Modifications and alterations will occur to others upon reading and understanding this specification taken together with the drawings. The embodiments are but examples, and various alternatives, modifications, variations or improvements may be made by those skilled in the art from this teaching which are intended to be encompassed by the following claims.

Claims: A method of quantizing pixel values in a black and white or color image, in which the image or each separation of a color image is formed by a plurality of pixels, each pixel (I n,ℓ ) representing an optical density of the image at a location within the image, and having an original optical density value associated therewith selected from one of a set of "c" original optical density values, where "c" is a number of members larger than a desired output set of "d" optical density values, the method comprising the steps of: a) comparing the input optical density value of each pixel (I n,ℓ ) with the possible optical density values of the output and selecting one of these output values to represent the pixel; b) determining an error term (ε m ) that is a difference between the new optical density value and the original optical density value; c) applying said error term (ε m ) on a weighted basis to each optical density value in a predetermined set of neighboring pixels, thereby creating modified optical density values of said pixels; and d) using said modified optical density values as input optical density values; characterised in that step c) includes the further step of determining a preselected fraction of the error term (ε m ) which fraction is not the total error (ε m ) to be used as the quantity for error correction, the preselected fraction of the error term being applied on a weighted basis to each optical density value in the predetermined set. The method of claim 1, wherein the predetermined set of neighboring pixels of pixel I n,ℓ , where n is the position of the pixel in scan line ℓ, consists of the single pixel I n+1,ℓ . The method of claim 1, wherein the predetermined set of neighboring pixels of pixel I n,ℓ , where n is the position of the pixel in scan line ℓ, includes the set of pixels I n, ℓ+1 ; I n+1, ℓ+1 ; and I n-1, ℓ+1 . The method of claim 3, where the error term (ε m ) is applied in accordance with the weighting values: 0.25 of the error term to pixel I n,ℓ+1 , 0.125 of the error term to pixel I n+1, ℓ+1 , and 0.125 of the error term to pixel I n-1, ℓ+1 . The method of any one of claims 1 to 4, where the preselected fraction of the error term (ε m ) to be applied to the predetermined set of neighboring pixels is one half. An apparatus for quantizing pixel values in a black and white colour image, in which the image or each separation of a colour image is formed by a plurality of pixels, each pixel (I n,ℓ ) representing an optical density of the image at a discrete location within the image, and having an original optical density value associated therewith selected from one of a set of "c" original optical density values that has a number of members larger than a desired output set of "d" optical density values, the apparatus comprising: a source of image data (8) including pixels (I n,ℓ ) each having an original optical density value that is one of "c" original optical density values; an adder (10) for determining the sum of an error term (ε n,ℓ ) derived from the quantization of at least one previous pixel (I n,ℓ ) and the original optical density value (I n,ℓ + ε n,ℓ ); a comparator (14) for comparing the sum (I n,ℓ + ε n,ℓ ) to at least one reference value, and producing an output value (B n,ℓ ) that is a member of the desired output set of d optical density values; an error term comparator (18, 20, 22) for comparing the output value (B n,ℓ ) and the sum (I n,ℓ + ε n,ℓ ), and producing an error term (ε m ) that is the difference therebetween; a memory (26) storing the error term (ε m ) to be applied to each original optical density value in a predetermined set of neighboring pixels; and means for directing the value of said error term (ε m ) on a weighted basis to the adder (10) for addition to each optical density value in the predetermined set of neighboring pixels; characterised in that the apparatus further includes means for determining a preselected fraction of the error term (ε m ) which fraction is not the total error (ε m ) to be applied on a weighted basis to each of a predetermined set of neighboring pixels. The apparatus of claim 6, wherein the predetermined set of neighboring pixels of pixel I n,ℓ, where n is the position of the pixel in scan line ℓ, cludes the single pixel I n+1, ℓ. The apparatus of claim 6, wherein the predetermined set of neighboring pixels of pixel I n,ℓ , where n is the position of the pixel in scan line ℓ, includes the set of pixels I n, ℓ+1 , I n+1, ℓ+1 , and I n-1, ℓ+1 . The apparatus of claim 8, where the error term (ε m ) is directed on a proportional basis to the adder (10) for addition to the each optical density value in the predetermined set of neighboring pixels in accordance with the values: 0.25 of the error term to pixel I n, ℓ+1 , 0.125 of the error term to pixel I n+1, ℓ+1 , and 0.125 of the error term to pixel I n-1, ℓ+1 . The apparatus of any one of claims 6 to 9, where the predetermined fraction of the error term (ε m ) to be applied to the predetermined set of neighboring pixels is one half.

Inventors: BIRNBAUM DAVID, ESCHBACH REINER, KNOX KEITH T, BIRNBAUM, DAVID, ESCHBACH, REINER, KNOX, KEITH T.
Applicants: XEROX CORP, XEROX CORPORATION
Application year: 1992
Main classification: H04N1
IPC codes: H04N1, G06T5