# Edge enhancement method for halftone image

Imported: 06 Mar '17 | Published: 13 Jul '10

Pei-Chung Chen

USPTO - Utility Patents

## Abstract

A method for enhancing the edge of a halftone image includes steps of: forming an analysis window with a central pixel and neighboring pixels; quantifying the pixels to get a halftone table; assigning a designated value to each pixel for generating a halftone result; and comparing the halftone result with an edge enhancement table. The edge enhancement table includes a plurality of dotting commands and a plurality of dot tables. The dot tables correspond to the dotting commands so that when a dot table is conformed to the halftone result, a correspondent adjustment of halftone table is taken.

## Description

### BACKGROUND

1. Field of Invention

The invention generally relates to a method of enhancing edge quality when processing an image, and in particular relates to a method of edge enhancement for halftone image.

2. Related Art

For printers or scanners, there are specific sizes of printing or scanning. In a certain size area, more pixels make a higher image quality. The pixel resolution is measured by dots per inch (dpi). In monochromatic printing, pixels are non-black or white. In the dpi solution, a pixel may include several dots. Usually, when a pixel is to be printed, all the dots of the pixel are printed. Likewise, when a pixel is not to be printed, all the dots of the pixel are not printed.

However, if the resolution of the image output apparatus is relatively low, the edge of the image object is found to be step-shaped of one grid by another grid through the naked eye, and a smooth edge as that of the original image object cannot be obtained. Therefore, various solutions are proposed to reduce the jagged effect on the edge of the image object, such that the image output by the image output apparatus can match with the real subject.

As for Edge Enhancement Method and Apparatus for Dot Matrix Devices disclosed in U.S. Pat. No. 5,029,108, the dotting state of the pixels of an image edge and that of the surrounding pixels are compared with a plurality of predetermined pictures, to determine which predetermined picture the pixels of the image edge match with, thus it is determined how to dot the pixels at the image edge to smooth the output image edge and to allow the image more accurately match with the original one. The enhancement of central pixels of each predetermined picture will be modified differently according to the dotting state of the surrounded pixels, for example, dotting at to the left of the central pixel, dotting at to the right of the central pixels, etc

However, the method mentioned above is only suitable for single color image output (namely, the black and white image output). When executing the color image output of the image output device, since each of the color images are composed of the planes of four different colors (cyan, magenta, yellow, and black; CMYK), Thus, in executing the supplementary dotting of the pixels on the edge of the image, the planes of all the four colors must be taken into consideration. Presently it doesn't have any mechanism, which can be utilized to determine the planes, of which colors must be utilized to implement the supplementary dotting of the pixels on the edge of the image. However, if the planes of all the four colors are used to perform the supplementary dotting, then the color displayed on this pixel will be black, thus it may be different from that of the original subject. Nevertheless, there is just no way to know which color may be used to implement the supplementary dotting.

Further, many printing and display devices can only produce binary outputs, therefore, color images have to be transformed into binary outputs. The transforming is called halftone. In halftone process, the error diffusion is a usual method to get higher quality binary outputs. Because halftone output is decreased of its quality during the color level degression, there are many different techniques trying to improve the problem.

In U.S. Pat. No. 6,424,747, a smoothing circuit smoothes lookup tables generated by a color conversion table generator, using a filter function selected from a filter function storage circuit, and supplies smoothed lookup tables to a color processing circuit. However, the method of direct changing the color value may influence the image color reality. In U.S. Pat. No. 6,201,613, an image enhancement of halftone images is performed by subjecting the halftone image to a low-pass filter so as to smooth out halftone variations between adjacent pixels. However, the smoothing is limited due to processing of already-processed halftone image only. U.S. Pat. No. 6,061,145 also discloses a halftone image processing method in which multi-gradation image data is quantized to be converted into quantized pixel patterns, a smoothing portion of a quantized image is detected and a contour of the quantized image is corrected by interpolating pixels of the detected smoothing portion. The quantized pixel pattern of the smoothing portion in the detected quantized image is replaced by a pixel pattern for smoothing stored in a memory. Since the detecting and replacing is a two-step process, it takes more time. Further, more preset patterns cost more detecting time and larger memory size, so it is not practicable. U.S. Pat. No. 5,757,976 provides a set of error filters having different sizes and associated weighted coefficients for diffusing quantization errors among neighboring pixels in predetermined tonal areas of an image to achieve a smooth halftone image quality. However, the error filters can only influence the noise and repeated patterns of halftone process. They don't have effective improvements to original images of lower quality.

