JP2005252710A - Image processing apparatus, image processing method, and image processing program - Google Patents

Image processing apparatus, image processing method, and image processing program Download PDF

Info

Publication number
JP2005252710A
JP2005252710A JP2004061071A JP2004061071A JP2005252710A JP 2005252710 A JP2005252710 A JP 2005252710A JP 2004061071 A JP2004061071 A JP 2004061071A JP 2004061071 A JP2004061071 A JP 2004061071A JP 2005252710 A JP2005252710 A JP 2005252710A
Authority
JP
Japan
Prior art keywords
pixel
error
target pixel
edge
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2004061071A
Other languages
Japanese (ja)
Inventor
Tomoharu Kifuku
友晴 貴福
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Seiko Epson Corp
Original Assignee
Seiko Epson Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Seiko Epson Corp filed Critical Seiko Epson Corp
Priority to JP2004061071A priority Critical patent/JP2005252710A/en
Publication of JP2005252710A publication Critical patent/JP2005252710A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide an image processing apparatus capable of improving image quality, while suppressing the decrease in the processing speed. <P>SOLUTION: Whenever each pixel, constituting image data, is converted into data of an expression form depending on the presence or the absence of dot formation, an error diffuser 53 calculates the error value to be diffused from a target pixel to a plurality of pixels, on the basis of the error occurring in the target pixel to which conversion is executed. An error buffer 54 stores an accumulated value in which the error values calculated by the error diffuser 53 are accumulated, regarding each pixel constituting the image data. An edge-determining part 51 determines whether an edge exists between the target pixel and the pixels around the target pixel. A dot-determining part 52 determines the presence or the absence of the dot formation of the target pixel on the basis of the correction data calculated, by using the accumulated value, corresponding to the determination results of the edge-determining part 51 and the gradation value of the target pixel. <P>COPYRIGHT: (C)2005,JPO&NCIPI

Description

本発明は、画像処理装置、画像処理方法及び画像処理プログラムに関する。   The present invention relates to an image processing apparatus, an image processing method, and an image processing program.

コンピュータで形成した画像やデジタルカメラで撮影した画像等の出力装置として、印刷媒体上にインクドットを形成して画像を印刷する印刷装置が広く使用されている。インクジェットプリンタ等のこれらの印刷装置においては、局所的にはドットを形成するか否かの何れかの状態しか表現し得ないが、ドットの形成密度を適切に制御することで、階調が連続的に変化する画像を印刷することができる。このため、多階調の画像データを印刷するには、画像の濃度に応じた適切な密度でドットが形成されるようにドットの形成を制御する必要がある。   2. Description of the Related Art Printing apparatuses that form ink dots on a printing medium and print images are widely used as output apparatuses for images formed by computers and images taken by digital cameras. In these printing apparatuses such as an ink jet printer, only the state of whether or not to form dots can be expressed locally, but by controlling the dot formation density appropriately, the gradation is continuous. Images that change over time can be printed. For this reason, in order to print multi-tone image data, it is necessary to control dot formation so that dots are formed at an appropriate density according to the density of the image.

画像の濃度に応じた適切なドットの形成密度が得られるよう、ドットの形成有無を判定するための代表的な手法として、誤差拡散法と呼ばれる手法がある。誤差拡散法は、着目画素におけるドット形成の有無によって生じる誤差を、該着目画素周辺の未処理画素に拡散して記憶しておき、未処理画素においてドット形成の有無を判定する際には、周辺画素から拡散されてきた誤差を解消するようにドット形成の有無を判定する手法である。このような誤差拡散法によれば、着目画素のドット形成時に生じた誤差をそれ以降に処理する画素に分配することで、全体的な誤差を少なくすることができる。   There is a technique called an error diffusion method as a typical technique for determining the presence or absence of dot formation so that an appropriate dot formation density according to the image density can be obtained. In the error diffusion method, an error caused by the presence / absence of dot formation in a target pixel is diffused and stored in unprocessed pixels around the target pixel, and when determining the presence / absence of dot formation in the unprocessed pixel, This is a method for determining the presence or absence of dot formation so as to eliminate errors diffused from pixels. According to such an error diffusion method, it is possible to reduce the overall error by distributing the error generated when forming the dot of the target pixel to the pixels to be processed thereafter.

ところが、誤差拡散法により処理を実行すると、画像データにおいて階調値が急激に変化する部分のドット表現が不自然になる場合がある。例えば、ドット表現が疎となる低階調領域にて生じた誤差が、ドット表現が密となる高階調領域に拡散されると、高階調領域の立ち上がり部分においてドット抜けが生じたり画像の歪みが生じたりする場合がある。   However, when processing is performed by the error diffusion method, there are cases where the dot representation of the portion where the gradation value changes rapidly in the image data becomes unnatural. For example, if an error that occurs in a low gradation region where the dot representation is sparse is diffused to a high gradation region where the dot representation is dense, dot omission occurs at the rising portion of the high gradation region or image distortion occurs. May occur.

そこで、このような誤差拡散法における弊害を解消するために、種々の方法が提案されている。例えば特許文献1には、変換を行う着目画素の周囲にエッジが存在しない場合は、着目画素のドット形成の有無を判定する閾値を着目画素の階調値に応じて変動させ、エッジが存在する部分では閾値を固定する画像処理装置が提案されている。これにより、高階調領域及び低階調領域においてそれぞれの領域内の誤差拡散を緩やかに行うことができるとともに、両領域の間のエッジ部分をシャープに表現することができる。   Therefore, various methods have been proposed in order to eliminate the adverse effects of such an error diffusion method. For example, in Patent Document 1, when there is no edge around the pixel of interest to be converted, the threshold for determining the presence or absence of dot formation of the pixel of interest is changed according to the gradation value of the pixel of interest, and the edge exists. In part, an image processing apparatus that fixes a threshold value has been proposed. Thereby, in the high gradation region and the low gradation region, error diffusion in each region can be performed gently, and the edge portion between both regions can be expressed sharply.

また、特許文献2には、変換を行う画素の階調値と該画素のドット形成の有無に応じて、誤差拡散する範囲を変更する構成が提案されている。例えば、着目画素の階調値が小さく、且つドットが形成される場合には誤差拡散範囲を広げ、その他の場合には誤差拡散範囲を狭くする。これにより、着目画素に大きなマイナス誤差が生じる場合は、その拡散範囲を広くすることで、ドットが集中して形成されるのを抑制し、画像の濃淡の境目も良好に表示することができる。
特開平8−242374号公報 特開11−261818号公報
Patent Document 2 proposes a configuration in which the error diffusion range is changed according to the gradation value of the pixel to be converted and the presence or absence of dot formation of the pixel. For example, when the tone value of the pixel of interest is small and dots are formed, the error diffusion range is widened, and in other cases, the error diffusion range is narrowed. As a result, when a large negative error occurs in the pixel of interest, it is possible to suppress the formation of dots in a concentrated manner by widening the diffusion range, and to display the boundary between the shades of the image well.
JP-A-8-242374 JP 11-261818 A

しかしながら、画像データを構成する各画素の階調値やエッジの有無に応じて閾値を変動させたり、各画素の階調値及びドット形成の有無に応じて誤差拡散マトリクスを変動させたりすると、各画素の誤差拡散処理に時間がかかってしまう。また、何れの場合も画素の濃淡や周囲の画素との間の濃度勾配に従って最適な閾値や誤差拡散マトリクスを選択する必要があるが、高画質を得るためにはその処理が煩雑となり時間がかかる場合があるとともに、必ずしも良好な画質を得ることができるとは限らない場合が散見された。   However, if the threshold value is changed according to the gradation value of each pixel constituting the image data and the presence / absence of an edge, or the error diffusion matrix is changed according to the gradation value of each pixel and the presence / absence of dot formation, It takes time to perform error diffusion processing of pixels. In either case, it is necessary to select an optimal threshold value and error diffusion matrix according to the density of pixels and the density gradient between surrounding pixels. However, in order to obtain high image quality, the processing becomes complicated and takes time. In some cases, it was not always possible to obtain good image quality.

本発明は上記課題に鑑みなされたものであり、処理速度の低下を抑制しつつ画質を向上することができる画像処理装置、画像処理方法及び画像処理プログラムを提供することを目的とする。   SUMMARY An advantage of some aspects of the invention is that it provides an image processing apparatus, an image processing method, and an image processing program capable of improving image quality while suppressing a decrease in processing speed.

上記目的を達成するため、本発明は、複数の画素から構成された多階調の画像データを、ドット形成の有無による表現形式のデータに変換する画像処理装置において、前記画像データを構成する各画素をドット形成の有無による表現形式のデータに変換する度に、該変換を行う着目画素に生じる誤差に基づいて同着目画素から複数の画素へ拡散させる誤差値を算出する誤差拡散部と、前記画像データを構成する各画素について、前記誤差拡散部により算出される誤差値が累積された累積値を記憶する拡散誤差記憶部と、前記着目画素と該着目画素周辺の画素との間にエッジが存在するか否かを判定するエッジ判定部と、前記エッジ判定部の判定結果に応じて前記累積値を用いて算出した補正データと、前記着目画素の階調値とに基づき、前記着目画素のドット形成の有無を判定するドット判定部と、を備えたことを要旨とする。   In order to achieve the above object, the present invention provides an image processing apparatus for converting multi-tone image data composed of a plurality of pixels into data in an expression format depending on the presence or absence of dot formation. An error diffusion unit that calculates an error value to be diffused from the target pixel to a plurality of pixels based on an error that occurs in the target pixel that performs the conversion each time the pixel is converted into data in an expression format based on the presence or absence of dot formation; For each pixel constituting the image data, there is an edge between a diffusion error storage unit that stores a cumulative value obtained by accumulating error values calculated by the error diffusion unit, and the pixel of interest and pixels around the pixel of interest. Based on the edge determination unit that determines whether or not it exists, the correction data calculated using the cumulative value according to the determination result of the edge determination unit, and the gradation value of the pixel of interest And determining the dot determination section whether or not to form dots eye pixels, further comprising a a gist.

また、上記の画像処理装置に対応する本発明の画像処理方法は、複数の画素から構成された多階調の画像データを、ドット形成の有無による表現形式のデータに変換する画像処理方法において、前記画像データを構成する各画素をドット形成の有無による表現形式のデータに変換する度に、該変換を行う着目画素に生じる誤差に基づいて同着目画素から複数の画素へ拡散させる誤差値を算出する誤差拡散ステップと、前記画像データを構成する各画素について、前記誤差拡散ステップにより算出される誤差値が累積された累積値を記憶する拡散誤差記憶ステップと、前記着目画素と該着目画素周辺の画素との間にエッジが存在するか否かを判定するエッジ判定ステップと、前記エッジ判定ステップの判定結果に応じて前記着目画素の累積値を用いて算出した補正データと、前記着目画素の階調値とに基づき、前記着目画素のドット形成の有無を判定するドット判定ステップと、を備えたことを要旨とする。   Further, an image processing method of the present invention corresponding to the image processing apparatus described above is an image processing method for converting multi-gradation image data composed of a plurality of pixels into data in an expression format depending on the presence or absence of dot formation. Each time each pixel constituting the image data is converted into data in an expression format based on the presence or absence of dot formation, an error value for diffusing from the target pixel to a plurality of pixels is calculated based on an error generated in the target pixel that performs the conversion. An error diffusion step, a diffusion error storage step for storing a cumulative value in which the error value calculated by the error diffusion step is accumulated for each pixel constituting the image data, and the pixel of interest and the periphery of the pixel of interest An edge determination step for determining whether an edge exists between the pixel and a cumulative value of the pixel of interest according to a determination result of the edge determination step There a correction data was calculated, based on the tone value of the noted pixel, it is summarized in that with a dot judgment step of judging whether or not to form dots of the target pixel.

