Image processing apparatus and method capable of eliminating image contour distortion

An image processing apparatus providing a halftoning process such as error diffusion prevents an image contour distortion, as follows: data in an image to be processed is used to partially extend the image to be processed. Then error diffusion or the like is employed to provide a halftoning process. The extension is removed to obtain image data. A dot generation delay can be prevented that would otherwise be introduced such as when an extension-free image is halftoned.

This application is based on application No. 2000-154316 filed in Japan, the content of which is hereby incorporated by reference.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates generally to image processing apparatus and methods and recording media having an image processing program recorded therein and particularly to those provided to halftone image data to be processed.

2. Description the Related Art

An image processing apparatus has been conventionally known as providing a halftoning process such as error diffusion. Error diffusion allows an image to be generally reproduced with the tone of an input image while reducing the number of gray levels of dots configuring the image.

FIG. 16shows a specific example of an image input to an image processing apparatus. As shown in the figure, this image has a square contour, with a density low at the upper left portion and higher as it comes closer to the lower right portion.

FIG. 17shows a result of processing theFIG. 16image through error diffusion. As is apparent fromFIG. 17, the image has an upper left portion with a contour which should be pointed but in effect rounded. Thus the conventional technique disadvantageously introduces a contour distortion in an image particularly at a portion having a light color.

SUMMARY OF THE INVENTION

The present invention has been made to overcome the aforementioned disadvantage and it contemplates an image processing apparatus, method and program capable of eliminating an image contour distortion.

In order to achieve the above object the present invention in one aspect provides an image processing apparatus including: an extender extending at least one side of first image data outwardly of the first image data by a predetermined amount to produce second image data; a halftoner halftoning the second image data to produce third image data; and an extractor extracting from the third image data a portion corresponding to the first image data.

The present invention in another aspect provides an image processing apparatus including: an extender extending at least one side of first image data outwardly of the first image data by a predetermined amount to produce second image data; and a halftoner halftoning the second image data and extracting only a portion corresponding to the first image data from the second image data halftoned.

The present invention in still another aspect provides an image processing method comprising the steps of: extending at least one of first image data outwardly of the first image data by a predetermined amount to produce second image data; halftoning the second image data to produce third image data; and extracting from the third image data a portion corresponding to the first image data.

The present invention in still another aspect provides an image processing program executing a method including the steps of: extending at least one side of first image data outwardly of the first image data by a predetermined amount to produce second image data; halftoning the second image data to produce third image data; and extracting from the third image data a portion corresponding to the first image data.

DESCRIPTION OF THE PREFERRED EMBODIMENTS

First Embodiment

FIG. 1is a block diagram showing a configuration of an image processing apparatus in a first embodiment of the present invention. With reference to the figure, the image processing apparatus includes an image extension block100extending at least a portion of image data input, a halftoning block200halftoning the extended image data, and a cutting block300cutting off the extension of the image data.

Halftoning block200includes a subtracter201subtracting an error from the image data of a pixel to be processed (a target pixel), a thresholding block205thresholding the output of subtracter201, and a subtracter203subtracting the output of subtracter201from the result obtained at thresholding block205.

FIG. 2represents image data to be processed by theFIG. 1image processing apparatus, i.e., input image data. With reference to the figure, the image data is configured of horizontally arranged M pixels multiplied by vertically arranged N pixels. Each pixel has a pixel value represented by ayx, wherein y represents a vertical position and x represents a horisontal position.

With reference toFIG. 1, image extension block100provides a process of steps S1–S13to extend an image leftward, upper-leftward and upward.

More specifically, initially at step S1image data of a11is read m times and thus output, wherein m represents the number of pixels extending the image horizontally.

Then at step S3data of a1xare successively read, wherein x=1 to M. Steps S1and S3are repeated n times, wherein n represents the number of pixels extending the image vertically. Note that preferably m and n are both approximately several tens to approximately one hundred.

Then steps S11and S13are repeated for y=1 to n.

At step S11, data of ay1is read m times. At step S13, data of ayxare successively read, wherein x=1 to m.

TheFIG. 2image data thus processed becomes an extended image data, as shown inFIG. 3. More specifically, theFIG. 2image data has left, upper left and upper portions with new image data added thereto as an extension. The extension contains image data derived from the image data of an end of the input image data, as shown in the figure.

The image data produced as shown inFIG. 3is halftoned by theFIG. 1halftoning block200. In the present embodiment a halftoning process is provided through such an error diffusion as shown inFIG. 4.

More specifically, subtracter201subtracts from input data an error generated from a neighboring pixel and thereon is performed a thresholding operation. The difference between the result of the thresholding operation and the value before it is thresholded is provided as an error and sent to a neighboring pixel.