Therefore, the conventional methods mostly aim at the overall image quality improvement, or just the monochromatic image edge improvement. As for color image output devices, how to take enhancements to the edge of an image, and to make the edge of output image smoother and conformed to the original color, actually remains an unresolved difficult problem.

### SUMMARY

The object of the invention is to provide an edge enhancement method of halftone image and to solve the aforesaid problems of image edge improvements.

Therefore, a method for enhancing the edge of a halftone image according to the invention includes the following steps: forming an analysis window with a central pixel wherein the analysis window includes the central pixel and the neighboring pixels located around it; quantifying the pixels to get a halftone table; assigning a designated one-bit value to each pixel for generating a halftone result; comparing the halftone result with an edge enhancement table wherein the edge enhancement table includes a plurality of dotting commands and a plurality of dot tables and each dot table corresponds one of dotting commands; and executing a halftone adjustment for the halftone table when one of dot tables is conformed to the halftone result.

The adjustment of halftone table includes the following steps: obtaining correspondent dotting commands according to the conformed dot table; calculating a plurality of adjustment values for the pixels according to the dotting commands and an error diffusion process; and adjusting the halftone table according to the adjustment values.

The invention further provides a method for enhancing the edge of colored halftone image. The method includes the following steps: separating an edge image into four color planes; processing halftone error diffusion for each color plane, and comparing the dot table and correspondent dotting commands with a dotting command lookup table to obtain practical dotting commands for the pixels.

The halftone error diffusion process for each color plane includes the following steps: forming an analysis window taking a pixel as a center wherein the analysis window includes the central pixel and the neighboring pixels located around it; quantifying the pixels to get a halftone table; assigning a designated one-bit value to each pixel for generating a halftone result; comparing the halftone result with an edge enhancement table wherein the edge enhancement table includes a plurality of dotting commands and a plurality of dot tables and each dot table corresponds one of dotting commands; and executing an adjustment for the halftone table when one of dot tables is conformed to the halftone result.

The adjustment of halftone table includes the following steps: obtaining correspondent dotting commands according to the conformed dot table; calculating a plurality of adjustment values for the pixels according to the dotting commands and an error diffusion process; and adjusting the halftone table according to the adjustment values.

For colored halftone image, the aforesaid steps are repeated sequentially for each central pixel in each color plane so as to finish halftone error diffusions for all color planes.

An embodiment of the invention shows the method of enhancing image quality of an image output; that is, through suitable dotting on the image edge, the edge of the image can be smoother.

Meanwhile, the invention remains the image quality and lets the color of image much alike the original image.

Further scope of applicability of the present invention will become apparent from the detailed description given hereinafter. However, it should be understood that the detailed description and specific examples, while indicating preferred embodiments of the invention, are given by way of illustration only, since various changes and modifications within the spirit and scope of the invention will become apparent to those skilled in the art from this detailed description.

### DETAILED DESCRIPTION

FIG. 1 is an example of an image, a word Destiny, in which a partial edge of the character s is taken as an edge enhancement example in the following descriptions of preferred embodiment of the invention. The word is of blue color.

FIG. 1B an enlargement of partial edge portion A taken from the image of FIG. 1A. FIG. 2 is flowchart of an edge enhancement method of halftone image in an embodiment of the invention. First, separating the image of edge portion A into four color planes (step 110): cyan, magenta, yellow and black (CMYK), as shown in FIGS. 3A to 3D respectively.