上述した画像処理装置及び画像処理方法によれば、変換処理を行う着目画素の周囲にエッジが存在するか否かに応じて、着目画素のドット判定の際に着目画素の階調値に加算される補正データの値が変更される。このため、着目画素の周囲にエッジが存在する場合、階調値に大きな差のある領域から拡散されてきた誤差値をあまり補正データに使用しないようにすることで、着目画素のドット形成が不自然となるのを抑制することができる。それとともに、着目画素のドット形成の際に生じる誤差値に階調値に大きな差のある領域から拡散されてきた誤差が加味されないため、着目画素から周辺の画素に不自然な誤差値を拡散させるのを抑制することができる。そして、着目画素の周囲にエッジが存在しない場合は、着目画素に周囲の画素から拡散されてきた誤差値が累積された累積値を用いてドット判定を行うことで、滑らかなドット表現とすることができる。また、着目画素の累積値を用いて算出される補正データを調整するのみで画質の向上を図ることができるため、比較的短時間で処理を行うことができる。従って、処理速度の低下を抑制しつつ画質を向上することができる。   According to the above-described image processing apparatus and image processing method, the image is added to the gradation value of the target pixel when performing dot determination of the target pixel depending on whether or not an edge exists around the target pixel to be converted. The correction data value to be changed is changed. For this reason, when there is an edge around the pixel of interest, the error value diffused from the area having a large difference in gradation value is not used in the correction data so that the dot formation of the pixel of interest is not caused. It can suppress becoming natural. At the same time, since an error diffused from a region having a large difference in gradation value is not added to an error value generated when forming a dot of the target pixel, an unnatural error value is diffused from the target pixel to surrounding pixels. Can be suppressed. When there is no edge around the pixel of interest, smooth dot expression is obtained by performing dot determination using the accumulated value in which the error value diffused from the surrounding pixels is accumulated in the pixel of interest. Can do. Further, since the image quality can be improved only by adjusting the correction data calculated using the cumulative value of the pixel of interest, the processing can be performed in a relatively short time. Therefore, it is possible to improve the image quality while suppressing a decrease in processing speed.

上述した画像処理装置において、前記ドット判定部は、前記エッジ判定部によりエッジが存在しないと判定された場合には、前記補正データに前記着目画素の累積値を加算し、前記エッジ判定部によりエッジが存在すると判定された場合には、前記補正データに前記着目画素の累積値よりも小さい値を加算することとしてもよい。   In the above-described image processing apparatus, when the edge determination unit determines that no edge exists, the dot determination unit adds the accumulated value of the pixel of interest to the correction data, and the edge determination unit If it is determined that the pixel is present, a value smaller than the accumulated value of the target pixel may be added to the correction data.

これによれば、着目画素の周囲にエッジが存在しない場合には周辺の画素から拡散されてきた誤差を反映させたドット表現とすることができる。また、エッジが存在する場合にはドット判定の際に使用されるデータにおける補正データの割合を小さくして着目画素の階調値の比重を大きくすることで、階調値に大きな差のある領域から拡散されてきた誤差値の影響を低減し、エッジを強調したドット表現とすることができる。   According to this, when there is no edge around the pixel of interest, it is possible to obtain a dot representation that reflects an error diffused from the surrounding pixels. In addition, when there is an edge, an area having a large difference in gradation value is obtained by increasing the specific gravity of the gradation value of the pixel of interest by decreasing the ratio of the correction data in the data used for dot determination. Thus, the influence of the error value diffused from the dot can be reduced, and the dot expression with the emphasized edge can be obtained.

また、上述した画像処理装置において、前記拡散誤差記憶部は、前記画像データの水平方向に拡散される誤差値が累積された累積値を記憶する水平方向用バッファと、前記画像データの垂直方向に拡散される誤差値が累積された累積値を記憶する垂直方向用バッファとを有しており、前記エッジ判定部は、前記着目画素に対して前記水平方向又は垂直方向の少なくとも何れか一方の判定方向においてエッジが存在するか否かを判定し、前記ドット判定部は、前記判定方向において、前記エッジ判定部によりエッジが存在しないと判定された場合には、前記補正データに前記拡散誤差記憶部に記憶された前記着目画素の累積値を加算し、前記エッジ判定部によりエッジが存在すると判定された場合には、前記補正データにその方向用のバッファに記憶された前記着目画素の累積値を加算しないこととしてもよい。   In the image processing apparatus described above, the diffusion error storage unit includes a horizontal buffer for storing a cumulative value in which error values diffused in the horizontal direction of the image data are accumulated, and a vertical direction of the image data. A vertical direction buffer for storing a cumulative value in which error values to be diffused are accumulated, and the edge determination unit determines at least one of the horizontal direction and the vertical direction with respect to the target pixel. It is determined whether or not there is an edge in the direction, and when the dot determination unit determines that no edge exists in the determination direction, the diffusion error storage unit is included in the correction data. When the edge determination unit determines that an edge exists, a buffer for that direction is added to the correction data. The stored cumulative value of the target pixel may be not added.

これによれば、着目画素に対して水平方向又は垂直方向の少なくとも何れか一方の判定方向においてエッジが存在するか否か判定され、その判定結果に応じてその方向用のバッファに記憶された累積値を補正データに加算するか否か変更される。このため、判定方向においてエッジが強調されたドット表現を実現するとともに、比較的簡易に補正データを変更することができ、処理速度の低下を抑制することができる。なお、着目画素に対して垂直方向とは、着目画素に対して上下方向及び斜め方向を含み、着目画素に対して水平方向ではない方向を指す。   According to this, it is determined whether or not an edge exists in at least one of the determination directions of the horizontal direction and the vertical direction with respect to the target pixel, and the accumulation stored in the buffer for the direction according to the determination result Whether the value is added to the correction data is changed. For this reason, it is possible to realize dot expression in which edges are emphasized in the determination direction, change correction data relatively easily, and suppress a decrease in processing speed. Note that the vertical direction with respect to the pixel of interest includes a vertical direction and an oblique direction with respect to the pixel of interest, and a direction that is not horizontal with respect to the pixel of interest.

更には、上述した画像処理装置において、前記拡散誤差記憶部は、前記画像データの水平方向に拡散される誤差値が累積された累積値を記憶する水平方向用バッファと、前記画像データの垂直方向に拡散される誤差値が累積された累積値を記憶する垂直方向用バッファとを有しており、前記エッジ判定部は、前記着目画素に対して前記水平方向及び垂直方向においてエッジが存在するか否かを判定し、前記ドット判定部は、前記水平方向及び垂直方向において、前記エッジ判定部によりエッジが存在しないと判定された場合には、前記補正データにその方向用のバッファに記憶された前記着目画素の累積値を加算し、前記エッジ判定部によりエッジが存在すると判定された場合には、前記補正データにその方向用のバッファに記憶された前記着目画素の累積値を加算しないこととしてもよい。   Furthermore, in the above-described image processing apparatus, the diffusion error storage unit includes a horizontal buffer for storing a cumulative value in which error values diffused in the horizontal direction of the image data are accumulated, and a vertical direction of the image data. A vertical direction buffer for storing a cumulative value in which error values to be diffused are accumulated, and whether the edge determination unit has an edge in the horizontal direction or the vertical direction with respect to the target pixel. When the edge determination unit determines that no edge exists in the horizontal direction and the vertical direction, the dot determination unit stores the correction data in the buffer for that direction. When the accumulated value of the target pixel is added and the edge determination unit determines that an edge exists, the correction data stored in the buffer for the direction is stored in the correction data. It may not adding the accumulated value of eye pixels.

これによれば、着目画素に対して水平方向及び垂直方向においてエッジが存在するか否か判定され、その判定結果に応じてその方向用のバッファに記憶された累積値を補正データに加算するか否か変更される。このため、画像データの水平方向及び垂直方向においてエッジが強調されたドット表現を実現するとともに、比較的簡易に補正データを変更することができ、処理速度の低下を抑制することができる。なお、着目画素に対して垂直方向とは、着目画素に対して上下方向及び斜め方向を含み、着目画素に対して水平方向ではない方向を指す。   According to this, it is determined whether or not there is an edge in the horizontal direction and the vertical direction with respect to the pixel of interest, and the cumulative value stored in the buffer for that direction is added to the correction data according to the determination result. No or not changed. For this reason, it is possible to realize dot expression in which edges are emphasized in the horizontal direction and the vertical direction of image data, and it is possible to change correction data relatively easily, and to suppress a decrease in processing speed. Note that the vertical direction with respect to the pixel of interest includes a vertical direction and an oblique direction with respect to the pixel of interest, and a direction that is not horizontal with respect to the pixel of interest.

また、上述した画像処理装置において、前記エッジ判定部は、前記着目画素と既処理画素との間にエッジが存在するか否かを判定することとしてもよい。
これによれば、着目画素において階調値に大きな差のある領域となる場合に、着目画素においてより適切なドット判定を行い、着目画素から拡散する誤差値をより適切な値とすることができる。
In the above-described image processing device, the edge determination unit may determine whether an edge exists between the target pixel and the processed pixel.
According to this, when the region of interest has a large difference in gradation value, more appropriate dot determination can be performed on the pixel of interest, and the error value diffused from the pixel of interest can be set to a more appropriate value. .

更には、上述した画像処理装置において、前記エッジ判定部は、前記着目画素と未処理画素との間にエッジが存在するか否かを判定することとしてもよい。
これによれば、着目画素に対して未処理の画素において階調値に大きな差のある領域となる場合に、着目画素からその領域に拡散する誤差値をより適切な値とすることができる。
Furthermore, in the above-described image processing apparatus, the edge determination unit may determine whether an edge exists between the target pixel and an unprocessed pixel.
According to this, in the case where an unprocessed pixel is a region having a large difference in gradation value with respect to the target pixel, an error value diffused from the target pixel to the region can be set to a more appropriate value.

また、上述した画像処理装置において、前記エッジ判定部は、前記着目画素と既処理画素との間でエッジ判定を行うか、前記着目画素と未処理画素との間でエッジ判定を行うか、選択可能であることとしてもよい。   In the image processing apparatus described above, the edge determination unit selects whether to perform edge determination between the target pixel and the processed pixel, or to perform edge determination between the target pixel and the unprocessed pixel. It may be possible.

これによれば、着目画素とエッジ判定をする画素を既処理画素とするか未処理画素とするか選択することで、変換を行う画像データにより適した画質や処理速度とすることができる。   According to this, by selecting whether the pixel of interest and the edge determination pixel are the processed pixels or the unprocessed pixels, the image quality and the processing speed more suitable for the image data to be converted can be obtained.

更には、上述した画像処理装置において、前記エッジ判定部は、前記水平方向及び垂直方向において、前記着目画素と既処理画素との間、及び前記着目画素と未処理画素との間にエッジが存在するか否かを判定することとしてもよい。   Further, in the above-described image processing apparatus, the edge determination unit has edges in the horizontal direction and the vertical direction between the target pixel and the processed pixel and between the target pixel and the unprocessed pixel. It is good also as determining whether to do.

これによれば、着目画素とエッジ判定をする画素を既処理画素及び未処理画素とすることで、着目画素において階調値に大きな差のある領域となる場合も着目画素に対して未処理の画素において階調値に大きな差のある領域となる場合も考慮してドット判定や誤差の拡散が行われるため、画質を向上することができる。   According to this, even if the target pixel and the pixel whose edge is determined are the processed pixel and the unprocessed pixel, the target pixel is not processed even when the target pixel becomes a region having a large difference in gradation value. Since dot determination and error diffusion are performed in consideration of the case where a pixel has a large difference in tone value, image quality can be improved.

