Abstract:
A system and method of processing an error diffusion half-tone image, which produces a halftone image in accordance with a continuous-tone image. The continuous tone image consists of a two-dimension array of pixels (i, j), where i, j indicate i-th row and j-th column of the image. The method includes: (A) selecting a threshold as a k-th color threshold in accordance with a value of a k-th color of a pixel (i, j); (B) comparing the value of the k-th color of the pixel (i, j) and the k-th color threshold; (C) outputting a bi-level value associated with the k-th color of the pixel (i, j) in accordance with a comparison result produced in step (B); (D) determining an error between the k-th color value of the pixel (i, j) and the bi-level value; (E) diffusing the error to k-th colors of pixels adjacent to the pixel (i, j).

Description:
BACKGROUND OF THE INVENTION  
       [0001]     1. Field of the Invention  
         [0002]     The invention relates to the technical field of halftone image processing and, more particularly, to a system and method of processing an error diffusion halftone image.  
         [0003]     2. Description of Related Art  
         [0004]     In a practical print technology used in a printer, due to a low resolution on human eyes, when a group of dots is densely arranged on a small area, the human eyes cannot distinguish one dot from another but feel an averaged reflectivity formed by the dots. Thus, different gray levels in printing are produced by controlling the density of the dots. A typical halftone technique can determine individual positions of the dots to accordingly obtain a desired gray level and reduce an uncomfortable effect in a frame on the eyes.  
         [0005]     The halftone image technique is typically used in binary image output devices such as inkjet printers, laser printers, and the like. Such output devices present an image proximate to an original continuous-tone by determining each pixel to be printed or not. Thus, great information may be lost in the halftone processing, and it causes some defects, such as fixed frequency patterns, worm patterns and the like, that are easily viewed by the eyes.  
         [0006]     A typical technique in the halftone image processing is an error diffusion.  FIGS. 1A  to  1 D are schematic view of an operation of the error diffusion, which essentially has three steps. First, a continuous-tone data is input to compare with a threshold, as shown in  FIG. 1A  in which a color value (80) of a pixel (i,j) is compared with a threshold (127). Because the color value (80) is smaller than the threshold (127), the color value (80) of the pixel (i,j) is reset to zero to output. In  FIG. 1B , an error (80) of the output (0) and the value (80) is calculated. In  FIGS. 1C and 1D , the error (80) is proportionally diffused to adjacent pixels in accordance with an error diffusion matrix  110 . The cited steps are repeated until the entire image is complete. The error diffusion can relatively improve the output quality of an image but cannot completely eliminate the defects of all output images.  
         [0007]     U.S. Pat. No. 5,737,453 discloses a threshold mask to averagely diffuse the dots, and an error diffusion matrix changed with the positions of input pixels. Such an error diffusion matrix can improve image defects on light and dark regions but easily produce fixed frequency patterns in a median tone image.  
         [0008]     Therefore, it is desirable to provide an improved system and method to mitigate and/or obviate the aforementioned problems.  
       SUMMARY OF THE INVENTION  
       [0009]     The object of the invention is to provide a system and method of processing an error diffusion halftone image, which can avoid the problem of fixed frequency patterns or worm patterns produced in the prior art and further reduce the uncomfortable effect in a frame for human eyes.  
         [0010]     In accordance with one aspect of the present invention, there is provided a system of processing an error diffusion halftone image. The system produces a halftone image in accordance with a continuous-tone image. The continuous-tone image consists of a two-dimension (2D) array of pixels (i, j), where i, j are a positive integer and indicate i-th row and j-th column of the image. The system includes an adder, a threshold generator, a comparator, a subtractor and an error diffuser. The adder has a first input terminal to receive a color of a pixel (i, j) and a second input terminal to receive a feedback color error diffusion signal, thereby producing a corrected color of the pixel (i, j). The threshold generator has a first input terminal to receive a position of the pixel (i, j) and a second input terminal to receive the color of the pixel (i, j), and selects a color threshold in accordance with the position of the pixel (i, j) and a value of the color of the pixel (i, j). The comparator is connected to the adder and the threshold generator in order to compare a value of the corrected color and the color threshold and thus produces a bi-level value associated with the color of the pixel (i, j). The subtractor has a first input terminal to receive the corrected color and a second input terminal to receive the bi-level value, and subtracts the value of the corrected color from the bi-level value to thus produce a color error. The error diffuser is connected to the subtractor in order to produce the feedback of the color error diffusion signal.  
         [0011]     In accordance with another aspect of the present invention, there is provided a method of processing an error diffusion half-tone image. The method produces a halftone image in accordance with a continuous-tone image. The continuous-tone image consists of a 2D array of pixels (i, j), where i, j are a positive integer and indicate i-th row and j-th column of the image. The method includes: (A) selecting a threshold as a color threshold in accordance with a value of a color of a pixel (i, j); (B) comparing the value of the color of the pixel (i, j) and the color threshold; (C) generating a bi-level value associated with the color of the pixel (i, j) in accordance with a comparison result produced in step (B); (D) determining an error between the value of the color of the pixel (i, j) and the bi-level value; (E) diffusing the error to colors of pixels adjacent to the pixel (i, j).  
         [0012]     Other objects, advantages, and novel features of the invention will become more apparent from the following detailed description when taken in conjunction with the accompanying drawings. 
     
    
     BRIEF DESCRIPTION OF THE DRAWINGS  
       [0013]      FIGS. 1A  to  1 D are schematic views of an operation of typical error diffusion;  
         [0014]      FIG. 2  is a block diagram of a system of processing an error diffusion halftone image in accordance with the invention;  
         [0015]      FIG. 3  is a schematic view of a threshold table in accordance with the invention;  
         [0016]      FIG. 4  is a flowchart of a method of processing an error diffusion halftone image in accordance with the invention;  
         [0017]      FIG. 5A  is a schematic view of typically processing a median tone image; and  
         [0018]      FIG. 5B  is a schematic view of processing a median tone image in accordance with the invention.  
     
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT  
       [0019]      FIG. 2  is a block diagram of a system of processing an error diffusion halftone image in accordance with the invention. The system processes a continuous-tone image and produces a halftone image. The continuous-tone image consists of a two-dimension (2d) array of pixels (i, j), where i, j are a positive integer and indicate i-th row and j-th column of the image. Each pixel (i, j) contains three colors of cyan, magenta and yellow, and values of which are respectively denoted as C(i,j), M(i,j) and Y(i,j). The system includes an adder  210 , a threshold generator  220 , a comparator  230 , a subtractor  240  and an error diffuser  250 .  
         [0020]     The adder  210  has a first input terminal to receive a color of a pixel (i, j). In this case, the C(i,j) is given as an example, and is also similar to the magenta and the yellow. The adder  210  also has a second input terminal to receive a feedback error diffusion signal of the color, thereby producing a corrected value C(i,j )′ of the cyan of the pixel (i, j).  
         [0021]     The threshold generator  220  has a first input terminal  221  to receive a position of the pixel (i, j) and a second input terminal  222  to receive the C(i, j) of the pixel (i, j), and selects a cyan threshold in accordance with the position and C(i,j ) of the pixel (i, j).  
         [0022]     The threshold generator  220  includes a position associated threshold generator  223 , a random threshold generator  224  and a selector  225 . The position associated threshold generator  223  produces a position associated threshold in accordance with the position of the pixel (i, j).  FIG. 3  is a threshold table  310 . When the pixel (i, j) locates on position (2, 3), namely i=2 and j=3, the position associated threshold generator  223  selects a threshold (49) at second row and third column of the threshold table  310  as the position associated threshold  226 . Namely, the position associated threshold generator  223  selects a threshold based on x row and y column of the threshold table  310 , wherein x=(i mod 8) and y=(j mod 8).  
         [0023]     The random threshold generator  224  uses a random function generator to directly generate a random threshold  227 , where the random threshold  227  ranges from 0 to 255.  
         [0024]     The selector  225  is connected to the position associated threshold generator  223  and the random threshold generator  224 , and selects the position associated threshold  226  or random threshold  227  as the cyan threshold in accordance with the C(i, j) of the pixel (i, j). When the C(i, j) of the pixel (i, j) is a median tone, the selector  225  selects the random threshold  227  as the cyan threshold, wherein the median tone ranges from 70 to 140. Namely, the selector  225  selects the random threshold  227  as the cyan threshold when 70≦C(i,j)≦140, and otherwise the position associated threshold  226  is selected as the cyan threshold.  
         [0025]     The comparator  230  is connected to the adder  210  and the threshold generator  220 . The comparator  230  compares the corrected value C(i,j)′ and the cyan threshold to thus produce a bi-level value  231  for the cyan of the pixel (i,j). When the corrected value C(i,j)′ exceeds the cyan threshold, a first bi-level value (255) is produced for the cyan of the pixel (i, j), and a halftone output signal (not shown) is set to be open. Conversely, when the corrected value C(i,j)′ does not exceed the cyan threshold, a second bi-level value (0) is produced for the cyan of the pixel (i, j ), and the halftone output signal (not shown) is set to be closed. When the inventive technology is applied to a color printer, a value of the halftone output signal can indicate whether or not the pixel (i,j) is printed.  
         [0026]     The subtractor  240  has a first input terminal to receive the corrected value C(i,j)′ and a second input terminal to receive the bi-level value associated with the cyan of the pixel (i, j). The subtractor  240  subtracts the corrected value C(i,j)′ from the bi-level value to thus produce a cyan error. The error diffuser  250  is connected to the subtractor  240  in order to produce a feedback cyan error diffusion signal in accordance with an error diffusion matrix (not shown) and the cyan error.  
         [0027]      FIG. 4  is a flowchart of a method of processing an error diffusion halftone image in accordance with the invention. The method produces a halftone image in accordance with a continuous-tone image. The continuous-tone image consists of a 2D array of pixels (i, j), where i, j are a positive integer and indicate i-th row and j-th column of the image. Each pixel (i, j) contains three colors of cyan, magenta and yellow, and values of which are denoted as C(i, j), M (i, j) and Y(i, j) respectively. In this case, the C(i, j) is given as an example, and is also similar to the magenta and the yellow.  
         [0028]     In step S 405 , a continuous-tone data is received, i.e., the C(i,j), associated with a pixel (i,j). Step S 410  determines if the C(i,j ) belongs to a light or deep color section, i.e., the C(i,j) is smaller than 70 or greater than 140. If the C(i,j) belongs to a light or deep color section, step S 415  is executed; otherwise, step S 420  is executed.  
         [0029]     In step S 415 , it is based on the pixel position (i, j) associated with the pixel currently processing to accordingly obtain a respective threshold, i.e., the respective threshold Th is a function of the pixel position (i, j) (Th=F(i, j)). Step S 420  uses a random generator to generate a threshold, i.e., the respective threshold Th is equal to random function(Th=random function). Step S 425  determines if the C(i, j) is greater than the threshold Th; if yes, step S 430  is executed, and if not, step S 435  is executed.  
         [0030]     In step S 430 , a first bi-level value (255) associated with the cyan of the pixel (i, j) is output and also a halftone output signal (not shown) is set to be open. In step S 435 , a second bi-level value (0) associated with the cyan of the pixel (i,j) is output, and also the halftone output signal is set to be closed. When the inventive technology is applied to a color printer, a value of the halftone output signal can indicate whether or not the pixel (i,j) is printed.  
         [0031]     Step S 440  calculates a cyan error by subtracting the C(i,j) from the bi-level value associated with the pixel (i,j). Step S 445  diffuses the cyan error to adjacent pixels in accordance with a diffusion matrix. Step S 450  repeats the entire procedure until the whole image is complete.  
         [0032]      FIG. 5A  is a schematic view of typically processing a median tone image. As shown in  FIG. 5A , the median region produces fixed frequency patterns due to the over-regularity. However,  FIG. 5B  shows a schematic view of processing a median tone image in accordance with the invention, which does not have such fixed frequency patterns. This is because the inventive threshold generator  220  can select the position associated threshold  226  or random threshold  227  as the cyan threshold in accordance with the C(i,j) of the pixel (i,j), and selects the random threshold  227  produced by the random function when processing a median tone image, thereby avoiding the prior fixed frequency patterns.  
         [0033]     As cited, the inventive system and method of processing an error diffusion halftone image use the threshold produced by the random function in processing the median tone image, which can avoid the fixed frequency patterns produced by the over-regularity and further reduce an uncomfortable effect in a frame on human eyes.  
         [0034]     Although the present invention has been explained in relation to its preferred embodiment, it is to be understood that many other possible modifications and variations can be made without departing from the spirit and scope of the invention as hereinafter claimed.