Then, process halftone error diffusion for each color plane (step 120). Because the halftone error diffusion process for each color plane is substantially the same, the following description takes the yellow (Y) plane process for example.

As shown in FIG. 4, first form an analysis window 220 with a central pixel 210 (step 122). The analysis window 220 is an m by n matrix including the central pixel 210 and the neighboring pixels located around it. Quantify the pixels of the analysis window 220 to get a halftone table (step 124) in which each pixel has a grayscale value. Assign a designated one-bit value to each pixel of the analysis window 220 for generating a halftone result (step 126). Here, the designated one-bit value for the central pixel is 1 and those for the rest pixels are 0. Further, compare the halftone result with an edge enhancement table to find out a dot table and corresponding dotting commands that are most conformed to the halftone result (step 128). In other words, the edge enhancement table includes a plurality of dotting commands and a plurality of dot tables. In addition, a same dotting command corresponds to a group of dot tables. If there is no dot table conformable in the edge enhancement table, the halftone result is then taken as the base for dotting of the central pixel 210. On the other hand, if there is a dot table conformable in the edge enhancement table, the correspondent dotting commands are obtained for taking error diffusion to get adjustment values (step 130). Then, adjust the halftone table according to the adjustment values (step 132) so as to add the adjustment values into the grayscale values. The foresaid process is repeated for each pixel of each color plane till finishing halftone error diffusion process of all color planes. Finally, compare the dot table and correspondent dotting commands of each color plane with a dotting command lookup table to obtain practical dotting commands for the edge pixels (step 140).

The following description takes pixels a, b, c and d (see FIG. 5) of Y color plane for example of detailed halftone error diffusion process. The resolution of the image is 255 dpi.

FIGS. 6A to 6H are descriptive views of edge enhancement table in the embodiment of the invention. Black dots and white dots are represented as 1 and 0 respectively. The rest (undesignated) portions are negligible. Supposed each dot table 232 is a 9 by 5 matrix, here are six groups of dot tables 232 corresponding to different dotting commands 234 for the edge enhancement table 230. The dotting commands 234 are based on the dot conditions of the central pixel 210 and its neighboring pixels to determine the dot position of the central pixel 210, which is corresponding to the edge portion A in FIG. 1.

The dot tables 232 of each group correspond to a same dotting command 234. In the edge enhancement table 230, each group is shown with 4 or 8 dot tables 232 for example. Of course there can be more or less dot tables for determining the dot position of the central pixel 210. In other words, suitable amounts of dotting commands and correspondent dot tables can be settled through software process depending on requirements.

First, a pixel a in FIG. 5 is taken as a central pixel 212 for forming an analysis window 222. As shown in FIG. 7, the analysis window is a 9 by 5 matrix including the central pixel 212 and its neighboring pixels. Then, quantify the pixels in the analysis window 222 to get a halftone table 242, as shown in FIG. 8A. The grayscale values of each pixel in the analysis window 222 are h11 to h95, in which 0h11 to h95255.

Assigning a designated one-bit value to each pixel in the analysis window 222 for generating a halftone result 252, as shown in FIG. 8B. The designated one-bit values for the edge pixels are 1, and the rest are 0.

Compare the halftone result 252 with an edge enhancement table 230 to find out a dot table 232 and corresponding dotting commands 234 that are most conformed with the halftone result. If there is no dot table conformable in the edge enhancement table 230, the halftone result 252 is then taken as the base for dotting of the pixel a.

Then, a pixel b in FIG. 5 is taken as a central pixel 214 for forming an analysis window 224. As shown in FIG. 9, the analysis window is a 9 by 5 matrix including the central pixel 214 and its neighboring pixels. Then, quantify the pixels in the analysis window 224 to get a halftone table 244, as shown in FIG. 10A. The grayscale values of each pixel in the analysis window 224 are h11 to h95, in which 0h11 to h95255.

Assign a designated one-bit value to each pixel in the analysis window 224 for generating a halftone result 254, as shown in FIG. 10B. The designated one-bit values for the edge pixels are 1, and the rest are 0.