また、上述した画像処理方法を実現する本発明の画像処理プログラムは、複数の画素から構成された多階調の画像データを、ドット形成の有無による表現形式のデータに変換する処理を制御部が実行するための画像処理プログラムであって、前記制御部が、前記画像データを構成する各画素をドット形成の有無による表現形式のデータに変換する度に、該変換を行う着目画素に生じる誤差に基づいて同着目画素から複数の画素へ拡散させる誤差値を算出する誤差拡散処理と、前記画像データを構成する各画素について、前記誤差拡散処理により算出される誤差値が累積された累積値を記憶する拡散誤差記憶処理と、前記着目画素と該着目画素周辺の画素との間にエッジが存在するか否かを判定するエッジ判定処理と、前記エッジ判定処理の判定結果に応じて前記着目画素の累積値を用いて算出した補正データと、前記着目画素の階調値とに基づき、前記着目画素のドット形成の有無を判定するドット判定処理と、を実行するためのものである。   The image processing program of the present invention that realizes the above-described image processing method is such that the control unit performs processing for converting multi-gradation image data composed of a plurality of pixels into data in an expression format depending on the presence or absence of dot formation. This is an image processing program to be executed, and each time the control unit converts each pixel constituting the image data into data in an expression format based on the presence or absence of dot formation, an error that occurs in the target pixel that performs the conversion An error diffusion process for calculating an error value to be diffused from the pixel of interest to a plurality of pixels based on the same, and a cumulative value in which the error value calculated by the error diffusion process is accumulated for each pixel constituting the image data A diffusion error storage process, an edge determination process for determining whether or not an edge exists between the target pixel and pixels around the target pixel, and a determination of the edge determination process In order to execute a dot determination process for determining whether or not a dot is formed on the target pixel based on correction data calculated using the accumulated value of the target pixel according to a result and a gradation value of the target pixel belongs to.

これによれば、上述の各種機能を実現すれば、比較的簡易な方法で着目画素の周囲に存在するエッジを反映させたドット判定がなされ、処理速度の低下を抑制しつつ画質を向上することができる。   According to this, if the various functions described above are realized, dot determination that reflects the edges around the pixel of interest is made in a relatively simple manner, and image quality is improved while suppressing a decrease in processing speed. Can do.

以下、本発明を具体化した実施の形態を図面を参照して説明する。
(装置構成)
図1は、本実施の形態に係る画像処理装置としてのプリンタの外観を示す図である。なお、同図(a)は、プリンタを正面からみた斜視図であり、同図(b)は、プリンタの概略側面図である。
DESCRIPTION OF THE PREFERRED EMBODIMENTS Embodiments embodying the present invention will be described below with reference to the drawings.
(Device configuration)
FIG. 1 is a diagram illustrating an appearance of a printer as an image processing apparatus according to the present embodiment. 1A is a perspective view of the printer as viewed from the front, and FIG. 1B is a schematic side view of the printer.

このプリンタ1は、本体2の上面右側にユーザインタフェース(UI)として機能するコントロールパネル3を供えたインクジェット式プリンタにおいて、ユーザは、このコントロールパネル3を操作することで、印刷指示等の各種の指示をプリンタ1に与えることができる。本体2の背面側には用紙供給装置4が設けられており、シートフィーダ4aにセットされた用紙、或いはロール紙支持部4bにセットされたロール紙が本体2内部に給紙される(以下、本実施の形態においては、用紙、ロール紙等の印刷媒体を単に「用紙」という)。本体2の中央に設けられたカバー5の下方には印刷機構(図示略)が設けられており、この印刷機構の作動により印刷された用紙6が本体2の前部下部に設けられた排紙口7から排出される。   The printer 1 is an ink jet printer provided with a control panel 3 functioning as a user interface (UI) on the upper right side of the main body 2. By operating the control panel 3, the user operates various instructions such as a print instruction. Can be provided to the printer 1. A paper supply device 4 is provided on the back side of the main body 2, and the paper set in the sheet feeder 4 a or the roll paper set in the roll paper support portion 4 b is fed into the main body 2 (hereinafter, referred to as “sheet feeding device”). In this embodiment, a print medium such as paper or roll paper is simply referred to as “paper”). A printing mechanism (not shown) is provided below the cover 5 provided at the center of the main body 2, and a sheet 6 printed by the operation of the printing mechanism is discharged at the lower front portion of the main body 2. It is discharged from the mouth 7.

コントロールパネル3には、表示パネル8と操作パネル9とが備えられている。表示パネル8は、液晶モニタ等の表示画面8aを有し、この表示画面8aは、例えば、用紙サイズ、用紙種類、レイアウト、写真選択、印刷枚数などを設定するための画面等の各種のメッセージ画面を表示する。操作パネル9は、電源スイッチ9a、印刷開始スイッチ9bなどの複数の操作スイッチから構成されている。   The control panel 3 includes a display panel 8 and an operation panel 9. The display panel 8 includes a display screen 8a such as a liquid crystal monitor, and the display screen 8a is, for example, various message screens such as a screen for setting a paper size, a paper type, a layout, a photo selection, a number of copies, and the like. Is displayed. The operation panel 9 includes a plurality of operation switches such as a power switch 9a and a print start switch 9b.

プリンタ1の本体2の正面右側には、記憶媒体等のメモリカード10を装着可能とするスロット11が設けられており、プリンタ1の本体2の上部には、このメモリカード10から読み込んだ画像を表示するための表示装置12が装備されている。   On the front right side of the main body 2 of the printer 1 is provided a slot 11 in which a memory card 10 such as a storage medium can be mounted. An image read from the memory card 10 is displayed on the upper portion of the main body 2 of the printer 1. A display device 12 is provided for display.

図1(b)に示すように、プリンタ1の本体2の側面下側には、USBポート21,22が設けられている。USBポート21は、例えば、プリンタ1とホスト装置としてのパーソナルコンピュータ(以下「PC」という)23とをケーブル24を介して接続する。   As shown in FIG. 1B, USB ports 21 and 22 are provided on the lower side of the main body 2 of the printer 1. The USB port 21 connects, for example, the printer 1 and a personal computer (hereinafter referred to as “PC”) 23 as a host device via a cable 24.

この場合、プリンタ1はPC23の周辺機器として機能し、ユーザは、PC23を操作して、該PC23と接続した図示しない外部記憶装置(例えばMO)に挿入される記憶媒体(例えばMOディスク)に記憶されている画像の印刷指示等をプリンタ1に与えることができる。一方、USBポート22は、例えば、プリンタ1とデジタルカメラ25とをケーブル26を介して接続する。   In this case, the printer 1 functions as a peripheral device of the PC 23, and the user operates the PC 23 and stores it in a storage medium (for example, MO disk) inserted into an external storage device (for example, MO) (not shown) connected to the PC 23. The printer 1 can be instructed to print the image that has been displayed. On the other hand, the USB port 22 connects, for example, the printer 1 and the digital camera 25 via a cable 26.

(制御部)
図2は、プリンタ1の構成を示すブロック図である。なお、図1と同様な構成部分については、同一符合を付して説明する。
(Control part)
FIG. 2 is a block diagram illustrating the configuration of the printer 1. The same components as those in FIG. 1 will be described with the same reference numerals.

本実施形態のプリンタ1は、PC23と接続される場合にはそのPC23の周辺機器として機能し、PC23と接続されない場合にはスタンドアロン型プリンタとして機能する。つまり、このプリンタ1は、PC23と接続することはなく、デジタルカメラ25と接続して印刷(いわゆるダイレクト印刷)をすることが可能であり、例えば、USBインタフェースを介してデジタルカメラ25と接続される場合には、自分がUSBホストとなり、相手側機器がUSBデバイスとなるようにする。   The printer 1 of this embodiment functions as a peripheral device of the PC 23 when connected to the PC 23, and functions as a stand-alone printer when not connected to the PC 23. In other words, the printer 1 is not connected to the PC 23 but can be connected to the digital camera 25 to perform printing (so-called direct printing). For example, the printer 1 is connected to the digital camera 25 via a USB interface. In this case, the user is a USB host and the counterpart device is a USB device.

プリンタ1は、第1のRAM31、ROM32、第2のRAM33、用紙検出センサ34、プリンタヘッド35及びCPU組込みASIC36を備えている。
第1のRAM31には、各種の記憶媒体やデジタルカメラ25から直接読み込まれたデータ(画像ファイル等)が格納される。ROM32には、後述するCPU41が処理を実行するために必要なプログラムや各種のアプリケーションプログラムが格納されている。なお、本実施形態においては、CPU41が後述するハーフトーン処理を実行するための画像処理プログラムもこのROM32に格納されている。
The printer 1 includes a first RAM 31, a ROM 32, a second RAM 33, a paper detection sensor 34, a printer head 35, and a CPU built-in ASIC 36.
The first RAM 31 stores various storage media and data (image file etc.) read directly from the digital camera 25. The ROM 32 stores programs necessary for the CPU 41 to be described later to execute processing and various application programs. In the present embodiment, the ROM 32 also stores an image processing program for the CPU 41 to execute halftone processing described later.

第2のRAM33は、CPU41が処理を実行する際のワーキングメモリとして利用される。例えば、第2のRAM33は、デジタルカメラ25から受信した印刷ジョブを記憶しておくために利用されたり、後述する画像処理の段階で生成されるデータ(印刷イメージデータ等)を一時格納しておくためのバッファとして利用されたりする。   The second RAM 33 is used as a working memory when the CPU 41 executes processing. For example, the second RAM 33 is used to store a print job received from the digital camera 25, or temporarily stores data (print image data or the like) generated at the later-described image processing stage. Or used as a buffer for

用紙検出センサ34は、プリンタ1内部に給紙される用紙のサイズ(以下「用紙サイズ」という)、及び普通紙や専用紙などの用紙の種類(以下「用紙種類」という)を光学的手法などにより検出する。   The paper detection sensor 34 detects the size of the paper fed into the printer 1 (hereinafter referred to as “paper size”) and the type of paper such as plain paper or dedicated paper (hereinafter referred to as “paper type”) by an optical method or the like. To detect.

プリンタヘッド35は、主走査方向(紙送り方向と垂直な方向)に往復移動するキャリッジ(図示略)の下端に設けられており、用紙(印刷媒体)の搬送路に対向した面に各色用のノズルを多数個有している。このプリンタヘッド35は、後述するヘッド制御回路42の制御に基づいて、主走査方向に往復移動しながら、各色のインク滴をそれぞれの色に対応したノズルから吐出することで、給紙された用紙に画像を形成する。なお、本実施形態では、プリンタヘッド35の主走査方向が画像データにおける水平方向となり、紙送り方向(副走査方向)が画像データにおける垂直方向となる。   The printer head 35 is provided at the lower end of a carriage (not shown) that reciprocates in the main scanning direction (direction perpendicular to the paper feed direction), and is provided on the surface facing the paper (print medium) conveyance path for each color. It has many nozzles. The printer head 35 ejects ink droplets of each color from the nozzles corresponding to the respective colors while reciprocating in the main scanning direction based on the control of the head control circuit 42 described later. An image is formed on. In the present embodiment, the main scanning direction of the printer head 35 is the horizontal direction in the image data, and the paper feed direction (sub-scanning direction) is the vertical direction in the image data.

CPU組込みASIC36は、制御部としてのCPU41、ヘッド制御回路42、画像処理回路43、メモリインタフェース回路(以下「メモリI/F」という)44、USBホスト回路45、ホストインタフェース回路(以下「ホストI/F」という)46及びカードインタフェース回路(以下「カードI/F」という)47を備えており、それらは内部バス48を介して相互に接続されている。この内部バス48には、上述した第1のRAM31、ROM32、用紙検出センサ34及びコントロールパネル3も接続されている。   The CPU built-in ASIC 36 includes a CPU 41 as a control unit, a head control circuit 42, an image processing circuit 43, a memory interface circuit (hereinafter referred to as “memory I / F”) 44, a USB host circuit 45, a host interface circuit (hereinafter referred to as “host I / F”). F ”) 46 and a card interface circuit (hereinafter referred to as“ card I / F ”) 47, which are connected to each other via an internal bus 48. The internal bus 48 is also connected to the first RAM 31, ROM 32, paper detection sensor 34, and control panel 3 described above.

CPU41は、ROM32に格納されているプログラムを読み出し、そのプログラムに従った処理を実行することにより、プリンタ1を統括的に制御する。例えば、CPU41は、後述する画像処理回路43での色変換処理、ハーフトーン処理及びマイクロウィーブ処理や、ヘッド制御回路42でのキャリッジモータの駆動制御を司る。   The CPU 41 reads out a program stored in the ROM 32 and executes a process according to the program, thereby comprehensively controlling the printer 1. For example, the CPU 41 controls color conversion processing, halftone processing, and microweave processing in an image processing circuit 43 described later, and carriage motor drive control in the head control circuit 42.