As shown inFIG. 5, in the present embodiment an error calculated through processing a single pixel is sent to right, lower right, lower and lower left pixels for a total of four pixels. More specifically, as shown inFIG. 6, a single pixel receives errors from upper left, upper, upper right and left pixels for a total of four pixels.

As such, with reference toFIG. 7, a pixel A, a pixel at which the process starts, does not receive any error from any pixels and a pixel B, a pixel in the uppermost row, only receives an error from a left pixel. Thus in an image pixels at left and upper ends receive an error smaller than should be received, as compared to other pixels. This prevents a normal halftoning process.

Thus, in conventional art, dot generation is delayed for an original image particularly at a portion having a light color, disadvantageously resulting in a contour having a distortion inward, as shown inFIG. 17.

Accordingly the present invention, as shown inFIG. 8, provides an image processing wherein an original image is partially extended, as shown at (C), and then halftoned as shown at (D) and then has an extension (an unnecessary portion) cut, as shown at (E).

This can prevent a dot generation delay introduced for example when, as shown at (A), an image which is not extended is halftoned, as shown at (B).

At theFIG. 1step S21initial, (m+M)×n image data are ignored. Then at step S23initial m image data are ignored and the subsequent M image data are output. Step S23is repeated until the image data ends.

FIG. 9is a flow chart representing an operation of the image processing apparatus in the present embodiment. Note that this flow chart may be executed by a program recorded in a recording medium, such as a CD-ROM, a RAM, a ROM, a hard disk or a floppy disk, as will be described hereinafter.

With reference toFIG. 9, at step S101an image is extended and at step S103the extended image is halftoned. Then at step S105the extension is cut and an image to be output is produced.

FIG. 10shows a result of processing the same image asFIG. 15in the image processing apparatus of the present embodiment. In theFIG. 10example, image extension block100extends input image data by 200 pixels for the process.

As is apparent fromFIG. 10, in the present embodiment such an image contour distortion as shown inFIG. 17can be eliminated.

Second Embodiment

A second embodiment provides an image processing apparatus having a threshhold value adapted to vary with an input to further alleviate dot delay to output a good image.

More specifically in the second embodiment theFIG. 1halftoning block200is replaced by a halftoning block shown inFIG. 11. As shown inFIG. 11, in the present embodiment, an input is referred to by a threshold calculation unit207to calculate a threshold value which is in turn used by thresholding block205to provide a thresholding operation.

FIG. 12is a diagram for illustrating a threshold value calculated by theFIG. 11threshold calculation block207. As shown in the figure, threshold calculation block207outputs a threshold value in proportion to an input. More specifically, it outputs a threshold value having a relationship with an input, as represented by the following expression:
Threshold value=0.8×input+0.1

More specifically, for an input of 0, a threshold value of 0.1 is provided and for an input of 1 a threshold value of 0.9 is provided. With a threshold value varying with an input, dot delay can be alleviated to output a better image.

FIG. 13shows a result of processing an image in the present embodiment with a condition similar to that of the first embodiment as shown inFIG. 10.

Furthermore,FIG. 14shows a result of halftoning an image, as shown inFIG. 11, without extending the image. As is apparent fromFIGS. 13 and 14, simply taking an approach against dot delay cannot prevent an image from still disadvantageously having an upper left portion with a distorted contour. By contrast, the approach against dot delay plus the image extension can maintain an image contour in a good condition, as shown inFIG. 13.

Modification

FIG. 15is a block diagram showing a configuration of a computer executing a program of the present invention.

With reference to the figure, the computer includes a CPU601generally controlling the apparatus, a printer603, a display605, a local area network (LAN) card or modem card607allowing a network connection, an external communication and the like, an input unit609configured for example of a keyboard, a mouse and the like, a floppy disk drive611, a CD-ROM drive613, a hard disk drive615, a RAM617, and a ROM619.

The program represented in theFIG. 9flow chart, for driving CPU (a computer)601, can be recorded in a floppy disk F, a CD-ROM613a, or a similar recording medium. This program is sent from the recording medium to the RAM or any other recording medium and recorded therein. Note that the program may be recorded in a hard disk, a ROM, a RAM, a memory card or any other similar recording medium and thus provided to a user. Alternatively, it may be downloaded via the Internet from an external site or the like to a work station, a printer or the like and thus executed thereby.

Note that while in the above embodiments a halftoning process is provided through error diffusion, it may alternatively be provided through the threshold diffusion as described in an application disclosing an invention achieved by the present inventors, U.S. application Ser. No. 09/399,180.