Compare the halftone result 254 with an edge enhancement table 230 to find out a dot table 232 and corresponding dotting commands 234 that are most conformed to the halftone result. If there is no dot table conformable in the edge enhancement table 230, the halftone result 254 is then taken as the base for dotting of the pixel b.

Further, a pixel c in FIG. 5 is taken as a central pixel 216 for forming an analysis window 226. As shown in FIG. 11, the analysis window is a 9 by 5 matrix including the central pixel 216 and its neighboring pixels. Then, quantify the pixels in the analysis window 226 to get a halftone table 246, as shown in FIG. 12A. The grayscale values of each pixel in the analysis window 226 are h11 to h95, in which 0h11 to h95255.

Assign a designated one-bit value to each pixel in the analysis window 226 for generating a halftone result 256, as shown in FIG. 12B. The designated one-bit values for the edge pixels are 1, and the rest are 0.

Compare the halftone result 256 with an edge enhancement table 230 to find out a dot table 232 and corresponding dotting commands 234 that are most conformed to the halftone result. In this step, a dot table 232 and dotting command 234, numbered m44, in PP2 of the edge enhancement table 230 is conformed to the dot conditions of the central pixel 216 and its neighboring pixels in the halftone result 256. The correspondent dotting command 234 of the dot table 232 of m44 is to dot at one third of left side of the central pixel 216 so as to smoothen the edge.

Then, calculate the adjustment values a63 to a95 located after the central pixel 216 according to the dotting command 234 in PP2. As shown in FIG. 13A, those marked with x are negligible. In this step, applying error diffusion filter to quantify the pixels located after the central pixel 216 and to get error diffusion values e63 to e95, as shown in FIG. 13B. Then, calculate the adjustment values a65 to a95 of the pixels located after the central pixel 216 according to the error diffusion values e63 to e95 and the dotting command 234. For example:

$e = e 63 + e 73 + e 83 + e 93 + e 14 + e 24 + + e 75 + e 85 + e 95 ;$ $PP 2 = d ( 1 3 ) = 255 1 3 = 85 ; a 63 = e 63 e ( 255 - 85 ) ; a 73 = e 73 e ( 255 - 85 ) ; a 83 = e 83 e ( 255 - 85 ) ; a 85 = e 85 e ( 255 - 85 ) ; a 95 = e 95 e ( 255 - 85 )$

Further, add the adjustment values a63 to a95 to the original grayscale value h63 to h95 respectively to get an after-adjustment halftone table 246, as shown in FIG. 13C.

For example, supposed error diffusion values, as shown in FIG. 14A, are obtained after quantifying the pixels located after the central pixel 216. Then, according to the above equations, we get e=46, and calculations of adjustment values as shown in FIG. 14B. after adding the adjustment values to the original grayscale values h63 to h95, an after-adjustment halftone table 246 is obtained.

Further, a pixel d in FIG. 5 is taken as a central pixel 218 for forming an analysis window 228. As shown in FIG. 15, the analysis window is a 9 by 5 matrix including the central pixel 218 and its neighboring pixels. Then, quantify the pixels in the analysis window 228 to get a halftone table 248, as shown in FIG. 16A. The grayscale values of each pixel in the analysis window 228 are h11 to h95, in which 0h11 to h95255.

Assign a designated one-bit value to each pixel in the analysis window 228 for generating a halftone result 258, as shown in FIG. 16B. The designated one-bit values for the edge pixels are 1, and the rest are 0.

Compare the halftone result 258 with an edge enhancement table 230 to find out a dot table 232 and corresponding dotting commands 234 that are most conformed to the halftone result. If there is no dot table conformable in the edge enhancement table 230, the halftone result 258 is then taken as the base for dotting of the pixel d. Here, the grayscale value h62 in the halftone table 248 is the grayscale value h63+a63 in the aforesaid after-adjustment halftone table 246.