画像処理回路43は、色変換部、ハーフトーニング部及びマイクロウィーブ部としての機能を有している。詳述すると、色変換部は、第1のRAM31に格納されているRGBの多階調の画像データに色変換処理を施し、例えば、シアン(C)、マゼンダ(M)、イエロー(Y)、ブラック(K)、ライトシアン(LC)、ライトマゼンダ(LM)、ライトイエロー(LY)の7色の多階調の画像データを生成して、それを第2のRAM33に格納する。   The image processing circuit 43 has functions as a color conversion unit, a halftoning unit, and a microweave unit. More specifically, the color conversion unit performs color conversion processing on RGB multi-gradation image data stored in the first RAM 31, for example, cyan (C), magenta (M), yellow (Y), Multi-tone image data of seven colors of black (K), light cyan (LC), light magenta (LM), and light yellow (LY) is generated and stored in the second RAM 33.

ハーフトーニング部は、その色変換処理後の画像データにハーフトーン処理を施し、多階調の画像データを各色毎に2値化処理して表した印刷イメージデータ(色プレーン)を生成して、それを第2のRAM33に格納する。つまり、色変換処理によって得られた画像データは、階調値0から階調値255までの値をとる256階調を有するデータであるが、プリンタ1は用紙6上にドットを形成するか否かの状態しかとり得ない。そこで、ハーフトーニング部は、256階調を有する画像データをドット形成の有無により示されるデータに変換する。   The halftoning unit performs halftone processing on the image data after the color conversion processing, generates print image data (color plane) that represents multi-tone image data by binarization processing for each color, It is stored in the second RAM 33. That is, the image data obtained by the color conversion process is data having 256 gradations that take values from gradation value 0 to gradation value 255, but the printer 1 determines whether or not to form dots on the paper 6. Only the state can be taken. Therefore, the halftoning unit converts image data having 256 gradations into data indicated by the presence or absence of dot formation.

マイクロウィーブ部は、そのハーフトーン処理後の各色プレーンのラスタをノズル数、ヘッド走査回数、紙送り量等に基づき並び替えて印刷データを生成し、それを第2のRAM33に格納する。   The microweave unit rearranges the raster of each color plane after the halftone process based on the number of nozzles, the number of head scans, the paper feed amount, etc., generates print data, and stores it in the second RAM 33.

ヘッド制御回路42は、プリンタヘッド35を往復移動させるキャリッジのモータの駆動を制御するとともに、画像処理回路43で生成された各色の印刷データに基づいてインク滴の吐出の有無や、吐出するインク滴の量等を制御する。   The head control circuit 42 controls driving of a carriage motor that reciprocates the printer head 35, and whether or not ink droplets are ejected based on print data of each color generated by the image processing circuit 43, and ejected ink droplets. The amount of control is controlled.

USBホスト回路45は、ケーブル26を介してUSBデバイスとなるデジタルカメラ25等と接続され、CPU41の制御に基づいて、デジタルカメラ25とUSBの規格に従った双方向のデータ通信を行って、例えばデジタルカメラ25から印刷対象となる画像データを取得する。   The USB host circuit 45 is connected to a digital camera 25 or the like serving as a USB device via the cable 26, and performs bidirectional data communication with the digital camera 25 in accordance with the USB standard based on the control of the CPU 41. Image data to be printed is acquired from the digital camera 25.

ホストI/F46は、ケーブル24を介してPC23と接続され、CPU41の制御に基づいて、PC23と双方向のデータ通信を行って、例えばPC23から印刷対象となる画像データを取得する。   The host I / F 46 is connected to the PC 23 via the cable 24, and performs bidirectional data communication with the PC 23 based on the control of the CPU 41, and acquires image data to be printed from the PC 23, for example.

カードI/F47は、スロット11にメモリカード10が装着されたときのインタフェース回路として機能し、メモリカード10に格納された画像データをCPU41の制御に基づいてプリンタ1内部で処理可能なデータに変換する。   The card I / F 47 functions as an interface circuit when the memory card 10 is inserted into the slot 11 and converts the image data stored in the memory card 10 into data that can be processed inside the printer 1 under the control of the CPU 41. To do.

(誤差拡散処理の概要)
次に、上述した画像処理回路43に含まれるハーフトーニング部で実行する誤差拡散処理について説明する。
(Overview of error diffusion processing)
Next, an error diffusion process executed by the halftoning unit included in the image processing circuit 43 described above will be described.

図3に示すハーフトーニング部50は、画像データを構成する各画素をドット形成の有無による表現形式のデータに変換する。ハーフトーニング部50は、この変換を行う着目画素の周囲にエッジがあるか否かを判定するエッジ判定部51と、着目画素のドット形成の有無を判定するドット判定部52と、着目画素から周辺の複数の画素に拡散させる誤差値を算出する誤差拡散部53とを備える。そして、画像データを構成する各画素について、誤差拡散部53により算出される誤差値が累積された累積値は、拡散誤差記憶部としての誤差バッファ54に記憶される(拡散誤差記憶ステップ)。   The halftoning unit 50 shown in FIG. 3 converts each pixel constituting the image data into data in an expression format depending on whether or not dots are formed. The halftoning unit 50 includes an edge determination unit 51 that determines whether or not there is an edge around the pixel of interest that performs this conversion, a dot determination unit 52 that determines whether or not a pixel of interest has been formed, An error diffusion unit 53 that calculates an error value to be diffused to the plurality of pixels. The accumulated value obtained by accumulating the error values calculated by the error diffusion unit 53 for each pixel constituting the image data is stored in an error buffer 54 as a diffusion error storage unit (diffusion error storage step).

誤差バッファ54は、各画素に水平方向に拡散された誤差値のみが累積された累積値dxを記憶する水平方向用バッファ54aと、各画素に垂直方向に拡散された誤差値のみが累積された累積値dyを記憶する垂直方向用バッファ54bとを有する。なお、誤差バッファ54は第2のRAM33の一部の領域を使用することで構成されている。   The error buffer 54 stores a horizontal buffer 54a that stores a cumulative value dx in which only the error value diffused in the horizontal direction is accumulated in each pixel, and only an error value diffused in the vertical direction in each pixel. A vertical buffer 54b for storing the accumulated value dy. The error buffer 54 is configured by using a partial area of the second RAM 33.

エッジ判定部51は、変換処理を実行する着目画素と着目画素周辺の画素との間にエッジが存在するか否かを判定する(エッジ判定ステップ)。例えば、図4において「*」で示される着目画素の階調値d*と、図4においてハッチングで示される着目画素周辺の画素の階調値とを比較してその差を算出する。そして、その差が所定の閾値th1よりも大きければエッジが存在すると判定し、その差が所定の閾値th1以下であればエッジは存在しないと判定し、その結果を第2のRAM33に格納する。   The edge determination unit 51 determines whether or not an edge exists between the pixel of interest for which conversion processing is performed and pixels around the pixel of interest (edge determination step). For example, the gradation value d * of the pixel of interest indicated by “*” in FIG. 4 is compared with the gradation values of the pixels around the pixel of interest indicated by hatching in FIG. If the difference is larger than the predetermined threshold th1, it is determined that an edge is present. If the difference is equal to or smaller than the predetermined threshold th1, it is determined that there is no edge, and the result is stored in the second RAM 33.

図4に示すように、着目画素と着目画素の左右何れかに隣接する画素とを比較することで、着目画素の水平方向のエッジ判定を行うことができる。左隣の画素と比較すれば、既処理画素との間のエッジを判定することとなり、右隣の画素と比較すれば未処理画素との間のエッジを判定することとなる。また、着目画素と上下何れかに隣接する画素とを比較することで、着目画素の垂直方向のエッジ判定を行うことができる。真上の画素と比較すれば、既処理画素との間のエッジを判定することとなり、真下の画素と比較すれば未処理画素との間のエッジを判定することとなる。   As shown in FIG. 4, the edge of the target pixel in the horizontal direction can be determined by comparing the target pixel with a pixel adjacent to the left or right of the target pixel. When compared with the pixel on the left, the edge between the processed pixels is determined, and when compared with the pixel on the right, the edge between the unprocessed pixels is determined. Further, by comparing the pixel of interest with a pixel adjacent to either the upper or lower side, the edge determination in the vertical direction of the pixel of interest can be performed. When compared with the pixel immediately above, the edge between the processed pixels is determined, and when compared with the pixel immediately below, the edge between the unprocessed pixels is determined.

なお、本実施形態では着目画素に対して水平方向及び垂直方向においてエッジが存在するか否かを判定するものであり、着目画素と左隣の画素との間で水平方向のエッジ判定を行い、着目画素と真下の画素との間の垂直方向のエッジ判定を行う。   In this embodiment, it is determined whether or not there is an edge in the horizontal direction and the vertical direction with respect to the target pixel, and the horizontal edge determination is performed between the target pixel and the left adjacent pixel, Vertical edge determination between the pixel of interest and the pixel immediately below is performed.

ドット判定部52は、エッジ判定部51の判定結果に応じた補正データdcと、着目画素の階調値d*とに基づき、着目画素のドット形成の有無を判定する(ドット判定ステップ)。補正データdcは、水平方向用バッファ54aに記憶された累積値dxと、垂直方向用バッファ54bに記憶された累積値dyとを用いて算出される。   The dot determination unit 52 determines the presence / absence of dot formation of the target pixel based on the correction data dc corresponding to the determination result of the edge determination unit 51 and the gradation value d * of the target pixel (dot determination step). The correction data dc is calculated using the accumulated value dx stored in the horizontal buffer 54a and the accumulated value dy stored in the vertical buffer 54b.

ドット判定部52は、エッジ判定部51により着目画素の水平方向にエッジが存在しないと判定された場合、水平方向用バッファ54aに格納された着目画素の累積値dxを読み込んで補正データdcに加算する。また、エッジ判定部51により着目画素の垂直方向にエッジが存在しないと判定された場合、垂直方向用バッファ54bに格納された着目画素の累積値dyを読み込んで補正データdcに加算する。こうして、ドット判定部52は補正データdcを算出する。   When the edge determination unit 51 determines that there is no edge in the horizontal direction of the pixel of interest, the dot determination unit 52 reads the cumulative value dx of the pixel of interest stored in the horizontal buffer 54a and adds it to the correction data dc To do. If the edge determination unit 51 determines that no edge exists in the vertical direction of the pixel of interest, the cumulative value dy of the pixel of interest stored in the vertical buffer 54b is read and added to the correction data dc. Thus, the dot determination unit 52 calculates the correction data dc.

そして、ドット判定部52は、補正データdcと着目画素の階調値d*とを加算し、その値が所定の閾値th2よりも大きければ、着目画素にドットを形成すると判定して2値化データとして「1」データを第2のRAM33に入力する。逆に、その値が所定の閾値th2以下であれば、着目画素にドットを形成しないと判定して2値化データとして「0」データを第2のRAM33に入力する。なお、このときの閾値th2の値は、ドットを形成した画素に表現される階調値(例えば階調値が「255」)と、ドットを形成しない画素に表現される階調値(例えば階調値が「0」)との中間の階調値に設定されている。また、閾値th2は、画像データを構成する画素の階調値等により、画質向上を実現することのできる値としておくことが好ましい。   Then, the dot determination unit 52 adds the correction data dc and the gradation value d * of the pixel of interest, and if the value is larger than the predetermined threshold th2, it determines that a dot is to be formed on the pixel of interest and binarizes it. “1” data is input to the second RAM 33 as data. On the contrary, if the value is equal to or less than the predetermined threshold th2, it is determined that no dot is formed in the pixel of interest, and “0” data is input to the second RAM 33 as binarized data. Note that the value of the threshold th2 at this time is the gradation value expressed in the pixel in which the dot is formed (for example, the gradation value is “255”) and the gradation value expressed in the pixel in which the dot is not formed (for example, the gradation value). The tone value is set to an intermediate tone value from “0”). The threshold th2 is preferably set to a value that can improve image quality based on the gradation value of the pixels constituting the image data.

