Method for quantization of gray level pixel data with extended distribution set

Abstract: A method and arrangement for quantization of the nth pixel in scan line ℓ (i.e., pixel n,ℓ), with error diffusion to a matrix including pixels at pixel locations corresponding to pixels {(n + 1, ℓ), (n-2, ℓ + 1), (n-1, ℓ + 1), (n,ℓ + 1)}. Distribution weighting may be in accordance with the scheme {(n + 1, ℓ) =0.5, (n-2, ℓ + 1) = 0.125 (n-1, ℓ + 1) = 0.125 (n,ℓ + 1) = 0.25}. In another embodiment, distribution weighting may be in accordance with the scheme {(n + 1, ℓ) = 0.5, (n-3, ℓ + 1) = 0.0625, (n-2, ℓ + 1) = 0.0625, (n-1, ℓ + 1) = 0.125, (n, ℓ + 1) = 0.25, }.

Description: This invention relates to conversion of images from gray scale pixel values to a reduced number of levels pixel values, using error diffusion techniques that reduce visible artifacts normally noted with error diffusion. 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"). The Floyd and Steinberg method proposes distribution of error determined in the quantization of the nth pixel in scan line ℓ (i.e., pixel n,ℓ), the matrix including pixels at pixel locations corresponding to pixels {(n + 1, ℓ), (n-1, ℓ + 1), (n, ℓ + 1), (n + 1,ℓ + 1)}. Distribution weighting in accordance with the scheme is given by {(n + 1, ℓ) = 0.4375, (n-1, ℓ + 1) = 0.1875 (n,ℓ + 1)= 0.3125 (n + 1,ℓ + 1) = 0.0625}, or approximated for computer calculation by the set {(n + 1, ℓ) = 0.5, (n-1, ℓ + 1) = 0.125 (n, ℓ + 1) = 0.25 (n + 1,ℓ + 1) = 0.125} as taught in US-A 4,733,230 to Kurihara. See, Figure 1. Additional modifications to the error diffusion algorithm taught by Floyd and Steinberg have been proposed, e.g.: 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). Expanded distribution sets cooperate to reduce worms, at the expense of over-enhancement of edges, more computation and stronger texture orientation in midtone regions. Modifications of the error calculation and weight allocation have been taught, for example, in US-A Patent 4,924,322 to Kurosawa et. al., US- A 5,077,812 to Kanno US-A 4,339,774 to Temple, and US-A 4,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. 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. These are often referred to as worms. Such artifacts particularly appear in the highlight and shadow areas of an image rendered with the original coefficient set proposed by Floyd and Steinberg. In "A Simple Modification of Error Diffusion Weights", IS&T's 46th Annual Conference (May 9-15, 1993), one of the inventors of the present application proposed that worm creation was a result of the lack of error distribution beyond the direction of the diagonal defined by pixel (n, ℓ) and pixel (n-1, ℓ+1). An added distribution to (n-2, ℓ+1) was combined with elimination of distribution to (n+1, ℓ+1). In EP-A-0272147 error is apportioned among a set of peripherally adjacent picture elements at pixel positions (n+1, ℓ), (n-1, ℓ+1), (n, ℓ+1) and (n+1, ℓ+1). In WO-A-89/06080 a filter fetches the four errors from the preceding video line closest to the next sampled pixel as well as the error immediately preceding the next sampled pixel. In accordance with the present invention, there is provided a method of quantizing pixel values, in which an 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 original optical density values, the number of different density values within the set of original density values being larger than the number of different density values within a set of desired output optical density values, including: adding to each pixel an error (ε n,ℓ ) resulting from quantization of previous pixels, if any, to derive a modified optical density value; comparing the modified optical density value of an nth pixel in a scan line ℓ(n, ℓ) with a threshold to select an output value (B n,ℓ ) representing the pixel; determining an error term (ε m ) that is a difference between the output value and the modified optical density value; distributing a weighted portion of the error term (ε m ), to a preselected plurality of pixels, including pixels at positions (n+1, ℓ), (n-3, ℓ+1), (n-2, ℓ+1), (n-1, ℓ+1), (n, ℓ+1), wherein the weighting of each weighted portion corresponds to: (n+1,ℓ)=0.5; (n-3,ℓ+1)=0.0625; (n-2,ℓ+1)=0.0625; (n-1,ℓ+1)=0.125; (n,ℓ+1)=0.25. In accordance with a second aspect of the present invention, there is provided an apparatus for preparing an electronic document for printing at a printer adapted to printing n level spots for each pixel, including: a document input receiving document images defined in terms of digital electronic input signals, each signal having a magnitude selected from one of m levels (where m is greater than n) and corresponding to a pixel and describing density of the document at position n in a scan line ℓ(n,ℓ); a summing circuit, for adding to each input signal (I n,ℓ ) an error signal (ε n,ℓ ) resulting from quantization of previous signals, if any, to derive a modified input signal; a comparator, operatively connected to said document input to receive the modified input signals and to a source of threshold signals, and producing an output response selected from one of the n level spots upon comparing each modified input signal with a threshold signal; a difference circuit for receiving as inputs the output response and the modified input signals and deriving a digital electronic error term signal representing the difference in density between the output response and the modified input signal; a first error term buffer and a corresponding shift register operatively connected to said difference circuit, for receiving an error term from quantization of signal (n-1,ℓ) therefrom and shifting the error term for addition of a weighted portion thereof at said summing circuit to input signal n in scan line ℓ(n,ℓ); a line buffer operatively connected to the first error term buffer, storing a line of error term signals corresponding to signals in scan line ℓ-1; at least second, third, fourth and fifth error term buffers, each having a corresponding shift register, and operatively connected to said line buffer, to receive error terms from the quantization of signals at positions (n,ℓ-1), (n+1, ℓ-1), (n+2,ℓ-1), (n+3, ℓ-1) each shift register shifting the error term for addition of a weighted portion thereof at said summing circuit to input signal n in scan line ℓ(n, ℓ), wherein the weighting of each weighted portion corresponds to: (n-1,ℓ)=0.5; (n+3,ℓ-1)=0.0625; (n+2,ℓ-1)=0.0625; (n+1,ℓ-1)=0.125; (n,ℓ-1)=0.25. Gray pixel values, where the value of the pixel has one of a relatively large number of input levels, is 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 neighbouring unprocessed pixels, increasing or decreasing the gray values of such pixels, which are referred to as modified pixel values. Distribution weighting is in accordance with the scheme {(n+1,ℓ)=0.5, (n-3,ℓ+1)=0.0625, (n-2,ℓ+1)=0.0625, (n-1,ℓ+1) = 0.125, (n,ℓ+1)=0.25,}. These values are particularly useful for digital processing and implementation in hardware. In the Floyd & Steinberg distribution set and coefficients, worms are created due to the lack of error distribution beyond the direction of the diagonal defined by pixel (n, ℓ) and pixel (n-1, ℓ+1). It has been discovered that relatively few weights in larger neighbourhoods represented by Jarvis and Stucki contribute to the reduction of worms, while the remainder of the added weights on cause side effects. Additionally, prior error distribution neighborhoods tried to maintain symmetric distribution about an axis through the n,ℓ pixel and the n, ℓ + 1 pixel, apparently because they viewed error distribution in a static manner. The present invention adds error passing beyond the 45 degree diagonal to pixel (n-2, ℓ + 1) or pixels (n-3, ℓ + 1) and (n-2, ℓ + 1). This effect is combined with elimination of error passing in the direction of pixel (n +1, ℓ +1). Setting the error distribution set to a non-symmetric neighborhood recognizes that the behavior or error passing is dynamic. Accordingly, while the new weights are non-symmetric, they propagate error more evenly about the axis through the n,ℓ pixel and the n, ℓ + 1 pixel. The present invention will be described further by way of examples with reference to 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 Figure 3 represents the error diffusion matrix 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, l 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 buffered at buffer 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,ℓ . The threshold value(s) applied may be constant through the image or may vary either randomly, or in accordance with a dither pattern stored in RAM memory, 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 US-A 5,045,952 to Eschbach, output information as described in US-A 5,055,942 to Levien 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. For the nth pixel in scan line ℓ (i.e., pixel n,ℓ), the distribution matrix as shown in Figure 3, includes pixels at pixel locations corresponding to pixels {(n+1,ℓ), (n-3, ℓ+1), (n-2, ℓ+1), (n-1, ℓ+1) , (n,ℓ I+1) }. Distribution weighting is in accordance with the scheme {(n + 1, ℓ) = 0.5, (n-3, ℓ + 1) r,= 0.0625, (n-2, ℓ + 1) = 0.0625, (n-1, ℓ + 1) = 0.125, (n, ℓ + 1) = 0.25,}. With reference again to Figure 2, the invention is illustrated somewhat differently, showing the contribution of error to a single pixel n,ℓ to be processed. Described will be the error passing arrangement of Figure 3. Accordingly, error ε m is initially stored at past error buffer 24. From past error buffer 24, error ε m is directed to shift register 26, which shifts the binary value representing the error a number of places corresponding to multiplication by 0.5. The resultant error contribution is directed to adder 28. A scan line of errors ε m is temporarily stored at error RAM 30. At an appropriate time, error from scan line ℓ-1 appropriate for distribution to a pixel passing at adder 10 is loaded from RAM 30 into past error buffer 32, and shifted with the same clocking that each pixel is shifted into adder 10, to past error buffers 34, 36, and 38. Weighted portions of error ε m stored at each of these past error buffers, representing the contribution from pixels to ε n,ℓ is added so that at adder 28, for pixel n, ℓ, error from the evaluation of pixels (n, ℓ-1), (n + 1, ℓ-1), (n + 2, ℓ-1), (n + 3, ℓ-1) are added at adder 28 to error from (n-1, ℓ) to derive error ε n,ℓ . Shift registers 40, 42, 44 and 46, respectively corresponding to past error buffers 32, 34, 36 and 38 are available to provide a bit shifting arrangement which shifts the binary value representing the error a number of places corresponding to multiplication by 0.0625, 0.0625, 0.125 and 0.25 respectively. It will no doubt be appreciated that the present invention may be accomplished with either software, hardware or combination software-hardware implementations.