By the aforesaid process, dot tables and dotting commands corresponding to each halftone result of each color plane are obtained. Finally, compare the dot table and correspondent dotting commands of each color plane with a dotting command lookup table to obtain practical dotting commands for the edge pixels.

Table 1 is an example of dotting command lookup table. In the table, None means no conformable dotting command for any color plane. One plane means there is a conformable dotting command for a color plane. Conformable plane C means there is a conformable dotting command for the cyan plane. Conformable plane M means there is a conformable dotting command for the magenta plane. Conformable plane Y means there is a conformable dotting command for the yellow plane. Conformable plane K means there is a conformable dotting command for the black plane. The table also shows the practical dotting process when there are two or more color planes having conformable dotting commands.

TABLE 1 Dotting command lookup table Comparison result Practical dotting command Conformable None Remain original result plane Conformable One plane The dotting command of plane conformable plane Conformable C M plane Dotting Left Right C: left and M: right command Left Left C: left or M: left . . . . . . . . . Conformable C Y plane Dotting Left Right C: left and Y: right command left Left C: left or Y: left . . . . . . . . . Conformable C K plane Dotting Left Right C: left and K: right command Left Left K: left . . . . . . . . . Conformable M Y plane Dotting Left Right M: left and Y: right command Left Left M: left or Y: left . . . . . . . . . Conformable M K plane Dotting Left Right M: left and K: right command Left Left K: left . . . . . . . . . Conformable C M Y plane Dotting Left Left Left C: left or M: left or Y: command left Left Left Right C: left or M: left and Y: right . . . . . . . . . . . . Conformable C M K plane Dotting Left Left Left K: left command Left Left Right C: left or M: left and K: right . . . . . . . . . . . . Conformable C K Y plane Dotting Left Left Left K: left command Left Left Right K: left and Y: right . . . . . . . . . . . . Conformable M K Y plane Dotting Left Left Left K: left command Left Left Right K: left and Y: right . . . . . . . . . . . . Conformable C M Y K plane Dotting Left Left Left Left K: left command Left Left Left Right K: right and C: left or M: left or Y: left Left Left Right Left K: left and Y: right Left Left Right Right K: right and C: left or M: left Left Right Left Left K: left and M: right . . . . . . . . . . . . . . .

For example, when the cyan plane has a dotting command of Left , and the Magenta plane has a dotting command of Right , then, the practical dotting commands are: dotting at the one third left side of the edge pixel with a cyan dot, and dotting at the one third right side with a magenta dot.

Taking the edge portion A in FIG. 1B as an example, the pixel c has halftone patterns numbered m44 conformable in both cyan and magenta color planes. Their correspondent dotting commands are all dotting at one third left side of the central pixel. There is no other conformable dot table in the other planes. Therefore, from Table 1, looking up the Left in C plane and Left in M plane to get the practical dotting commands of dotting 10 at one third left side of the edge pixel with a cyan or magenta plane.

The aforesaid embodiment is described with color image. However, it is applicable to monochromatic image. When enhancing the edge of a monochromatic image, the aforesaid step 110 is omitted and directly proceeding the halftone error diffusion.

The invention being thus described, it will be obvious that the same may be varied in many ways. Such variations are not to be regarded as a departure from the spirit and scope of the invention, and all such modifications as would be obvious to one skilled in the art are intended to be included within the scope of the following claims.

## Claims