これによれば、変換処理を行う着目画素の周囲にエッジがあるか否かに応じて、着目画素のドット判定の際に着目画素の階調値d*に加算される補正データdcの値が変更される。具体的には、例えば、着目画素の水平方向にも垂直方向にもエッジが存在しなければ、補正データdcは「dx+dy」となり、水平方向及び垂直方向にエッジが存在すれば「0」となる。また、水平方向のみにエッジが存在すれば「dy」となり、垂直方向のみに存在すれば「dx」となる。このように、着目画素の周囲にエッジが存在する場合、階調値に大きな差のある領域から拡散されてきたデータを補正データdcに使用しないようにすることで、着目画素のドット形成が不自然となるのを抑制することができる。また、着目画素の周囲にエッジが存在しない場合は、着目画素に周囲の画素から拡散されてきた誤差値の累積値dx,dyを用いてドット判定を行うことで、滑らかなドット表現とすることができる。   According to this, the value of the correction data dc added to the gradation value d * of the target pixel at the time of dot determination of the target pixel depends on whether or not there is an edge around the target pixel to be converted. Be changed. Specifically, for example, if there is no edge in the horizontal direction or the vertical direction of the pixel of interest, the correction data dc is “dx + dy”, and if there is an edge in the horizontal direction and the vertical direction, it is “0”. . Further, if there is an edge only in the horizontal direction, it becomes “dy”, and if it exists only in the vertical direction, it becomes “dx”. As described above, when there is an edge around the pixel of interest, data that has been diffused from a region having a large difference in gradation value is not used as the correction data dc, thereby preventing dot formation of the pixel of interest. It can suppress becoming natural. In addition, when there is no edge around the pixel of interest, smooth dot expression is obtained by performing dot determination using the accumulated values dx and dy of error values diffused from the surrounding pixels to the pixel of interest. Can do.

そして、ドット判定部52は、着目画素に拡散されてきた誤差値の累積値dx,dyを読み込むか否かのみで補正データdcを調整して画質向上を図るため、例えば、着目画素の階調値d*等に応じてドット判定の閾値th2を変動させる場合と比較して、比較的短時間でドット形成の有無を判定することができる。   The dot determination unit 52 adjusts the correction data dc only by reading the accumulated error values dx and dy diffused in the pixel of interest to improve the image quality. Compared with the case where the threshold value th2 for dot determination is changed according to the value d * or the like, it is possible to determine the presence or absence of dot formation in a relatively short time.

誤差拡散部53は、ドット判定部52により着目画素のドット形成の有無を判定するときに着目画素に生じる誤差E*に基づいて、着目画素から複数の画素へ拡散させる誤差値を算出する(誤差拡散ステップ)。   The error diffusion unit 53 calculates an error value to be diffused from the target pixel to a plurality of pixels based on the error E * generated in the target pixel when the dot determination unit 52 determines the presence / absence of dot formation of the target pixel. Diffusion step).

誤差拡散部53は、ドットを形成するとき(ドット判定部52における2値化データが「1」のとき)に着目画素に表現される階調値が「255」であるとすれば、誤差E*を「d*+dc−255」とする。また、ドットを形成しないとき(ドット判定部52における2値化データが「0」のとき)に着目画素に表現される階調値が「0」であるとすれば、誤差E*を「d*+dc−0」とする。   If the gradation value expressed by the pixel of interest is “255” when the error diffusion unit 53 forms a dot (when the binarized data in the dot determination unit 52 is “1”), the error E * Is assumed to be “d * + dc-255”. If the gradation value expressed by the pixel of interest is “0” when no dot is formed (when the binarized data in the dot determination unit 52 is “0”), the error E * is set to “d”. * + Dc-0 ”.

このように、着目画素のドット形成の際に生じる誤差E*に、階調値に大きな差のある領域から拡散されてきた誤差値(例えば、水平方向にエッジが存在する場合の累積値dx)が加味されないため、着目画素から周辺の画素に不自然な誤差を拡散するのを抑制することができる。   As described above, the error value diffused from the region having a large difference in the gradation value to the error E * generated when the dot of the pixel of interest is formed (for example, the accumulated value dx when the edge exists in the horizontal direction). Therefore, it is possible to suppress the diffusion of an unnatural error from the target pixel to surrounding pixels.

誤差拡散部53は、算出された誤差E*を、例えば図5(a)に示すような所定の誤差拡散マトリクスに従って、着目画素から拡散させる誤差値を算出する。図5(a)には、「*」で示される着目画素から拡散させる誤差E*の重みを示している。例えば、着目画素の右隣の画素には、誤差E*が4/16の重みで拡散され、着目画素の真下右隣の画素については、誤差E*が2/16の重みで拡散される。   The error diffusion unit 53 calculates an error value for diffusing the calculated error E * from the pixel of interest according to a predetermined error diffusion matrix as shown in FIG. FIG. 5A shows the weight of the error E * diffused from the target pixel indicated by “*”. For example, the error E * is diffused with a weight of 4/16 to the pixel right next to the pixel of interest, and the error E * is diffused with a weight of 2/16 for the pixel immediately under the pixel of interest.

このように、誤差拡散部53により算出される誤差値は、その都度CPU41によりそれぞれの画素において累積値が算出されて誤差バッファ54に格納される。本実施形態においては、着目画素の水平方向に拡散される誤差値が累積された累積値dxが水平方向用バッファ54aに記憶され、着目画素の垂直方向に拡散される誤差値が累積された累積値dyが垂直方向用バッファ54bに記憶される。   Thus, the error value calculated by the error diffusion unit 53 is stored in the error buffer 54 by the CPU 41 calculating a cumulative value for each pixel each time. In the present embodiment, a cumulative value dx in which error values diffused in the horizontal direction of the pixel of interest are accumulated is stored in the horizontal buffer 54a, and an accumulation of error values diffused in the vertical direction of the pixel of interest is accumulated. The value dy is stored in the vertical buffer 54b.

一方、図5(a)に示す誤差拡散マトリクスにて誤差拡散を行う場合、着目画素には図5(b)にa〜gで示す画素(以下「画素a〜g」という)から誤差値が拡散されている。そして、「*」で示される着目画素について、画素a〜cから拡散されてきた誤差値の累積値dyは垂直方向用バッファ54bに格納されており、画素d〜gから拡散されてきた誤差値の累積値dxは水平方向用バッファ54aに格納されている。水平方向用バッファ54a及び垂直方向用バッファ54bには、画像データを構成する各画素について、このように誤差値が累積された累積値dx,dyがそれぞれ格納されている。   On the other hand, when error diffusion is performed using the error diffusion matrix shown in FIG. 5A, the target pixel has an error value from the pixels indicated by a to g in FIG. 5B (hereinafter referred to as “pixels a to g”). Has been spread. For the target pixel indicated by “*”, the accumulated value dy of the error value diffused from the pixels a to c is stored in the vertical buffer 54b, and the error value diffused from the pixels d to g. Is stored in the horizontal buffer 54a. In the horizontal buffer 54a and the vertical buffer 54b, accumulated values dx and dy in which error values are accumulated in this way are stored for each pixel constituting the image data.

ここで、本実施形態におけるエッジ部分の誤差拡散について具体的に説明する。
図6(a)に「*」で示される着目画素には、垂直方向には画素a〜cから誤差値が拡散されており、垂直方向用バッファ54bにはこれらの画素から拡散されてきた誤差値の累積値dyが格納されている。また、着目画素には、水平方向には画素d〜gから誤差値が拡散されており、水平方向用バッファ54aにはこれらの画素から拡散されてきた誤差値の累積値dxが格納されている。そして、着目画素からは、図5(a)に示す誤差拡散マトリクスに従って、水平方向に右方向4つの画素d´〜g´に、垂直方向下方に3つの画素a´〜c´に誤差が拡散される。
Here, the error diffusion of the edge portion in the present embodiment will be specifically described.
In the pixel of interest indicated by “*” in FIG. 6A, error values are diffused from the pixels a to c in the vertical direction, and errors diffused from these pixels in the vertical buffer 54b. A cumulative value dy of values is stored. Further, in the target pixel, error values are diffused from the pixels d to g in the horizontal direction, and the accumulated value dx of error values diffused from these pixels is stored in the horizontal buffer 54a. . Then, according to the error diffusion matrix shown in FIG. 5A, errors are diffused from the target pixel to the four pixels d ′ to g ′ in the right direction and to the three pixels a ′ to c ′ in the lower direction in the vertical direction. Is done.

図6(b)に示すように「*1」で示される着目画素と着目画素の左隣の画素との間にエッジが存在すると、エッジ判定部51は水平方向にエッジが存在すると判定する。そして、その判定結果に応じて、ドット判定部52は垂直方向用バッファ54bのみから誤差値の累積値dyを読み込み、補正データdcを累積値dyとしてドット判定を行う。このように、着目画素と大きな階調値の差のある領域に存在する画素d〜gから拡散される誤差値は着目画素のドット判定に使用されないため、着目画素のドット判定が不自然となるのを抑制することができる。   As illustrated in FIG. 6B, when an edge exists between the target pixel indicated by “* 1” and the pixel adjacent to the left of the target pixel, the edge determination unit 51 determines that an edge exists in the horizontal direction. Then, according to the determination result, the dot determination unit 52 reads the accumulated error value dy from only the vertical buffer 54b, and performs dot determination using the correction data dc as the accumulated value dy. As described above, since the error value diffused from the pixels d to g existing in the region having a large gradation value difference from the target pixel is not used for the dot determination of the target pixel, the dot determination of the target pixel becomes unnatural. Can be suppressed.

また、着目画素から拡散させる誤差値を算出する際には、画素d〜gから拡散されてきた誤差値は加味されないため、階調値が大きく異なる領域からの誤差値を含んで着目画素から誤差拡散するのを抑制することができ、着目画素以降に変換される画素のドット表現が不自然となるのを抑制することができる。   In addition, when calculating the error value to be diffused from the pixel of interest, the error value diffused from the pixels d to g is not taken into account, and therefore, the error value from the region of interest including an error value from a region having a greatly different gradation value is included. It is possible to suppress the diffusion, and it is possible to suppress an unnatural dot expression of a pixel converted after the pixel of interest.

このように、着目画素と既処理画素との間においてエッジ判定を行う場合、着目画素において階調値に大きな差のある領域となる場合に、着目画素においてより適切なドット判定を行い、着目画素から拡散させる誤差値をより適切な値とすることができる。   As described above, when performing edge determination between the target pixel and the processed pixel, if the target pixel is a region having a large difference in gradation value, more appropriate dot determination is performed on the target pixel, and the target pixel is determined. The error value to be diffused from can be set to a more appropriate value.

一方、図6(c)に示すように「*2」で示される着目画素と着目画素の真下の画素との間にエッジが存在すると、エッジ判定部51は垂直方向にエッジが存在すると判定する。そして、その判定結果に応じて、ドット判定部52は水平方向用バッファ54aのみから誤差値の累積値dxを読み込み、補正データdcを累積値dxとしてドット判定を行う。   On the other hand, as shown in FIG. 6C, when an edge exists between the target pixel indicated by “* 2” and the pixel directly below the target pixel, the edge determination unit 51 determines that an edge exists in the vertical direction. . Then, according to the determination result, the dot determination unit 52 reads the accumulated error value dx from only the horizontal buffer 54a, and performs dot determination using the correction data dc as the accumulated value dx.

その後、着目画素から拡散させる誤差値を算出する際には、画素a〜cから拡散されてきた誤差値は加味されないため、階調値が大きく異なる領域からの誤差値を含んで着目画素から誤差拡散するのを抑制することができ、着目画素以降に変換される画素のドット表現が不自然となるのを抑制することができる。   After that, when calculating the error value to be diffused from the pixel of interest, the error value diffused from the pixels a to c is not taken into consideration, and therefore, the error value from the pixel of interest including the error value from the region having greatly different gradation values is included. It is possible to suppress the diffusion, and it is possible to suppress an unnatural dot expression of a pixel converted after the pixel of interest.