Claims: A method of quantizing pixel values, in which an 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 original optical density values, the number of different density values within the set of original density values being larger than the number of different density values within a set of desired output optical density values, including: adding to each pixel an error (ε n,ℓ ) resulting from quantization of previous pixels, if any, to derive a modified optical density value; comparing the modified optical density value of an nth pixel in a scan line ℓ(n,ℓ) with a threshold to select an output value (B n,ℓ ) representing the pixel; determining an error term (ε m ) that is a difference between the output value and the modified optical density value; distributing a weighted portion of the error term (ε m ), to a preselected plurality of pixels, including pixels at positions (n+1, ℓ), (n-3, ℓ+1) (n-2, ℓ+1), (n-1,ℓ+1), (n,ℓ+1), wherein the weighting of each weighted portion corresponds to: (n+1,ℓ)=0.5; (n-3,ℓ+1)=0.0625; (n-2,ℓ+1)=0.0625; (n-1,ℓ+1)=0.125; (n,ℓ+1)=0.25. Apparatus for preparing an electronic document for printing at a printer adapted to printing n level spots for each pixel, including: a document input receiving document images defined in terms of digital electronic input signals, each signal having a magnitude selected from one of m levels (where m is greater than n) and corresponding to a pixel and describing density of the document at position n in a scan line ℓ(n,ℓ); a summing circuit (10), for adding to each input signal (I n,ℓ ) an error signal (ε n,ℓ ) resulting from quantization of previous signals, if any, to derive a modified input signal; a comparator (14), operatively connected to said document input to receive the modified input signals and to a source of threshold signals, and producing an output response selected from one of the n level spots upon comparing each modified input signal with a threshold signal; a difference circuit (22) for receiving as inputs the output response and the modified input signals and deriving a digital electronic error term signal representing the difference in density between the output response and the modified input signal; a first error term buffer (24) and a corresponding shift register (26) operatively connected to said difference circuit, for receiving an error term from quantization of signal (n-1,ℓ) therefrom and shifting the error term for addition of a weighted portion thereof at said summing circuit to input signal n in scan line ℓ(n,ℓ) ; a line buffer operatively connected to the first error term buffer, storing a line of error term signals corresponding to signals in scan line ℓ-1; at least second, third, fourth and fifth error term buffers (32,34,36,38), each having a corresponding shift register (40,42,44,46), and operatively connected to said line buffer, to receive error terms from the quantization of signals at positions (n,ℓ-1), (n+1,ℓ-1), (n+2,ℓ-1), (n+3,ℓ-1) each shift register shifting the error term for addition of a weighted portion thereof at said summing circuit to input signal n in scan line ℓ(n,ℓ), wherein the weighting of each weighted portion corresponds to: (n-1,ℓ)=0.5; (n+3,ℓ-1)=0.0625; (n+2,ℓ-1)=0.0625; (n+1,ℓ-1)=0.125; (n,ℓ-1)=0.25.

Inventors: FAN SHIGANG, SHIAU JENG-NAN, FAN, SHIGANG, SHIAU, JENG-NAN
Applicants: XEROX CORP, XEROX CORPORATION
Application year: 1994
Main classification: H04N1
IPC codes: G06T5, H04N1, G09G5