1. A method for enhancing edge of a halftone image, comprising steps of:
performing the following steps using an image processing device;
forming an analysis window with a pixel as a central pixel; the analysis window comprising the central pixel and neighboring pixels;
quantifying the pixels to get a halftone table;
assigning a designated value to each pixel for generating a halftone result;
comparing the halftone result with an edge enhancement table having a plurality of dotting commands and a plurality of dot tables; the dot tables correspond to one of the dotting commands; and
executing a halftone table adjustment when one of the dot tables is conformed to the halftone result; the adjustment comprising steps of:
obtaining correspondent dotting commands according to the conformed dot table;
calculating a plurality of adjustment values for the pixels according to the dotting commands and an error diffusion process; and
performing the following steps using an image processing device;
forming an analysis window with a pixel as a central pixel; the analysis window comprising the central pixel and neighboring pixels;
quantifying the pixels to get a halftone table;
assigning a designated value to each pixel for generating a halftone result;
comparing the halftone result with an edge enhancement table having a plurality of dotting commands and a plurality of dot tables; the dot tables correspond to one of the dotting commands; and
executing a halftone table adjustment when one of the dot tables is conformed to the halftone result; the adjustment comprising steps of:
obtaining correspondent dotting commands according to the conformed dot table;
calculating a plurality of adjustment values for the pixels according to the dotting commands and an error diffusion process; and
obtaining correspondent dotting commands according to the conformed dot table;
calculating a plurality of adjustment values for the pixels according to the dotting commands and an error diffusion process; and
2. The method for enhancing edge of a halftone image according to claim 1 wherein the halftone table comprises a plurality of grayscale values of the pixels.
3. The method for enhancing edge of a halftone image according to claim 1 wherein the step of adjusting the halftone table according to the adjustment values further comprises a step of adding the grayscale values with the adjustment values of same pixels.
4. The method for enhancing edge of a halftone image according to claim 1 wherein the dotting command is to define a representative dot position for the pixels.
5. The method for enhancing edge of a halftone image according to claim 1 wherein the dot table has a same size as that of the analysis window.
6. The method for enhancing edge of a halftone image according to claim 1 wherein the designated value is a one-bit value.
7. A method for enhancing edge of a colored halftone image, comprising steps of:
performing the following steps using an image processing device;
separating an edge image into four color planes;
performing a halftone diffusion process to the each color plane; the process comprises steps of:
forming an analysis window with a pixel as a central pixel; the analysis window
comprises the central pixel and neighboring pixels;
quantifying the pixels to get a halftone table;
assigning a designated value to each pixel for generating a halftone result;
comparing the halftone result with an edge enhancement table having a plurality of dotting commands and a plurality of dot tables; the dot tables correspond to one of the dotting commands; and
executing a halftone table adjustment when one of the dot tables is conformed to the halftone result; the adjustment comprises steps of:
obtaining correspondent dotting commands according to the conformed dot table;
calculating a plurality of adjustment values for the pixels according to the dotting commands and an error diffusion process; and
comparing the dot table and correspondent dotting commands of each color plane with a dotting command lookup table to obtain practical dotting commands for the pixels.
performing the following steps using an image processing device;
separating an edge image into four color planes;
performing a halftone diffusion process to the each color plane; the process comprises steps of:
forming an analysis window with a pixel as a central pixel; the analysis window
comprises the central pixel and neighboring pixels;
quantifying the pixels to get a halftone table;
assigning a designated value to each pixel for generating a halftone result;
comparing the halftone result with an edge enhancement table having a plurality of dotting commands and a plurality of dot tables; the dot tables correspond to one of the dotting commands; and
executing a halftone table adjustment when one of the dot tables is conformed to the halftone result; the adjustment comprises steps of:
obtaining correspondent dotting commands according to the conformed dot table;
calculating a plurality of adjustment values for the pixels according to the dotting commands and an error diffusion process; and
comparing the dot table and correspondent dotting commands of each color plane with a dotting command lookup table to obtain practical dotting commands for the pixels.
forming an analysis window with a pixel as a central pixel; the analysis window
comprises the central pixel and neighboring pixels;
quantifying the pixels to get a halftone table;
assigning a designated value to each pixel for generating a halftone result;
comparing the halftone result with an edge enhancement table having a plurality of dotting commands and a plurality of dot tables; the dot tables correspond to one of the dotting commands; and
executing a halftone table adjustment when one of the dot tables is conformed to the halftone result; the adjustment comprises steps of:
obtaining correspondent dotting commands according to the conformed dot table;
calculating a plurality of adjustment values for the pixels according to the dotting commands and an error diffusion process; and