このように、着目画素と未処理画素との間においてエッジ判定を行う場合、着目画素と未処理の画素において階調値に大きな差のある領域となる場合に、着目画素からその領域に拡散させる誤差値をより適切な値をすることができる。   As described above, when edge determination is performed between the target pixel and the unprocessed pixel, if the target pixel and the unprocessed pixel are in a region having a large difference in gradation value, the target pixel is diffused to the region. The error value can be a more appropriate value.

従って、水平方向において着目画素と既処理画素との間でエッジ判定を行い、垂直方向において着目画素と未処理画素との間でエッジ判定を行うことにより、着目画素と既処理画素との間にエッジが存在する場合も、着目画素と未処理画素との間にエッジが存在する場合も反映され、画像データ全体でバランスのよいドット表現とすることができる。   Therefore, the edge determination is performed between the target pixel and the processed pixel in the horizontal direction, and the edge determination is performed between the target pixel and the unprocessed pixel in the vertical direction. Even when an edge exists, a case where an edge exists between a pixel of interest and an unprocessed pixel is reflected, and a dot expression with a good balance can be achieved in the entire image data.

次に、画像処理回路43(ハーフトーニング部50)が実行する誤差拡散処理の流れを説明する。
図7に示すように、先ず、ハーフトーニング部50は、画像データのラスタを読み込む(ステップ100)。このとき、本実施形態においては図5(a)に示す誤差拡散マトリクスを用いて誤差拡散を行うため、2ラスタを読み込むようにする。
Next, the flow of error diffusion processing executed by the image processing circuit 43 (halftoning unit 50) will be described.
As shown in FIG. 7, first, the halftoning unit 50 reads a raster of image data (step 100). At this time, in this embodiment, since error diffusion is performed using the error diffusion matrix shown in FIG. 5A, two rasters are read.

そして、エッジ判定部51がラスタの画素を読み込む(ステップ110)。次いで、その画素(着目画素)と着目画素の左隣の画素との間にエッジが存在するか否かを判定する(ステップ120)。左隣の画素との間にエッジが存在しないと判定されれば(ステップ120,NO)、ドット判定部52が水平方向用バッファ54aから累積値dxを読み込み、補正データdcに加算する(ステップ130)。   Then, the edge determination unit 51 reads raster pixels (step 110). Next, it is determined whether or not an edge exists between the pixel (target pixel) and a pixel adjacent to the left of the target pixel (step 120). If it is determined that there is no edge between the pixel on the left (NO in step 120), the dot determination unit 52 reads the accumulated value dx from the horizontal buffer 54a and adds it to the correction data dc (step 130). ).

また、エッジが存在すると判定されれば(ステップ120,YES)、次に、エッジ判定部51が着目画素と着目画素の真下の画素との間にエッジが存在するか否かを判定する(ステップ140)。真下の画素との間にエッジが存在しないと判定されれば(ステップ140,NO)、ドット判定部52が垂直方向用バッファ54bから累積値dyを読み込み、補正データdcに加算する(ステップ150)。   If it is determined that an edge exists (step 120, YES), then the edge determination unit 51 determines whether an edge exists between the pixel of interest and the pixel immediately below the pixel of interest (step) 140). If it is determined that there is no edge between the pixel immediately below (step 140, NO), the dot determination unit 52 reads the accumulated value dy from the vertical buffer 54b and adds it to the correction data dc (step 150). .

また、エッジが存在すると判定されれば(ステップ140,YES)、次に、ドット判定部52が着目画素のドット判定を行う(ステップ160)。その後、誤差拡散部53が着目画素から拡散させる誤差値を算出する(ステップ170)。このとき、着目画素から水平方向に拡散される誤差値は、各画素について水平方向用バッファ54aに記憶された累積値dxに加算される。また、垂直方向に拡散される誤差値は、各画素について垂直方向用バッファ54bに記憶された累積値dyに加算される。   If it is determined that there is an edge (step 140, YES), then the dot determination unit 52 performs dot determination for the pixel of interest (step 160). Thereafter, the error diffusion unit 53 calculates an error value to be diffused from the pixel of interest (step 170). At this time, the error value diffused in the horizontal direction from the pixel of interest is added to the accumulated value dx stored in the horizontal buffer 54a for each pixel. The error value diffused in the vertical direction is added to the accumulated value dy stored in the vertical buffer 54b for each pixel.

次いで、着目画素はラスタにおいて右端の画素か、即ち処理中のラスタを構成するすべての画素について変換処理を行ったか否かを判定し(ステップ180)、右端の画素でなければ(ステップ180,NO)、ステップ110に戻って続く一連の処理を行う。   Next, it is determined whether the pixel of interest is the rightmost pixel in the raster, that is, whether or not conversion processing has been performed for all the pixels constituting the raster being processed (step 180), and if it is not the rightmost pixel (step 180, NO). ), Returning to step 110 and performing a series of subsequent processes.

また、ラスタにおいて右端の画素であれば(ステップ180,YES)、ラスタが下端であるか、即ち画像データを構成するすべてのラスタについて処理を行ったか判定し(ステップ190)、未処理のラスタが残っていれば(ステップ190,NO)、ステップ100まで戻って続く一連の処理を行う。ここで、下端のラスタであると判定されれば(ステップ190,YES)、一連の処理を終了する。   If it is the rightmost pixel in the raster (step 180, YES), it is determined whether the raster is at the lower end, that is, whether all rasters constituting the image data have been processed (step 190). If it remains (NO in step 190), the process returns to step 100 and a series of processes are performed. Here, if it is determined that the raster is the lower end raster (step 190, YES), the series of processing ends.

実際に、上記のプリンタ1により画像データを印刷した。
図8(a)に示すように、画像データは、上側略半分が階調値の高い領域(ドット形成が密となる領域)とされ、下側略半分が階調値の低い領域(ドット形成が疎となる領域)とされている。図8(b)には、本実施形態のプリンタ1による出力画像を示す。図8(c)には、ハーフトーニング部において、画像データを構成する画素についてエッジ判定を行わずに誤差拡散処理を施す従来のプリンタによる出力画像を示す。
Actually, the image data was printed by the printer 1 described above.
As shown in FIG. 8A, the upper half of the image data is an area with a high gradation value (area where the dot formation is dense), and the lower half is an area with a low gradation value (dot formation). Is a sparse area). FIG. 8B shows an output image by the printer 1 of the present embodiment. FIG. 8C shows an output image by a conventional printer that performs error diffusion processing without performing edge determination on the pixels constituting the image data in the halftoning unit.

従来のプリンタによれば、ドットは、下側の領域において、上側の領域との境界部分(エッジ部分)に、ドットが形成されない部分が発生した。即ち、下側の領域の立ち上がり部分にドット形成の遅れが生じた。   According to a conventional printer, in the lower region, a portion where no dot is formed occurs at a boundary portion (edge portion) with the upper region. That is, a dot formation delay occurred at the rising portion of the lower region.

しかし、本発明に係るプリンタ1によれば、下側の領域の前記エッジ部分も、良好にドットが形成された。つまり、下側の領域の立ち上がり部分におけるドット形成の立ち上がりの遅れが抑制されることが確認された。   However, according to the printer 1 according to the present invention, dots were well formed at the edge portion in the lower region. That is, it was confirmed that the delay of the dot formation rise at the rising portion of the lower region is suppressed.

以上記述したように、本実施形態によれば、以下の効果を奏する。
(1)着目画素の周囲にエッジが存在するか否かに応じて、着目画素のドット判定の際に着目画素の階調値d*に加算される補正データdcが変更される。このため、エッジが存在する場合には、階調値の大きく異なる領域から拡散されてきた誤差値は補正データdcにあまり加味しないようにすることで、着目画素のドット形成が不自然となるのを抑制することができる。また、着目画素から拡散させる誤差値には、階調値の大きく異なる領域から拡散されてきた誤差値が加味されないため、着目画素以降に処理される画素のドット形成が不自然となるのを抑制することができる。
As described above, according to the present embodiment, the following effects can be obtained.
(1) The correction data dc to be added to the gradation value d * of the target pixel is changed in determining the dot of the target pixel depending on whether or not an edge exists around the target pixel. For this reason, in the case where there is an edge, the error value diffused from the region having greatly different gradation values is not added to the correction data dc so that the dot formation of the pixel of interest becomes unnatural. Can be suppressed. In addition, the error value diffused from the region with greatly different gradation values is not taken into account in the error value diffused from the pixel of interest, so that it is possible to suppress unnatural dot formation for pixels processed after the pixel of interest. can do.

(2)誤差バッファ54は、水平方向用バッファ54aと垂直方向用バッファ54bとを有しており、水平方向用バッファ54aには水平方向に拡散される誤差値の累積値dxが、垂直方向用バッファ54bには垂直方向に拡散される誤差値の累積値dyが記憶されている。このため、画像データの水平方向及び垂直方向でエッジ判定を行い、その結果に応じて累積値dx,dyを用いて補正データdcを算出することができる。従って、画像データの水平方向及び垂直方向におけるエッジの存在が加味されて補正データdcの調整がなされ、画質の向上を図ることができるとともに、比較的簡易に補正データdcを変更することができ、処理速度の低下を抑制することができる。   (2) The error buffer 54 includes a horizontal buffer 54a and a vertical buffer 54b. In the horizontal buffer 54a, an accumulated value dx of error values diffused in the horizontal direction is used for the vertical direction. The buffer 54b stores a cumulative value dy of error values diffused in the vertical direction. For this reason, it is possible to perform edge determination in the horizontal direction and vertical direction of the image data, and to calculate the correction data dc using the accumulated values dx and dy according to the result. Accordingly, the correction data dc is adjusted by taking into account the presence of edges in the horizontal and vertical directions of the image data, the image quality can be improved, and the correction data dc can be changed relatively easily. A reduction in processing speed can be suppressed.

(3)エッジ判定部51は、水平方向において着目画素と既処理画素との間でエッジ判定を行い、垂直方向において着目画素と未処理画素との間でエッジ判定を行う。このため、着目画素において階調値に大きな差のある領域となる場合も着目画素の未処理の画素において階調値に大きな差のある領域となる場合も考慮してドット判定や誤差の拡散が行われるため、画質を向上することができる。   (3) The edge determination unit 51 performs edge determination between the target pixel and the processed pixel in the horizontal direction, and performs edge determination between the target pixel and the unprocessed pixel in the vertical direction. For this reason, dot determination and error diffusion are performed in consideration of a case where the target pixel is a region having a large difference in gradation value and a case where an unprocessed pixel of the target pixel is a region having a large difference in gradation value. As a result, the image quality can be improved.

なお、実施の形態は、上記に限定されず以下の変形例を採用することもできる。
(変形例1)エッジ判定部51は、画像データの水平方向又は垂直方向の何れか一方のみのエッジ判定を行うようにしてもよい。その場合、エッジが存在すれば、エッジを判定した方向のバッファ(水平方向用バッファ54a又は垂直方向用バッファ54b)から誤差値の累積値を取り込まないようにすればよい。そうすると、判定方向でエッジを加味した誤差拡散処理が行われるためある程度は画質を向上することができるとともに、両方の方向においてエッジを加味する場合と比較して変換処理を高速化することができる。
Note that the embodiment is not limited to the above, and the following modifications may be employed.
(Modification 1) The edge determination unit 51 may perform edge determination in only one of the horizontal direction and the vertical direction of image data. In this case, if there is an edge, the accumulated error value may not be fetched from the buffer (horizontal buffer 54a or vertical buffer 54b) in the direction in which the edge is determined. As a result, the error diffusion process with the edge in the determination direction is performed, so that the image quality can be improved to some extent, and the conversion process can be speeded up as compared with the case where the edge is added in both directions.

(変形例2)エッジ判定部51がエッジ判定する際に、着目画素の階調値と着目画素周辺画素の階調値との差と比較する閾値th1は、どのような値に設定してもよい。
(変形例3)着目画素に対してエッジ判定する画素は、着目画素の左側の画素や真下の画素に限定されない。例えば、図9(a)に示すように「*3」で示す着目画素と右隣の画素との間のエッジを判定し、着目画素の右隣の画素との間にエッジがあれば画素d〜gから拡散されてきた誤差値をドット判定に加算しないようにしてもよい。また、図9(b)に示すように「*4」で示す着目画素と真上の画素との間のエッジを判定し、着目画素の真上の画素との間にエッジがあれば画素a〜cから拡散されてきた誤差値をドット判定に加算しないようにしてもよい。
(Modification 2) When the edge determination unit 51 determines an edge, the threshold th1 for comparing with the difference between the gradation value of the pixel of interest and the gradation value of the pixel around the pixel of interest is set to any value. Good.
(Modification 3) The pixel for which the edge is determined with respect to the target pixel is not limited to the pixel on the left side or the pixel directly below the target pixel. For example, as shown in FIG. 9A, the edge between the target pixel indicated by “* 3” and the right adjacent pixel is determined, and if there is an edge between the right adjacent pixel of the target pixel, the pixel d The error value diffused from ~ g may not be added to the dot determination. Further, as shown in FIG. 9B, the edge between the pixel of interest indicated by “* 4” and the pixel immediately above is determined, and if there is an edge between the pixel immediately above the pixel of interest and the pixel a The error value diffused from ~ c may not be added to the dot determination.

(変形例4)着目画素に対してエッジ判定される画素を、既処理画素のみとしてもよいし、未処理画素のみとしてもよい。
(変形例5)着目画素に対してエッジ判定を行う画素を、既処理画素又は未処理画素の何れか一方に変更できるようにしてもよい。例えば、着目画素がエッジを過ぎるまでは未処理画素との間でエッジ判定を行い(図6(c)及び図9(a)参照)、エッジを過ぎると既処理画素との間でエッジ判定を行う(図6(b)及び図9(b)参照)ようにしてもよい。そうすると、着目画素と未処理画素との間にエッジが存在すると着目画素からエッジを越えて未処理の画素に拡散される誤差が調整され、着目画素がエッジを越えると既処理画素から拡散されてきた誤差の読み込みが調整される。このため、エッジ部分の画質を向上することができる。
(Variation 4) The pixel whose edge is determined for the pixel of interest may be only a processed pixel or only an unprocessed pixel.
(Modification 5) The pixel that performs edge determination on the pixel of interest may be changed to either a processed pixel or an unprocessed pixel. For example, until the target pixel passes the edge, the edge determination is performed with the unprocessed pixel (see FIGS. 6C and 9A), and when the target pixel passes the edge, the edge determination is performed with the processed pixel. This may be performed (see FIG. 6B and FIG. 9B). Then, if there is an edge between the target pixel and the unprocessed pixel, the error diffused from the target pixel to the unprocessed pixel beyond the edge is adjusted, and if the target pixel exceeds the edge, the error is diffused from the processed pixel. The error reading is adjusted. For this reason, the image quality of the edge portion can be improved.

(変形例6)着目画素の周囲のエッジを判定する際、着目画素と比較するのは必ずしも1画素としなくてもよく、複数の画素と比較してエッジを判定してもよい。
(変形例7)ドット判定部52がドット判定する際に、着目画素の階調値d*と補正データdcとを加算した値と比較する閾値th2は、どのような値に設定してもよい。
(Modification 6) When the edge around the pixel of interest is determined, the comparison with the pixel of interest does not necessarily have to be one pixel, and the edge may be determined by comparing with a plurality of pixels.
(Modification 7) When the dot determination unit 52 performs dot determination, the threshold th2 for comparison with the value obtained by adding the gradation value d * of the target pixel and the correction data dc may be set to any value. .

(変形例8)誤差拡散部53が誤差を拡散させる際に使用する誤差拡散マトリクスは、どのような態様のものを用いてもよい。
(変形例9)誤差拡散部53が誤差を拡散させる際に使用する誤差拡散マトリクスを、所定の条件により変更するようにしてもよい。例えば、着目画素と未処理画素との間のエッジを判定する場合には、エッジが存在する方向において誤差を拡散しないように誤差拡散マトリクスを変更してもよい。その場合、図10(a)に示すように、「*5」で示される着目画素に対して水平方向にエッジが存在する場合には、画素d´〜g´に誤差を拡散させないようにする。また、図10(b)に示すように、「*6」で示される着目画素に対して垂直方向にエッジが存在する場合には、画素a´〜c´に誤差を拡散させないようにする。
(Modification 8) The error diffusion matrix used when the error diffusion unit 53 diffuses an error may have any form.
(Modification 9) The error diffusion matrix used when the error diffusion unit 53 diffuses an error may be changed according to a predetermined condition. For example, when determining an edge between a target pixel and an unprocessed pixel, the error diffusion matrix may be changed so that the error is not diffused in the direction in which the edge exists. In this case, as shown in FIG. 10A, when an edge exists in the horizontal direction with respect to the target pixel indicated by “* 5”, the error is not diffused to the pixels d ′ to g ′. . As shown in FIG. 10B, when an edge exists in the vertical direction with respect to the target pixel indicated by “* 6”, the error is not diffused to the pixels a ′ to c ′.

(変形例10)拡散誤差記憶部を水平方向用バッファ54aと垂直方向用バッファ54bとを有するものとせず、各画素に拡散されてくる誤差値の累積値を方向に関わらず記憶するものとしてもよい。その場合の補正データdcの算出は、例えば拡散誤差記憶部に格納された誤差値の累積値を所定の比率に低減するようにして行うことができる。   (Modification 10) The diffusion error storage unit does not have the horizontal buffer 54a and the vertical buffer 54b, and stores the accumulated error value diffused in each pixel regardless of the direction. Good. In this case, the correction data dc can be calculated, for example, by reducing the cumulative value of error values stored in the diffusion error storage unit to a predetermined ratio.

(変形例11)コントロールパネル3を操作して着目画素と既処理画素との間のエッジを判定するか又は着目画素と未処理との間のエッジを判定するか選択可能としてもよい。
(変形例12)第2のRAM33のみではなく第1のRAM31の所定領域も誤差バッファ54として使用するようにしてもよい。そうすると、プリンタ1のメモリ領域を有効に使用することができる。
(Modification 11) The control panel 3 may be operated to determine whether the edge between the target pixel and the processed pixel is determined, or whether the edge between the target pixel and the unprocessed pixel is determined.
(Modification 12) Not only the second RAM 33 but also a predetermined area of the first RAM 31 may be used as the error buffer 54. Then, the memory area of the printer 1 can be used effectively.

(変形例13)本発明に係る画像処理装置としてプリンタ1に適用した場合について説明したが、液晶表示装置における画像処理等に適用してもよい。   (Modification 13) Although the case where the image processing apparatus according to the present invention is applied to the printer 1 has been described, it may be applied to image processing or the like in a liquid crystal display device.

本発明を具体化した実施の形態に係るプリンタの概略図であり、(a)は正面からみたプリンタの斜視図、(b)は概略側面図。1A and 1B are schematic views of a printer according to an embodiment of the present invention, in which FIG. 1A is a perspective view of the printer as viewed from the front, and FIG. プリンタの構成を示すブロック図。FIG. 2 is a block diagram illustrating a configuration of a printer. ハーフトーニング部の構成を示すブロック図。The block diagram which shows the structure of a halftoning part. 着目画素に対する周辺画素の説明図。Explanatory drawing of the surrounding pixel with respect to the focused pixel. (a)は誤差拡散マトリクスの説明図、(b)は着目画素に誤差を拡散する画素の説明図。(A) is explanatory drawing of an error diffusion matrix, (b) is explanatory drawing of the pixel which diffuses an error to the attention pixel. (a)〜(c)は着目画素に誤差を拡散する画素、及び着目画素から誤差を拡散する画素の説明図。(A)-(c) is explanatory drawing of the pixel which diffuses an error to the attention pixel, and the pixel which diffuses an error from the attention pixel. 誤差拡散処理を説明するフローチャート。10 is a flowchart for explaining error diffusion processing. (a)は多階調の画像データ、(b),(c)は(a)の出力画像。(A) is multi-tone image data, and (b) and (c) are output images of (a). (a),(b)は変形例の説明図。(A), (b) is explanatory drawing of a modification. (a),(b)は変形例の説明図。(A), (b) is explanatory drawing of a modification.

符号の説明Explanation of symbols

1…画像処理装置としてのプリンタ、51…エッジ判定部、52…ドット判定部、53…誤差拡散部、54…拡散誤差記憶部としての誤差バッファ、54a…水平方向用バッファ、54b…垂直方向用バッファ、dc…補正データ、dx…累積値、dy…累積値、E*…誤差。   DESCRIPTION OF SYMBOLS 1 ... Printer as image processing apparatus, 51 ... Edge determination part, 52 ... Dot determination part, 53 ... Error diffusion part, 54 ... Error buffer as diffusion error storage part, 54a ... Horizontal direction buffer, 54b ... Vertical direction Buffer, dc ... correction data, dx ... accumulated value, dy ... accumulated value, E * ... error.

Claims (10)

複数の画素から構成された多階調の画像データを、ドット形成の有無による表現形式のデータに変換する画像処理装置において、
前記画像データを構成する各画素をドット形成の有無による表現形式のデータに変換する度に、該変換を行う着目画素に生じる誤差に基づいて同着目画素から複数の画素へ拡散させる誤差値を算出する誤差拡散部と、
前記画像データを構成する各画素について、前記誤差拡散部により算出される誤差値が累積された累積値を記憶する拡散誤差記憶部と、
前記着目画素と該着目画素周辺の画素との間にエッジが存在するか否かを判定するエッジ判定部と、
前記エッジ判定部の判定結果に応じて前記累積値を用いて算出した補正データと、前記着目画素の階調値とに基づき、前記着目画素のドット形成の有無を判定するドット判定部と、
を備えた画像処理装置。
In an image processing device that converts multi-gradation image data composed of a plurality of pixels into data in an expression format depending on the presence or absence of dot formation,
Each time each pixel constituting the image data is converted into data in an expression format based on the presence or absence of dot formation, an error value for diffusing from the target pixel to a plurality of pixels is calculated based on an error generated in the target pixel that performs the conversion. An error diffusion unit to
For each pixel constituting the image data, a diffusion error storage unit that stores a cumulative value obtained by accumulating error values calculated by the error diffusion unit;
An edge determination unit that determines whether an edge exists between the target pixel and pixels around the target pixel;
A dot determination unit that determines the presence or absence of dot formation of the pixel of interest based on the correction data calculated using the cumulative value according to the determination result of the edge determination unit and the gradation value of the pixel of interest;
An image processing apparatus.
請求項1に記載の画像処理装置において、前記ドット判定部は、前記エッジ判定部によりエッジが存在しないと判定された場合には、前記補正データに前記着目画素の累積値を加算し、前記エッジ判定部によりエッジが存在すると判定された場合には、前記補正データに前記着目画素の累積値よりも小さい値を加算する画像処理装置。   The image processing apparatus according to claim 1, wherein when the edge determination unit determines that no edge exists, the dot determination unit adds a cumulative value of the pixel of interest to the correction data, and the edge determination unit An image processing apparatus that adds a value smaller than a cumulative value of the pixel of interest to the correction data when the determination unit determines that an edge is present. 請求項1又は2に記載の画像処理装置において、前記拡散誤差記憶部は、前記画像データの水平方向に拡散される誤差値が累積された累積値を記憶する水平方向用バッファと、前記画像データの垂直方向に拡散される誤差値が累積された累積値を記憶する垂直方向用バッファとを有しており、
前記エッジ判定部は、前記着目画素に対して前記水平方向又は垂直方向の少なくとも何れか一方の判定方向においてエッジが存在するか否かを判定し、
前記ドット判定部は、前記判定方向において、前記エッジ判定部によりエッジが存在しないと判定された場合には、前記補正データに前記拡散誤差記憶部に記憶された前記着目画素の累積値を加算し、前記エッジ判定部によりエッジが存在すると判定された場合には、前記補正データにその方向用のバッファに記憶された前記着目画素の累積値を加算しない画像処理装置。
3. The image processing apparatus according to claim 1, wherein the diffusion error storage unit stores a cumulative value in which an error value diffused in a horizontal direction of the image data is accumulated, and the image data. A vertical buffer for storing a cumulative value in which error values diffused in the vertical direction are accumulated,
The edge determination unit determines whether or not an edge exists in at least one of the horizontal direction and the vertical direction with respect to the target pixel;
The dot determination unit adds the accumulated value of the pixel of interest stored in the diffusion error storage unit to the correction data when the edge determination unit determines that no edge exists in the determination direction. An image processing apparatus that does not add the cumulative value of the pixel of interest stored in the buffer for the direction to the correction data when the edge determination unit determines that an edge exists.
請求項1又は2に記載の画像処理装置において、前記拡散誤差記憶部は、前記画像データの水平方向に拡散される誤差値が累積された累積値を記憶する水平方向用バッファと、前記画像データの垂直方向に拡散される誤差値が累積された累積値を記憶する垂直方向用バッファとを有しており、
前記エッジ判定部は、前記着目画素に対して前記水平方向及び垂直方向においてエッジが存在するか否かを判定し、
前記ドット判定部は、前記水平方向及び垂直方向において、前記エッジ判定部によりエッジが存在しないと判定された場合には、前記補正データにその方向用のバッファに記憶された前記着目画素の累積値を加算し、前記エッジ判定部によりエッジが存在すると判定された場合には、前記補正データにその方向用のバッファに記憶された前記着目画素の累積値を加算しない画像処理装置。
3. The image processing apparatus according to claim 1, wherein the diffusion error storage unit stores a cumulative value in which an error value diffused in a horizontal direction of the image data is accumulated, and the image data. A vertical buffer for storing a cumulative value in which error values diffused in the vertical direction are accumulated,
The edge determination unit determines whether an edge exists in the horizontal direction and the vertical direction with respect to the target pixel,
The dot determination unit, when the edge determination unit determines that no edge exists in the horizontal direction and the vertical direction, the accumulated value of the target pixel stored in the buffer for the direction in the correction data When the edge determination unit determines that an edge exists, the image processing apparatus does not add the cumulative value of the pixel of interest stored in the buffer for the direction to the correction data.
請求項1〜4のうち何れか1項に記載の画像処理装置において、前記エッジ判定部は、前記着目画素と既処理画素との間にエッジが存在するか否かを判定する画像処理装置。   5. The image processing apparatus according to claim 1, wherein the edge determination unit determines whether an edge exists between the target pixel and a processed pixel. 6. 請求項1〜4のうち何れか1項に記載の画像処理装置において、前記エッジ判定部は、前記着目画素と未処理画素との間にエッジが存在するか否かを判定する画像処理装置。   5. The image processing apparatus according to claim 1, wherein the edge determination unit determines whether an edge exists between the target pixel and an unprocessed pixel. 6. 請求項1〜4のうち何れか1項に記載の画像処理装置において、前記エッジ判定部は、
前記着目画素と既処理画素との間でエッジ判定を行うか、前記着目画素と未処理画素との間でエッジ判定を行うか、選択可能である画像処理装置。
The image processing apparatus according to any one of claims 1 to 4, wherein the edge determination unit includes:
An image processing apparatus capable of selecting whether an edge determination is performed between the target pixel and a processed pixel, or whether an edge determination is performed between the target pixel and an unprocessed pixel.
請求項1〜4のうち何れか1項に記載の画像処理装置において、前記着目画素と既処理画素との間、及び前記着目画素と未処理画素との間にエッジが存在するか否かを判定する画像処理装置。   5. The image processing apparatus according to claim 1, wherein whether or not an edge exists between the target pixel and the processed pixel and between the target pixel and the unprocessed pixel is determined. An image processing apparatus for determining. 複数の画素から構成された多階調の画像データを、ドット形成の有無による表現形式のデータに変換する画像処理方法において、
前記画像データを構成する各画素をドット形成の有無による表現形式のデータに変換する度に、該変換を行う着目画素に生じる誤差に基づいて同着目画素から複数の画素へ拡散させる誤差値を算出する誤差拡散ステップと、
前記画像データを構成する各画素について、前記誤差拡散ステップにより算出される誤差値が累積された累積値を記憶する拡散誤差記憶ステップと、
前記着目画素と該着目画素周辺の画素との間にエッジが存在するか否かを判定するエッジ判定ステップと、
前記エッジ判定ステップの判定結果に応じて前記着目画素の累積値を用いて算出した補正データと、前記着目画素の階調値とに基づき、前記着目画素のドット形成の有無を判定するドット判定ステップと、
を備えた画像処理方法。
In an image processing method for converting multi-tone image data composed of a plurality of pixels into data in an expression format depending on the presence or absence of dot formation,
Each time each pixel constituting the image data is converted into data in an expression format based on the presence or absence of dot formation, an error value for diffusing from the target pixel to a plurality of pixels is calculated based on an error generated in the target pixel that performs the conversion. An error diffusion step to
A diffusion error storage step for storing a cumulative value obtained by accumulating the error value calculated by the error diffusion step for each pixel constituting the image data;
An edge determination step for determining whether or not an edge exists between the target pixel and pixels around the target pixel;
A dot determination step for determining the presence or absence of dot formation of the target pixel based on the correction data calculated using the cumulative value of the target pixel according to the determination result of the edge determination step and the gradation value of the target pixel When,
An image processing method comprising:
複数の画素から構成された多階調の画像データを、ドット形成の有無による表現形式のデータに変換する処理を制御部が実行するための画像処理プログラムであって、
前記制御部が、
前記画像データを構成する各画素をドット形成の有無による表現形式のデータに変換する度に、該変換を行う着目画素に生じる誤差に基づいて同着目画素から複数の画素へ拡散させる誤差値を算出する誤差拡散処理と、
前記画像データを構成する各画素について、前記誤差拡散処理により算出される誤差値が累積された累積値を記憶する拡散誤差記憶処理と、
前記着目画素と該着目画素周辺の画素との間にエッジが存在するか否かを判定するエッジ判定処理と、
前記エッジ判定処理の判定結果に応じて前記着目画素の累積値を用いて算出した補正データと、前記着目画素の階調値とに基づき、前記着目画素のドット形成の有無を判定するドット判定処理と、
を実行するための画像処理プログラム。
An image processing program for the control unit to execute processing for converting multi-gradation image data composed of a plurality of pixels into data in an expression format depending on the presence or absence of dot formation,
The control unit is
Each time each pixel constituting the image data is converted into data in an expression format based on the presence or absence of dot formation, an error value for diffusing from the target pixel to a plurality of pixels is calculated based on an error generated in the target pixel that performs the conversion. Error diffusion processing to
For each pixel constituting the image data, a diffusion error storage process for storing a cumulative value in which error values calculated by the error diffusion process are accumulated;
Edge determination processing for determining whether or not an edge exists between the target pixel and pixels around the target pixel;
Dot determination process for determining the presence or absence of dot formation of the target pixel based on the correction data calculated using the cumulative value of the target pixel according to the determination result of the edge determination process and the gradation value of the target pixel When,
An image processing program for executing
JP2004061071A 2004-03-04 2004-03-04 Image processing apparatus, image processing method, and image processing program Pending JP2005252710A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004061071A JP2005252710A (en) 2004-03-04 2004-03-04 Image processing apparatus, image processing method, and image processing program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004061071A JP2005252710A (en) 2004-03-04 2004-03-04 Image processing apparatus, image processing method, and image processing program

Publications (1)

Publication Number Publication Date
JP2005252710A true JP2005252710A (en) 2005-09-15

Family

ID=35032776

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004061071A Pending JP2005252710A (en) 2004-03-04 2004-03-04 Image processing apparatus, image processing method, and image processing program

Country Status (1)

Country Link
JP (1) JP2005252710A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016503531A (en) * 2012-10-26 2016-02-04 バクスター・コーポレーション・イングルウッドBaxter Corporation Englewood Improving image acquisition for medical dosage preparation systems
US10347374B2 (en) 2008-10-13 2019-07-09 Baxter Corporation Englewood Medication preparation system
US10646405B2 (en) 2012-10-26 2020-05-12 Baxter Corporation Englewood Work station for medical dose preparation system
US10818387B2 (en) 2014-12-05 2020-10-27 Baxter Corporation Englewood Dose preparation data analytics
US11107574B2 (en) 2014-09-30 2021-08-31 Baxter Corporation Englewood Management of medication preparation with formulary management
US11367533B2 (en) 2014-06-30 2022-06-21 Baxter Corporation Englewood Managed medical information exchange
US11575673B2 (en) 2014-09-30 2023-02-07 Baxter Corporation Englewood Central user management in a distributed healthcare information management system
US11948112B2 (en) 2015-03-03 2024-04-02 Baxter Corporation Engelwood Pharmacy workflow management with integrated alerts

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10347374B2 (en) 2008-10-13 2019-07-09 Baxter Corporation Englewood Medication preparation system
JP2016503531A (en) * 2012-10-26 2016-02-04 バクスター・コーポレーション・イングルウッドBaxter Corporation Englewood Improving image acquisition for medical dosage preparation systems
US10089444B2 (en) 2012-10-26 2018-10-02 Baxter Corporation Englewood Image acquisition for medical dose preparation system
US10646405B2 (en) 2012-10-26 2020-05-12 Baxter Corporation Englewood Work station for medical dose preparation system
US10971257B2 (en) 2012-10-26 2021-04-06 Baxter Corporation Englewood Image acquisition for medical dose preparation system
US11367533B2 (en) 2014-06-30 2022-06-21 Baxter Corporation Englewood Managed medical information exchange
US11107574B2 (en) 2014-09-30 2021-08-31 Baxter Corporation Englewood Management of medication preparation with formulary management
US11575673B2 (en) 2014-09-30 2023-02-07 Baxter Corporation Englewood Central user management in a distributed healthcare information management system
US10818387B2 (en) 2014-12-05 2020-10-27 Baxter Corporation Englewood Dose preparation data analytics
US11948112B2 (en) 2015-03-03 2024-04-02 Baxter Corporation Engelwood Pharmacy workflow management with integrated alerts

Similar Documents

Publication Publication Date Title
JP4683654B2 (en) Image processing apparatus, image processing apparatus control method, and program
JP4890974B2 (en) Image processing apparatus and image processing method
JP4881902B2 (en) Image forming apparatus, image forming method, and image forming program
JP6604902B2 (en) Apparatus, method and program
US10999473B2 (en) Image processing apparatus, image processing method, and recording medium to correct characteristic amount of target pixel using brightness at two pixels in set target area
JP2007053749A (en) Conversion method for converting digital image acquired by scanner, device, and computer program
US20100014121A1 (en) Printing Apparatus, Printing Method, and Recording Medium
JP2005252710A (en) Image processing apparatus, image processing method, and image processing program
JP2011259121A (en) Image processing apparatus and program
JP5058695B2 (en) Image processing apparatus, image processing method, and image processing program
JP2012199669A (en) Image processing apparatus, image processing method, image processing program, and printer
JP6566277B2 (en) Image processing device
JP4941157B2 (en) Coloring production apparatus, coloring production method and program thereof
JP6601225B2 (en) Control device and computer program
US9245215B2 (en) Image processing device for generating and printing image data for one or some of colors at a higher resolution than the other colors
JP5834672B2 (en) Image processing apparatus, image processing method, image forming apparatus, program, and recording medium
JP6756242B2 (en) Image processing equipment and programs
JP2006279774A (en) Image processing system and image processing apparatus
JP2005080070A (en) Determination of recommended trimming size
JP2006102990A (en) Printing device, printing system and program
US8605346B2 (en) Image processing apparatus and method for controlling same
JP5569107B2 (en) Image processing apparatus and program
JP2005250897A (en) Device, method, and program for image processing
JP6440000B2 (en) Image processing device
JP5732864B2 (en) Information processing apparatus, program, and printing method