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

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

Info

Publication number
JP2005136976A
JP2005136976A JP2004296548A JP2004296548A JP2005136976A JP 2005136976 A JP2005136976 A JP 2005136976A JP 2004296548 A JP2004296548 A JP 2004296548A JP 2004296548 A JP2004296548 A JP 2004296548A JP 2005136976 A JP2005136976 A JP 2005136976A
Authority
JP
Japan
Prior art keywords
pixel
value
pixel group
pixels
gradation
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
JP2004296548A
Other languages
Japanese (ja)
Inventor
Nobuhiro Karido
信宏 狩戸
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 JP2004296548A priority Critical patent/JP2005136976A/en
Publication of JP2005136976A publication Critical patent/JP2005136976A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Color, Gradation (AREA)
  • Facsimile Image Signal Circuits (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a technology of obtaining a pleasant print output with smooth gradation and high edge reproducibility while keeping an inter-dot interval. <P>SOLUTION: The image processing apparatus receives image data the each pixel of which has a prescribed gradation value, starts searching an initial pixel, and selects pixels configuring a cell until the total sum of the gradation values of pixels including the searched pixels reaches a prescribed threshold or over. When an average gradation value of the pixels in the cell is a prescribed value (e.g., "30") or over in this case, the threshold is changed from "255" used so far into "510" for example in order to keep the inter-dot interval. Further, when a difference between a maximum gradation value and a minimum gradation value in the cell is greater than a prescribed value (e.g., "50"), it is discriminated to be an edge area and the revised threshold value "510" is decreased into "255" to increase doth density. Further, the pixels are selected from pixels closest to the gravity center position. When the pixels are selected as the average gradation value reaches the threshold or over, a dot is generated to the gravity center position. <P>COPYRIGHT: (C)2005,JPO&NCIPI

Description

本発明は、レーザプリンタなどの画像処理装置における階調画像データのハーフトーン処理に関する。詳しくは、閾値に達するまでセルを構成する画素を選択し、そのセルの基準点にドットを発生させるように処理を行うが、画素の入力階調値に応じて閾値を変更するようにした処理に関する。   The present invention relates to halftone processing of gradation image data in an image processing apparatus such as a laser printer. Specifically, a pixel constituting a cell is selected until the threshold value is reached, and processing is performed so that dots are generated at the reference point of the cell, but the threshold value is changed according to the input gradation value of the pixel. About.

従来から、プリンタなどの画像出力装置は、各画素ごとに多値の階調値を有する階調データに対して、ドットの有無を表す2値の値に変換処理して印刷用紙に印刷を行うようになされている。一般には、多値の階調値を2値の値に変換する処理のことをハーフトーン処理と称されている。   2. Description of the Related Art Conventionally, an image output device such as a printer converts gradation data having multi-value gradation values for each pixel into binary values representing the presence or absence of dots, and prints on printing paper. It is made like that. In general, a process of converting a multi-value gradation value into a binary value is referred to as a halftone process.

かかるハーフトーン処理の方法としては、所定の閾値が格納された閾値マトリックスを利用して、入力階調値が閾値よりも大きいか小さいかにより2値化するディザ法や、閾値を設定しその閾値よりも大きいか小さいかにより2値化するとともにその誤差分をまわりの画素に分散して処理を進める誤差拡散法もある。   As a halftone processing method, a threshold matrix in which a predetermined threshold value is stored is used, and a dither method for binarizing depending on whether an input gradation value is larger or smaller than the threshold value, or a threshold value is set and the threshold value is set. There is also an error diffusion method in which binarization is performed depending on whether it is larger or smaller than that and the error is distributed to surrounding pixels to proceed with processing.

さらに、入力画像の各画素の階調値の合計が所定の閾値になるまでセルを構成する画素を選択し、セルの中心位置にドットを生成させるようにしたハーフトーン処理も知られている(例えば、特許文献1)。
特開平11−27528号公報
Furthermore, a halftone process is also known in which a pixel constituting a cell is selected until the sum of gradation values of each pixel of the input image reaches a predetermined threshold value, and a dot is generated at the center position of the cell ( For example, Patent Document 1).
JP 11-27528 A

しかしながら、上述した特開平11−27528においては、セルを構成する画素の選択を所定のテーブルを用いて行っているが、テーブル内で左側に存在する画素は既に処理済みの場合が多く、結果的に生成されるセルが歪んだ形となってしまう。かかる場合に、セルの中心にドットを生成させるとある部分では隣のドットを重なって形成されてしまうことになる。かかるハーフトーン処理における印刷出力は、ドットがある部分で重なって発生するため、全体として見た場合に粒状的にドットが存在し、視覚的に不快な印刷出力となっていた。   However, in the above-mentioned Japanese Patent Application Laid-Open No. 11-27528, selection of pixels constituting a cell is performed using a predetermined table, but the pixels existing on the left side in the table are often already processed, and as a result The generated cells are distorted. In such a case, if a dot is generated at the center of a cell, an adjacent dot is overlapped and formed at a certain portion. Since the print output in such halftone processing is overlapped at a portion where dots are present, the dots are present in a granular manner when viewed as a whole, resulting in a visually unpleasant print output.

とくに、レーザプリンタの場合に例えば1画素おきにドットを生成させるような場合に、その性能によってはドットが重なってしまい、滑らかな階調を表現したドットを生成させることができない場合もある。   In particular, in the case of a laser printer, for example, when dots are generated every other pixel, the dots may overlap depending on the performance, and it may not be possible to generate dots that express a smooth gradation.

さらに、上述した特開平11−27528において、階調値の変化の大きいエッジの部分ではセルの形状が歪んだ形になりやすく、セルの中心にドットを打つようにしてもエッジの領域でドットが離れすぎたり重なったりするなど、再現性がよいものとはいえず、不快な印刷出力となっていた。   Further, in Japanese Patent Laid-Open No. 11-27528 described above, the shape of the cell tends to be distorted at the edge portion where the change in gradation value is large, and even if the dot is hit at the center of the cell, the dot is formed in the edge region. The reproducibility was not good because it was too far away or overlapped, and the print output was unpleasant.

そこで、本発明の目的は、ドット間距離を保ちつつ、滑らかな階調とエッジの再現性の高い、快適な印刷出力を得ることにある。   Accordingly, an object of the present invention is to obtain a comfortable print output with a smooth gradation and high reproducibility of edges while maintaining a distance between dots.

上記目的を達成するために本発明は、画素ごとにN(Nは整数)種類以上のレベル値を有する階調データを、画素ごとにM(Mは整数)種類のレベル値を有するデータに変換する画像処理装置において、画素選択のための第1の基準点に基づいて、画素ごとのN種類のレベル値の総和が閾値以上となるまで画素を選択して画素群を生成する画素群生成手段と、画素群生成手段で生成した画素群の第2の基準点を決定する画素群基準点決定手段と、画素群基準点決定手段で決定した第2の基準点に位置する画素にM種類のレベル値を付与する付与手段と、を備え、画素群生成手段は、第1の基準点を更新して当該第1の基準点に基づいて画素を選択し、さらに生成した画素群内のレベル値に応じて閾値を更新することを特徴としている。これにより、例えば、ドット間距離を保ちつつ、滑らかな階調を表現した快適な印刷出力を得ることができる。   In order to achieve the above object, the present invention converts gradation data having N or more level values for each pixel into data having M (M is an integer) level values for each pixel. In the image processing apparatus, a pixel group generation unit that generates a pixel group by selecting a pixel based on a first reference point for pixel selection until a total of N kinds of level values for each pixel becomes equal to or greater than a threshold value A pixel group reference point determining means for determining the second reference point of the pixel group generated by the pixel group generating means, and M types of pixels located at the second reference point determined by the pixel group reference point determining means. And a pixel group generation unit that updates the first reference point, selects a pixel based on the first reference point, and further generates a level value in the pixel group It is characterized in that the threshold value is updated according to the above. Thereby, for example, a comfortable print output expressing smooth gradation can be obtained while maintaining the distance between dots.

さらに、本発明は上記画像処理装置において、上記画素群生成手段は、生成した画素群内の画素のレベル値の平均値に応じて前記閾値を更新することを特徴としている。これにより、例えば、セルとして画素を選択している領域が平均階調値が高いと高濃度の領域と判断して、閾値を変更することでドット間距離を保つことができる。   Furthermore, the present invention is characterized in that, in the image processing apparatus, the pixel group generation means updates the threshold value according to an average value of level values of pixels in the generated pixel group. Thereby, for example, if the area where a pixel is selected as a cell has a high average gradation value, it is determined that the area is a high density area, and the inter-dot distance can be maintained by changing the threshold value.

さらに、本発明は上記画像処理装置において、上記画素群生成手段は、生成した画素群内のレベル値が第1の値より大きいとき閾値をこれまでの第2の値から第2の値より大きい第3の値に更新することを特徴としている。これにより、例えば、レベル値の変化が大きいとそれだけ閾値の値を大きくとることでセルの大きさを保ち、ドット間距離を保つことができる。   Further, in the image processing apparatus according to the aspect of the invention, the pixel group generation unit may increase the threshold value from the previous second value to the second value when the level value in the generated pixel group is larger than the first value. It is characterized by updating to the third value. Thereby, for example, if the change in the level value is large, the threshold value is increased accordingly, so that the cell size can be maintained and the inter-dot distance can be maintained.

さらに、本発明は上記画像処理装置において、上記画素群生成手段は、生成した画素群内のレベル値の最大値と最小値の差が第4の値よりも大きいとき、閾値をこれまでの第5の値から第5の値より低い第6の値に更新することを特徴としている。これにより、例えば、エッジの領域ではドット密度を高めてその再現性を向上させることができる。   Furthermore, in the image processing apparatus according to the aspect of the invention, the pixel group generation unit may set the threshold value when the difference between the maximum value and the minimum value of the level value in the generated pixel group is larger than the fourth value. It is characterized by updating from a value of 5 to a sixth value lower than the fifth value. Thereby, for example, in the edge region, the dot density can be increased to improve the reproducibility thereof.

さらに、本発明は上記画像処理装置において、上記第2の基準点は画素群の各画素位置と各画素のN種類のレベル値とから演算した重心位置であることを特徴としている。これにより、例えば、円状に成長した画素群の重心位置にドットが打たれるようになるため各ドットの間隔が一定距離に保たれた快適な印刷出力を得ることができる。   Furthermore, the present invention is characterized in that, in the image processing apparatus, the second reference point is a barycentric position calculated from each pixel position of a pixel group and N kinds of level values of each pixel. Thereby, for example, since dots are hit at the center of gravity of the pixel group grown in a circle, a comfortable print output in which the intervals between the dots are maintained at a constant distance can be obtained.

さらに、本発明は上記画像処理装置において、上記画素群生成手段は、第1の基準点に基づいて選択すべき画素が複数あるときはランダムにいづれか一の画素を選択することを特徴としている。これにより、例えば、画素群が円状に成長しやすくなり、第2の基準点にドットを打てばそのドット間距離が一定に保たれる。   Furthermore, the present invention is characterized in that, in the image processing apparatus, the pixel group generation means randomly selects one pixel when there are a plurality of pixels to be selected based on the first reference point. Thereby, for example, the pixel group easily grows in a circular shape, and if a dot is hit at the second reference point, the distance between the dots is kept constant.

また、上記目的を達成するために本発明は、画素ごとにN(Nは整数)種類以上のレベル値を有する階調データを、画素ごとにM(Mは整数)種類のレベル値を有するデータに変換する画像処理装置において、N種類のレベル値を有する画素を選択し、選択した画素ごとのレベル値の総和が閾値となるまで未処理画素を選択して画素群を生成する画素群生成手段と、画素群生成手段で生成した画素群の所定画素に対してM種類のレベル値を付与する付与手段と、を備え、画素群生成手段は、生成した前記画素群内のレベル値に応じて前記閾値を更新することを特徴としている。これにより、例えば、ドット間距離を保ちつつ、滑らかな階調を表現した快適な印刷出力を得ることができる。   In order to achieve the above object, the present invention provides gradation data having N (N is an integer) or more level values for each pixel, and data having M (M is an integer) types of level values for each pixel. A pixel group generating unit that selects pixels having N level values and selects unprocessed pixels until the sum of the level values for each selected pixel reaches a threshold value in the image processing apparatus for converting to And an adding means for giving M kinds of level values to predetermined pixels of the pixel group generated by the pixel group generating means, the pixel group generating means depending on the generated level value in the pixel group The threshold value is updated. Thereby, for example, a comfortable print output expressing smooth gradation can be obtained while maintaining the distance between dots.

さらに、上記目的を達成するために本発明は、画素ごとにN(Nは整数)種類以上のレベル値を有する階調データを、画素ごとにM(Mは整数)種類のレベル値を有するデータに変換する画像処理方法において、画素選択のための第1の基準点に基づいて、画素ごとのN種類のレベル値の総和が閾値以上となるまで画素を選択して画素群を生成する画素群生成工程と、画素群生成工程で生成した画素群の第2の基準点を決定する画素群基準点決定工程と、画素群基準点決定工程で決定した前記第2の基準点に位置する画素にM種類のレベル値を付与する付与工程とを備え、画素群生成工程は、第1の基準点を更新して当該第1の基準点に基づいて画素を選択し、さらに生成した前記画素群内のレベル値に応じて閾値を更新することを特徴としている。これにより、例えば、ドット間距離を保ちつつ、滑らかな階調を表現した快適な印刷出力を得ることができる。   Furthermore, in order to achieve the above object, the present invention provides gradation data having N (N is an integer) or more level values for each pixel, and data having M (M is an integer) types of level values for each pixel. In the image processing method for converting to a pixel group, a pixel group is generated by selecting a pixel based on a first reference point for pixel selection until a sum of N kinds of level values for each pixel is equal to or greater than a threshold value. A pixel group reference point determination step for determining a second reference point of the pixel group generated in the generation step, a pixel group generation step, and a pixel located at the second reference point determined in the pixel group reference point determination step. A pixel group generation step that updates the first reference point, selects a pixel based on the first reference point, and further generates a pixel in the generated pixel group. The threshold value is updated according to the level value of There. Thereby, for example, a comfortable print output expressing smooth gradation can be obtained while maintaining the distance between dots.

さらに、上記目的を達成するために本発明は、画素ごとにN(Nは整数)種類以上のレベル値を有する階調データを、画素ごとにM(Mは整数)種類のレベル値を有するデータに変換する画像処理方法において、N種類のレベル値を有する画素を選択し、選択した画素ごとのレベル値の総和が閾値となるまで未処理画素を選択して画素群を生成する画素群生成工程と、画素群生成手段で生成した画素群の所定画素に対してM種類のレベル値を付与する付与工程とを備え、画素群生成工程は、生成した前記画素群内のレベル値に応じて閾値を更新することを特徴としている。これにより、例えば、ドット間距離を保ちつつ、滑らかな階調を表現した快適な印刷出力を得ることができる。   Furthermore, in order to achieve the above object, the present invention provides gradation data having N (N is an integer) or more level values for each pixel, and data having M (M is an integer) types of level values for each pixel. In the image processing method for converting to a pixel group, a pixel group generation step of selecting a pixel having N types of level values and generating a pixel group by selecting unprocessed pixels until the sum of the level values for each selected pixel reaches a threshold value And an assigning step of assigning M kinds of level values to predetermined pixels of the pixel group generated by the pixel group generating means, and the pixel group generating step includes a threshold value according to the generated level value in the pixel group. It is characterized by updating. Thereby, for example, a comfortable print output expressing smooth gradation can be obtained while maintaining the distance between dots.

さらに、上記目的を達成するために本発明は、画素ごとにN(Nは整数)種類以上のレベル値を有する階調データに対して、画素ごとにM(Mは整数)種類のレベル値を有するデータを出力する処理をコンピュータに実行させるためのプログラムにおいて、画素選択のための第1の基準点に基づいて、画素ごとのN種類のレベル値の総和が閾値以上となるまで画素を選択して画素群を生成する画素群生成処理と、画素群生成処理で生成した画素群の第2の基準点を決定する画素群基準点決定処理と、画素群基準点決定処理で決定した第2の基準点に位置する画素にM種類のレベル値を付与する付与処理とを備え、画素群生成処理は、第1の基準点を更新して当該第1の基準点に基づいて画素を選択し、さらに生成した画素群内のレベル値に応じて閾値を更新することを特徴としている。これにより、例えば、ドット間距離を保ちつつ、滑らかな階調を表現した快適な印刷出力を得ることができる。   Furthermore, in order to achieve the above object, the present invention provides M (M is an integer) type level values for each pixel with respect to gradation data having N (N is an integer) type level values or more for each pixel. In a program for causing a computer to execute a process of outputting data, pixels are selected based on the first reference point for pixel selection until the sum of N level values for each pixel is equal to or greater than a threshold value. A pixel group generation process for generating a pixel group, a pixel group reference point determination process for determining a second reference point of the pixel group generated by the pixel group generation process, and a second determined by the pixel group reference point determination process A pixel group generation process that updates the first reference point and selects a pixel based on the first reference point. Furthermore, it corresponds to the level value in the generated pixel group. It is characterized by updating the threshold Te. Thereby, for example, a comfortable print output expressing smooth gradation can be obtained while maintaining the distance between dots.

さらに、上記目的を達成するために本発明は、画素ごとにN(Nは整数)種類以上のレベル値を有する階調データに対して、画素ごとにM(Mは整数)種類のレベル値を有するデータを出力する処理をコンピュータに実行させるプログラムにおいて、N種類のレベル値を有する画素を選択し、選択した画素ごとのレベル値の総和が閾値となるまで未処理画素を選択して画素群を生成する画素群生成処理と、画素群生成手段で生成した画素群の所定画素に対してM種類のレベル値を付与する付与処理とを備え、画素群生成処理は、生成した画素群内のレベル値に応じて前記閾値を更新することを特徴としている。これにより、例えば、ドット間距離を保ちつつ、滑らかな階調を表現した快適な印刷出力を得ることができる。   Furthermore, in order to achieve the above object, the present invention provides M (M is an integer) type level values for each pixel with respect to gradation data having N (N is an integer) type level values or more for each pixel. In a program for causing a computer to execute a process of outputting data having N values, pixels having N types of level values are selected, and unprocessed pixels are selected until the sum of the level values for each selected pixel becomes a threshold value. A pixel group generation process to be generated, and an adding process to give M kinds of level values to predetermined pixels of the pixel group generated by the pixel group generation unit. The pixel group generation process is a level within the generated pixel group. The threshold value is updated according to the value. Thereby, for example, a comfortable print output expressing smooth gradation can be obtained while maintaining the distance between dots.

以下、図面を参照して本発明を実施するための最良の形態を説明する。図1は、本発明が適用されるシステム全体の構成を示す図である。全体としてホストコンピュータ10と、画像出力装置20とから構成される。   The best mode for carrying out the present invention will be described below with reference to the drawings. FIG. 1 is a diagram showing the configuration of the entire system to which the present invention is applied. As a whole, the host computer 10 and the image output device 20 are configured.

ホストコンピュータ10は、アプリケーション部11とラスタライズ部12とから構成される。アプリケーション部11では、文字データ、図形データ、ビットマップデータ等の印刷対象のデータが生成される。例えば、ホストコンピュータ10でワードプロセッサや図形ツールなどのアプリケーションプログラムを使用してキーボード等の操作により文字データや図形データなどが生成される。生成されたこれらのデータは、ラスタライズ部12へ出力される。   The host computer 10 includes an application unit 11 and a rasterizing unit 12. The application unit 11 generates data to be printed such as character data, graphic data, and bitmap data. For example, character data, graphic data, and the like are generated by operating the keyboard or the like using an application program such as a word processor or a graphic tool in the host computer 10. These generated data are output to the rasterizing unit 12.

ラスタライズ部12では、アプリケーション部11から出力された印刷対象のデータを画素ごと(又はドットごと)に8ビットの階調データに変換される。したがって、各画素ごと0から255までの階調値(レベル値)を有することになる。ラスタライズ部12における階調データの生成は、実際にはホストコンピュータ10に実装されたドライバによって処理が行われる。ラスタライズ部12から出力される階調データは、画像出力装置20に出力される。なお、本実施例においてこの階調データはモノクロデータとして以下説明する。   The rasterizing unit 12 converts the print target data output from the application unit 11 into 8-bit gradation data for each pixel (or for each dot). Therefore, each pixel has a gradation value (level value) from 0 to 255. The generation of gradation data in the rasterizing unit 12 is actually processed by a driver installed in the host computer 10. The gradation data output from the rasterizing unit 12 is output to the image output device 20. In the present embodiment, the gradation data will be described below as monochrome data.

画像出力装置20は、全体として画像処理部21と印刷エンジン22とから構成される。画像処理部21では、ホストコンピュータ10から出力された階調データに対してハーフトーン処理等を行う。処理後のデータは印刷エンジン22に出力され、この印刷エンジン22にて実際に印刷用紙等の記録媒体への印刷が行われる。   The image output apparatus 20 includes an image processing unit 21 and a print engine 22 as a whole. In the image processing unit 21, halftone processing or the like is performed on the gradation data output from the host computer 10. The processed data is output to the print engine 22, and the print engine 22 actually prints on a recording medium such as print paper.

画像処理部21は、ハーフトーン処理部211と、パルス幅変換部212とから構成される。ハーフトーン処理部211は、ホストコンピュータ10から出力された階調データが入力され、2値以上の多値の値(レベル値)に変換し、量子化データを出力する。ハーフトーン処理としては、本実施例では複数の画素からなるセルを構成してその重心にドットを生成させる重心利用した処理(Circular Cell法、以下CC法)を行う。本処理の具
体的な内容は後述する。
The image processing unit 21 includes a halftone processing unit 211 and a pulse width conversion unit 212. The halftone processing unit 211 receives gradation data output from the host computer 10, converts it into a multi-value (level value) of two or more values, and outputs quantized data. As the halftone processing, in this embodiment, processing using the center of gravity (Circular Cell method, hereinafter referred to as CC method) is performed in which a cell composed of a plurality of pixels is formed and a dot is generated at the center of gravity. Specific contents of this processing will be described later.

パルス幅変調部212は、ハーフトーン処理部211から出力された量子化データが入力され、この量子化データに対してドットごとにレーザ駆動パルス有り又は無し等の駆動データを生成する。生成した駆動データは、印刷エンジン22に出力される。   The pulse width modulation unit 212 receives the quantized data output from the halftone processing unit 211, and generates drive data such as whether or not there is a laser drive pulse for each dot with respect to the quantized data. The generated drive data is output to the print engine 22.

印刷エンジン22は、レーザドライバ221とレーザーダイオード(LD)222とから構成される。レーザドライバ221は、パルス幅変調部212からの駆動データが入力され、その駆動データをもとに駆動パルスあり又はなし等を示す制御データを生成し、レーザーダイオード222に出力する。レーザーダイオード222は、レーザドライバ221から出力された制御データに基づいて駆動され、さらに図示しない感光ドラムや転写ベルトが駆動されて、実際に印刷用紙等の記録媒体にホストコンピュータ10からのデータが印刷されることになる。   The print engine 22 includes a laser driver 221 and a laser diode (LD) 222. The laser driver 221 receives the drive data from the pulse width modulation unit 212, generates control data indicating the presence or absence of a drive pulse based on the drive data, and outputs the control data to the laser diode 222. The laser diode 222 is driven based on the control data output from the laser driver 221. Further, a photosensitive drum and a transfer belt (not shown) are driven, and data from the host computer 10 is actually printed on a recording medium such as printing paper. Will be.

次に図2を参照して、画像出力装置20の具体的構成について説明する。ここで、図1の画像出力装置20のうち、ハーフトーン処理部211及びパルス幅変調部212は、図2におけるCPU24、ROM25、及びRAM26に対応する。   Next, a specific configuration of the image output apparatus 20 will be described with reference to FIG. Here, in the image output apparatus 20 of FIG. 1, the halftone processing unit 211 and the pulse width modulation unit 212 correspond to the CPU 24, the ROM 25, and the RAM 26 in FIG.

画像出力装置20は、全体として、入力インターフェース(I/F)23、CPU24、ROM25、RAM26、印刷エンジン22とから構成され、バスを介して互いに接続されている。入力I/F23は、ホストコンピュータ10と画像出力装置20とのインターフェースの役割を果たす。入力I/F23には、所定の伝送方式により伝送された、ホストコンピュータ20からの階調データが入力され、画像出力装置20で処理できるデータに変換される。入力された階調データは、一旦RAM26に格納される。   The image output device 20 as a whole is composed of an input interface (I / F) 23, a CPU 24, a ROM 25, a RAM 26, and a print engine 22, and are connected to each other via a bus. The input I / F 23 serves as an interface between the host computer 10 and the image output apparatus 20. The input I / F 23 receives gradation data from the host computer 20 transmitted by a predetermined transmission method, and is converted into data that can be processed by the image output device 20. The input gradation data is temporarily stored in the RAM 26.

CPU24は、バスを介して入力I/F23、ROM25、RAM26、印刷エンジン22と接続され、ROM25に格納されたプログラムを読み出して、ハーフトーン処理等の各種処理を行う。その詳細は後述する。RAM26は、CPU24で実行される各処理のワーキングメモリとして役割を果たし、処理後の各種データが格納される。また、印刷エンジン22のレーザドライバ221を駆動させるための駆動データも格納される。RAM26の具体的構成等も後述する。   The CPU 24 is connected to the input I / F 23, the ROM 25, the RAM 26, and the print engine 22 via a bus, reads out a program stored in the ROM 25, and performs various processes such as a halftone process. Details thereof will be described later. The RAM 26 serves as a working memory for each process executed by the CPU 24 and stores various data after the process. In addition, drive data for driving the laser driver 221 of the print engine 22 is also stored. The specific configuration of the RAM 26 will also be described later.

印刷エンジン22は、図1の印刷エンジンと同様の構成で、RAM26に格納された駆動データがCPU24の制御により入力されて、上述した印刷処理が行われることになる。   The print engine 22 has the same configuration as the print engine of FIG. 1, and the drive data stored in the RAM 26 is input under the control of the CPU 24, and the above-described print processing is performed.

次に、このハーフトーン処理部212における処理について以下、具体的に説明するが、その前にCC法についての概要を簡単に説明する。CC法によるハーフトーン処理は、まず初期画素を選択し、所定の閾値に達するまで初期画素周辺の未処理画素を選択して、複数画素からなるセルを構成する。セルを構成する未処理画素選択の際、それまで構成したセルの重心位置から最も近い画素を選択する。そして、閾値に達するとそのセルの重心位置に位置する画素にドット生成を示す値(例えば“255”)を割り当て、それ以外の画素はドットの生成を行わないことを示す値(例えば“0”)を割り当てる。CC法は、以上の処理を入力画像の全てのデータに対して行うことで、量子化されたデータを得るのである。   Next, processing in the halftone processing unit 212 will be specifically described below, but before that, an outline of the CC method will be briefly described. In the halftone processing by the CC method, an initial pixel is first selected, and unprocessed pixels around the initial pixel are selected until a predetermined threshold value is reached, thereby forming a cell composed of a plurality of pixels. When selecting an unprocessed pixel constituting a cell, a pixel closest to the center of gravity of the cell constituted so far is selected. When the threshold value is reached, a value indicating dot generation (for example, “255”) is assigned to the pixel located at the center of gravity of the cell, and a value indicating that dot generation is not performed for other pixels (for example, “0”). ). The CC method obtains quantized data by performing the above processing on all data of the input image.

上述した特開平11−27528では、セルに取り込むべき未処理画素の選択にテーブルを利用して予め決められた位置の画素を選択するようにしている。一方、CC法は重心位置を利用してセルに取り込むべき未処理画素を選択するようにしているため、特開平11−27528と比較して、セルが円状に成長し、ドット間距離を一定に保つことができ、ドットの分散性を向上させて視覚的に快適な印刷出力を得ることができるのである。   In the above-mentioned Japanese Patent Laid-Open No. 11-27528, a pixel at a predetermined position is selected using a table for selecting an unprocessed pixel to be taken into a cell. On the other hand, since the CC method uses the position of the center of gravity to select the unprocessed pixels to be taken into the cell, the cell grows in a circular shape and the inter-dot distance is constant as compared with JP-A-11-27528. Therefore, the dispersibility of dots can be improved, and a visually comfortable print output can be obtained.

一方、レーザプリンタの場合、露光ユニット内のレーザ光を感光体ドラムに照射することで潜像を形成するが、1画素分のドットを形成させるとき光の特質により正確に1画素分の大きさのドットを形成させることができない。隣接画素から除々に光量が多くなり照射すべき画素内で最も高い光量となり、また除々に少ない光量となる。すなわち、隣接画素に跨って光が照射されてしまうのである。このため、1画素おきにドットを形成させるような場合、使用するレーザプリンタによっては連続してドットが発生することがあり、これが粒状的なドットを発生させる原因にもなっている。   On the other hand, in the case of a laser printer, a latent image is formed by irradiating a photosensitive drum with laser light in an exposure unit. When a dot for one pixel is formed, the size of one pixel is accurately determined by the characteristics of the light. Dots cannot be formed. The amount of light gradually increases from adjacent pixels, and becomes the highest amount of light in the pixel to be irradiated, and gradually decreases. That is, light is irradiated across adjacent pixels. For this reason, when dots are formed every other pixel, dots may be continuously generated depending on the laser printer to be used, and this also causes the generation of granular dots.

ここで、CC法による処理をレーザプリンタに応用した場合に、セルを構成するための閾値を一定にすると各画素の階調値が小さい領域では階調値の合計がなかなか閾値に達することができないためにセルの大きさは比較的大きくその重心にドットを生成させると、ドット間の距離が長く保たれているので粒状的なドットの発生を抑える確率は高くなる。しかしながら、階調値が大きい領域ではすぐに閾値に達してしまうためセルの大きさは比較的小さくその重心にドットを打つようにしても隣接するドットどうしが重なりドット間距離が保つことができず、粒状的なドットを発生させてしまう確率が高くなる。そこで、本発明ではセルを構成するための閾値をセル内の画素の階調値によって変化させることで、粒状的なドットの発生を抑え、滑らかな階調表現を実現しようとするものである。具体的には、セルを構成する画素の階調値の平均値が一定値以上のとき、その閾値を高くし、セルの大きさを大きく保つようにすることで、ドット間距離を保ち粒状的なドットの発生を抑えるのである。   Here, when processing by the CC method is applied to a laser printer, if the threshold value for configuring the cell is made constant, the sum of the gradation values cannot easily reach the threshold value in a region where the gradation value of each pixel is small. Therefore, if the size of the cell is relatively large and dots are generated at the center of gravity, the distance between the dots is kept long, so the probability of suppressing the generation of granular dots increases. However, since the threshold value is reached immediately in a region where the gradation value is large, the cell size is relatively small, and even if dots are hit at the center of gravity, adjacent dots overlap and the inter-dot distance cannot be maintained. The probability of generating granular dots increases. Therefore, in the present invention, by changing the threshold value for configuring the cell according to the gradation value of the pixel in the cell, it is intended to suppress the generation of granular dots and realize a smooth gradation expression. Specifically, when the average value of the gradation values of the pixels constituting the cell is equal to or greater than a certain value, the threshold value is increased and the cell size is kept large, thereby maintaining the inter-dot distance and granularity. This suppresses the generation of new dots.

また、上述したようにレーザプリンタは、例えば1画素分の大きさのような小さいドットを安定して出力することは困難である。このようなプリンタでCC法による閾値を固定にすると入力階調値が低い領域では、例えば1画素分の領域にしかドットが発生しない場合が多い。これでは、上述したように隣の画素までドットが発生したりするなど、粒状的なドットを発生させてしまう。そこで、入力階調値に応じてその閾値を更新して、できるだけ2画素分のドット、3画素分のドットなど安定したサイズのドットを発生させるようにするのである。このようにすることで、本発明では階調値が低い領域でも小さいドットを発生させる確率を低くして、粒状的でない安定したサイズのドットを発生させることができる。したがって、ドットサイズが小さいと粒状的なドットを発生させてしまうレーザプリンタであっても、入力階調値に応じて閾値を変更することで、ドット間距離は広がるものの1つ1つのドットが安定した、粒状的でないドットを発生し快適な印刷出力を得ることができるのである。   Further, as described above, it is difficult for a laser printer to stably output small dots such as the size of one pixel. In such a printer, when the threshold value by the CC method is fixed, in an area where the input gradation value is low, for example, dots often occur only in an area for one pixel. In this case, as described above, a dot is generated up to the adjacent pixel, and a granular dot is generated. Therefore, the threshold value is updated in accordance with the input gradation value so that dots having a stable size such as dots for two pixels and dots for three pixels are generated as much as possible. In this way, in the present invention, it is possible to reduce the probability of generating a small dot even in a region having a low gradation value, and to generate a dot having a stable size that is not granular. Therefore, even in a laser printer that generates granular dots when the dot size is small, changing the threshold value according to the input tone value increases the inter-dot distance, but makes each dot stable. As a result, a non-granular dot is generated and a comfortable print output can be obtained.

図3には、レーザプリンタによる出力例を示す。図3(a)は閾値を一定にした場合の例、図3(b)は閾値をセル内の画素の平均階調値によって高くした場合の例である。入力階調値は双方とも図面上左から右にかけて除々にその値が大きくなっている。閾値を一定にすると(図3(a)の場合)、階調値が大きい領域(図面右側)ではドットが密集し、上述したレーザプリンタの特性から、所々でドットどうしが引っ付いたりするなど粒状的なドットが発生している。一方、図3(b)の場合、階調値が大きい領域でもドット間距離が保たれ粒状的なドットは発生していない。かかるドットは全体的に滑らかな階調を表現している、といえる。   FIG. 3 shows an output example from the laser printer. FIG. 3A shows an example when the threshold value is made constant, and FIG. 3B shows an example when the threshold value is increased by the average gradation value of the pixels in the cell. Both of the input tone values gradually increase from the left to the right in the drawing. If the threshold value is made constant (in the case of FIG. 3A), the dots are densely gathered in the region where the gradation value is large (the right side of the drawing), and the dots are stuck in places due to the characteristics of the laser printer described above. Dots are generated. On the other hand, in the case of FIG. 3B, the inter-dot distance is maintained even in the region where the gradation value is large, and no granular dots are generated. It can be said that such dots express a smooth gradation as a whole.

また、階調の表現自体も図3(a)の場合、右側にいくに従って除々にドットが密集するように配置されることで階調が表現されている。一方、図3(b)の場合はドット間距離が保たれたまま右側にいくに従ってドットの1つ1つが除々に大きくなることで階調が表現されている。これは、CC法による処理の場合に閾値を高く設定するとセルの大きさが大きくなる分、セルに取り込んだ画素の階調値の合計値も大きくなり、ドットが1画素分ではなく2画素分、3画素分と大きく成長するためである。   Also, in the case of FIG. 3A, the gradation expression itself is expressed by arranging dots so that the dots gradually gather toward the right side. On the other hand, in the case of FIG. 3B, gradation is expressed by increasing each dot gradually toward the right while maintaining the distance between dots. This is because when the threshold value is set high in the case of processing by the CC method, the total size of the pixels captured in the cell increases as the size of the cell increases, and the dot is not for one pixel but for two pixels. This is because it grows as large as 3 pixels.

しかしながら、このように閾値を変化させたとしても以下のような問題点である。すなわち、突然その画素の階調値が変化する領域(以下、エッジという)でドット間距離が空いてしまうと却ってエッジの再現性が悪くなってしまう。距離が大きい分、エッジの表現が劣化してしまうのである。このようなエッジの部分では、むしろセルの大きさを小さくしドット密度を上げて解像度を良くすべきである。図4には、エッジの部分を何ら検出せず、セルを構成する画素の平均階調値が高くなると閾値を上げるように処理した場合の出力例である。図に示すように、とくに文字“S”のカーブの部分ではドット間距離が広がりすぎていたり、ドットが重なって発生したりしているため、エッジの再現性が良くない。この図では、文字“S”の領域は入力階調値を“0”にしているため、セルがエッジの部分で円状に成長せず歪んだ形となってしまい、その重心にドットを打っても隣接するセルのドットと重なってしまうことがあるからである。   However, even if the threshold value is changed in this way, there are the following problems. In other words, if the distance between dots suddenly increases in a region where the tone value of the pixel changes (hereinafter referred to as an edge), the reproducibility of the edge deteriorates. As the distance increases, the expression of the edge deteriorates. In such an edge portion, the resolution should be improved by reducing the cell size and increasing the dot density. FIG. 4 shows an output example when processing is performed such that no threshold is detected and the threshold value is increased when the average gradation value of the pixels constituting the cell increases. As shown in the drawing, the reproducibility of the edge is not good because the inter-dot distance is excessively wide or the dots are overlapped particularly in the curve portion of the character “S”. In this figure, since the input gradation value is set to “0” in the region of the character “S”, the cell does not grow in a circular shape at the edge portion, and is distorted, and a dot is hit at the center of gravity. This is because the dots of adjacent cells may overlap.

そこで、入力階調値の変化が大きい領域を検出するとその閾値を下げるように処理することで、セルの大きさが小さくなりその分ドット密度が上がるため、エッジの再現性がよくなる。図5にかかる処理を行った場合の出力例を示す。文字“S”のカーブの部分では、まわりのドットと比較してその大きさが小さくなるがその分多くのドットが打たれ、図4の場合と比較して再現性がよい。この場合に、上述したレーザプリンタの特性、すなわちドットどうしが引っ付いてしまう確率が高まるが、それよりも解像度を上げてエッジの再現性を良くすべきである。図5の場合でもエッジの部分で隣接するドットが引っ付いている箇所も存在するが、却ってそのことが文字“S”を強調しており再現性は高くなっているといえる。もちろん、できるだけドットどうしが距離を保ち、かつ再現性を高めるようにするためには、ドットどうしが引っ付いてしまうことのないような閾値を設定するようにすればよいのである。   Therefore, if an area where the change in the input tone value is large is detected, the threshold value is reduced, so that the cell size is reduced and the dot density is increased accordingly, so that the edge reproducibility is improved. An output example when the processing according to FIG. 5 is performed is shown. In the curve portion of the letter “S”, the size of the dot is smaller than that of the surrounding dots, but more dots are hit, and the reproducibility is better than in the case of FIG. In this case, the above-described characteristics of the laser printer, that is, the probability that dots are stuck to each other increases, but the resolution should be increased to improve the edge reproducibility. Even in the case of FIG. 5, there is a portion where an adjacent dot is stuck at the edge portion, but on the contrary, this emphasizes the letter “S” and it can be said that the reproducibility is high. Of course, in order to keep the distance between the dots as much as possible and to improve the reproducibility, it is only necessary to set a threshold value that does not cause the dots to be caught.

このように入力階調値によってセルを構成するための閾値を変化させることで、図3に示すようにドット間距離を保って滑らかな階調を表現し、入力階調値の変化が大きいとその閾値を下げるようにすることで、図5に示すようにエッジの再現性が優れた印刷出力を得ることができる。   In this way, by changing the threshold value for configuring the cell according to the input gradation value, a smooth gradation is expressed while maintaining the distance between dots as shown in FIG. 3, and when the change of the input gradation value is large, By reducing the threshold value, a print output with excellent edge reproducibility can be obtained as shown in FIG.

以下、本発明によるCC法によるハーフトーン処理の詳細について図面を参照しながら説明する。ここで図6乃至図11は処理の動作を示すフローチャートであり、図12乃至図29はRAM26に格納された階調データの例を示すものである。以下、フローチャートに沿って説明することにする。   The details of the halftone processing by the CC method according to the present invention will be described below with reference to the drawings. 6 to 11 are flowcharts showing processing operations, and FIGS. 12 to 29 show examples of gradation data stored in the RAM 26. FIG. Hereinafter, description will be made along the flowchart.

図6は、本発明のCC法によるハーフトーン処理全体のフローチャートを示すものである。まず、図6に示すように、CPU24は本処理を実行するためのプログラムをROM25から読み出すことによって、処理が開始されることになる(ステップS10)。ホストコンピュータ10からの入力階調データはRAM26に格納されているものとする。その例を図12(a)に示す。この図に示すようにRAM26には、入力データ格納領域261aを有し、ホストコンピュータ10からの入力階調データがCPU24の制御によってこの入力データ領域261aに格納さる。この領域261aにおいて各座標位置は、全体画像の画素位置に対応するものである。例えば入力データ格納領域261aで(0,0)の座標位置は、全体画像の(0,0)に位置する画素に対応する。また、各座標位置に格納された値は当該画素の入力階調値を示す。なお、図12(a)に示す例は7行12列の構成であるが、これは説明を容易にするためであって、例えば1ページ(1フレーム)分の画像を格納できる構成であってもよいし、この図より少ない行と列の構成であってもよい。また、RAM26内には量子化データを格納するための出力データ領域261bを有する。この領域261bも、入力データ領域261aと同様に各座標位置は全体画像の画素位置に対応するもので、構成も7行12列となっているがそれ以外の構成であってもよい。さらに、RAM26には図12(b)に示すようにワーキングメモリ領域270を有し、基準点としての重心位置の座標とこれまでセルとして選択した画素の階調値の合計値とを格納する領域270aと、セル内の画素の階調値の最大値と最小値とを格納する領域270bと、セル内の階調値の平均値を格納する領域270cと、セルを構成する画素を選択するための閾値を格納する領域270dと、から構成される。各領域270a〜270dはCPU24によって演算されてその値が格納される。なお、領域270dには閾値のデフォルト値として“255”が格納されているものとする。   FIG. 6 shows a flowchart of the entire halftone process according to the CC method of the present invention. First, as shown in FIG. 6, the CPU 24 reads the program for executing this processing from the ROM 25, and the processing is started (step S10). It is assumed that input gradation data from the host computer 10 is stored in the RAM 26. An example is shown in FIG. As shown in this figure, the RAM 26 has an input data storage area 261a, and input gradation data from the host computer 10 is stored in the input data area 261a under the control of the CPU 24. In this area 261a, each coordinate position corresponds to a pixel position of the entire image. For example, the coordinate position (0, 0) in the input data storage area 261a corresponds to the pixel located at (0, 0) in the entire image. The value stored at each coordinate position indicates the input gradation value of the pixel. Note that the example shown in FIG. 12A has a structure of 7 rows and 12 columns, but this is for ease of explanation, for example, a structure that can store an image for one page (one frame). Alternatively, the number of rows and columns may be smaller than in this figure. Further, the RAM 26 has an output data area 261b for storing quantized data. Similarly to the input data area 261a, the coordinate position of this area 261b corresponds to the pixel position of the entire image, and the configuration is 7 rows and 12 columns, but other configurations may be used. Further, the RAM 26 has a working memory area 270 as shown in FIG. 12B, and stores the coordinates of the barycentric position as the reference point and the total value of the gradation values of the pixels selected so far as the cells. 270a, an area 270b for storing the maximum and minimum gradation values of the pixels in the cell, an area 270c for storing the average value of the gradation values in the cell, and a pixel constituting the cell And an area 270d for storing the threshold value. The areas 270a to 270d are calculated by the CPU 24 and the values are stored. It is assumed that “255” is stored in the area 270d as a default value of the threshold value.

図6に戻り、次いでCPU24は初期画素を決定し、基準点を初期画素の座標に設定する(ステップS11)。初期画素の決定に際しては、CPU24はラスタ方向に入力データ領域261a内を探索する。ここでラスタ方向とは、ホストコンピュータ10で生成される画像、すなわち入力データ格納領域261aで最も上の最も左側の方向である。このようにラスタ方向に探索することで、CC法により円状に成長した2つのセルの中間にすぐ下にセルが配置されるようになる。そのセルの重心位置にドットを打てば、印刷用紙全体として見ると、上の行のドット間の真ん中あたりに下の行のドットが配置されるように構成される。すなわち、全体的にドットが斜め方向に形成されるのである。このように配列されたドットは視覚的に目立ちにくく快適な印刷出力を得ることができる。上の行のドットと下の行のドットとが鉛直方向で同じ位置に配置されている場合はドットが正確に並びすぎて却ってドットが視覚的に目立ってしまう。このようなドットの配列を防止するためにラスタ方向に探索するのである。図12(b)の例では、ラスタ方向に探索すると、入力データ領域261aの(0,0)に位置する画素が未処理画素となる(図12(c)の入力データ領域261a参照)。よって、CPU24は初期画素として(0,0)に位置する画素を選択する。なお、CPU24はCC法による処理を行った画素に対して“−1”を入力データ領域261aの当該画素位置に格納していく。以後の処理でセルを構成する未処理画素として選択されないようにするためである。よって、ラスタ方向に探索して未処理画素か否かは、選択した画素位置に“−1”が格納されているか否かで判断される。   Returning to FIG. 6, the CPU 24 then determines an initial pixel and sets the reference point to the coordinates of the initial pixel (step S11). When determining the initial pixel, the CPU 24 searches the input data area 261a in the raster direction. Here, the raster direction is an image generated by the host computer 10, that is, the uppermost leftmost direction in the input data storage area 261a. By searching in the raster direction in this way, a cell is arranged immediately below between the two cells grown in a circular shape by the CC method. If dots are hit at the center of gravity of the cell, the dot in the lower row is arranged around the middle between the dots in the upper row when viewed as the whole printing paper. That is, the dots are formed in an oblique direction as a whole. The dots arranged in this way are visually inconspicuous and can provide a comfortable print output. If the dots in the upper row and the dots in the lower row are arranged at the same position in the vertical direction, the dots are arranged too accurately and the dots are visually noticeable. In order to prevent such dot arrangement, the search is performed in the raster direction. In the example of FIG. 12B, when searching in the raster direction, the pixel located at (0, 0) in the input data area 261a becomes an unprocessed pixel (see the input data area 261a in FIG. 12C). Therefore, the CPU 24 selects the pixel located at (0, 0) as the initial pixel. The CPU 24 stores “−1” at the pixel position in the input data area 261a for the pixel that has been processed by the CC method. This is to prevent the subsequent process from being selected as an unprocessed pixel constituting the cell. Therefore, whether or not the pixel is an unprocessed pixel searched in the raster direction is determined based on whether or not “−1” is stored in the selected pixel position.

さらにCPU24は、本ステップS11において重心位置を演算する。画素選択のためと、最後にセル内にドットを打つ処理を行うためである。この重心位置の演算には、以下に示す演算式を用いる。
(式1)
重心={{(セルの重心のx座標)×(セルの階調値の合計)}
+{(選択した未処理画素のx座標)×(選択した未処理画素の階調値)}}
/(セルの階調値の合計+選択した未処理画素の階調値)
重心={{(セルの重心のy座標)×(セルの階調値の合計)}
+{(選択した未処理画素のy座標)×(選択した未処理画素の階調値)}}
/(セルの階調値の合計+選択した未処理画素の階調値)
(x重心、y重心は重心位置の座標)
この演算式はROM25に格納され、重心位置の演算のときにCPU24がROM25から読み出して演算を行うことになる。ちなみに、初期画素の場合は、(式1)においてセルの重心のx、y座標、及びセルの階調値の合計はともに0として演算される。なお、セルとは、上述したように複数の画素から構成される画素群で、上式で“セルの重心”とあるのは、これまで構成したセルの重心のことである。初期画素の場合の重心を演算すると、x重心=0、y重心=0となる。本ステップS11で演算した重心位置は、CPU24によってワーキングメモリ270の領域270aに格納されることになる(図13(a)の領域270a参照)。また、CPU24は、階調値の合計値、この場合は(0,0)の画素のみ選択したので当該画素の階調値“20”も領域270aに格納される。
Further, the CPU 24 calculates the position of the center of gravity in this step S11. This is for the purpose of pixel selection and finally the process of placing dots in the cell. The calculation formula shown below is used for the calculation of the center of gravity position.
(Formula 1)
x centroid = {{(x coordinate of centroid of cell) × (sum of cell gradation values)}
+ {(X coordinate of selected unprocessed pixel) × (tone value of selected unprocessed pixel)}}
/ (Total tone value of cells + tone value of selected unprocessed pixel)
y centroid = {{(y coordinate of the centroid of the cell) × (total sum of cell gradation values)}
+ {(Y coordinate of selected unprocessed pixel) × (tone value of selected unprocessed pixel)}}
/ (Total tone value of cells + tone value of selected unprocessed pixel)
(X center of gravity , y center of gravity are coordinates of the center of gravity)
This calculation formula is stored in the ROM 25, and the CPU 24 reads out from the ROM 25 and performs the calculation when calculating the position of the center of gravity. Incidentally, in the case of the initial pixel, the sum of the x and y coordinates of the center of gravity of the cell and the gradation value of the cell is calculated as 0 in (Equation 1). Note that a cell is a group of pixels composed of a plurality of pixels as described above, and the “cell centroid” in the above equation is the centroid of the cell constructed so far. When the centroid for the initial pixel is calculated, x centroid = 0 and y centroid = 0. The center-of-gravity position calculated in step S11 is stored in the area 270a of the working memory 270 by the CPU 24 (see the area 270a in FIG. 13A). Further, since the CPU 24 selects only the total value of the gradation values, in this case, the pixel of (0, 0), the gradation value “20” of the pixel is also stored in the area 270a.

さらに、CPU24は本ステップS11において、セルを構成する画素の階調値の最大値(max)、最小値(min)、その選択画素の平均階調値(mean)を各領域270b、270cに格納する。図13(a)の例では、1つの画素(0,0)のみしか選択していないので、最大値“20”、最小値“20”、平均階調値“20”が各領域270b、270cに格納されることになる。   Further, in this step S11, the CPU 24 stores the maximum gradation value (max) and minimum value (min) of the gradation values of the pixels constituting the cell and the average gradation value (mean) of the selected pixel in each of the areas 270b and 270c. To do. In the example of FIG. 13A, since only one pixel (0, 0) is selected, the maximum value “20”, the minimum value “20”, and the average gradation value “20” are the respective regions 270b and 270c. Will be stored.

また、CPU24はセルを構成する画素を選択すると、上述したように以後未処理画素として選択されないようにするために“−1”をその画素位置に格納する。図13(a)の入力データ領域261aに示すように、初期画素として(0,0)に位置する画素を選択したので、CPU24はこの画素位置に“−1”を格納することになる。以上が、CPU24が本ステップS11で行う処理である。   Further, when the CPU 24 selects a pixel constituting the cell, as described above, the CPU 24 stores “−1” in the pixel position so that it is not selected as an unprocessed pixel thereafter. As shown in the input data area 261a of FIG. 13A, since the pixel located at (0, 0) is selected as the initial pixel, the CPU 24 stores “−1” at this pixel position. The above is the processing performed by the CPU 24 in step S11.

図6に戻り、次いでCPU24は決定した初期画素が低濃度か否か判断する(ステップS12)。低濃度の場合とは、選択画素で黒成分が少なく白成分が多い場合である。高濃度の場合とは選択画素で黒成分が多く白成分が多い場合である。かかる低濃度と高濃度の画素に対して全く同じように処理を行うことは必ずしも好ましいことではない。すなわち、高濃度の成分に対して、低濃度と同様に閾値に達するまでセルを構成するように処理を進めると、すぐに閾値に達してしまいセルの大きさを確保することができず、隣り合ったセルどうしでドットが隣接して発生してしまう。このようなドットは印刷出力全体として目立ちやすく、快適な印刷出力を得られない。そこで、黒成分が多い画素と白成分が多い画素とを分けて処理を進めるのである。この判断は、CPU24がROM25内に格納された所定値(本実施例では“127”)を読出し、選択画素の階調値がその値より大きいか小さいかで判断する。図13(a)の例では、(0,0)の画素の階調値“20”は所定値“127”より小さい値なので、低濃度と判定され(ステップS12で“YES”)、ステップS13に移行する。なお、高濃度の場合(ステップS12で“NO”)は白濃度処理(ステップS24)に移行するがその詳細は後述する。   Returning to FIG. 6, the CPU 24 then determines whether or not the determined initial pixel has a low density (step S12). The case of low density is a case where the selected pixel has a small black component and a large white component. The case of high density is a case where the selected pixel has a large amount of black component and a large amount of white component. It is not always preferable to perform the same processing on the low density and high density pixels. That is, if processing is performed to configure a cell until a threshold value is reached for a high concentration component as in the case of a low concentration, the threshold value is reached immediately, and the cell size cannot be secured, so that Dots occur adjacent to each other in matched cells. Such dots are conspicuous as a whole print output, and a comfortable print output cannot be obtained. Therefore, the process proceeds separately for pixels with a large black component and pixels with a large white component. In this determination, the CPU 24 reads a predetermined value (“127” in this embodiment) stored in the ROM 25, and determines whether the gradation value of the selected pixel is larger or smaller than that value. In the example of FIG. 13A, since the gradation value “20” of the pixel (0, 0) is smaller than the predetermined value “127”, it is determined to be low density (“YES” in step S12), and step S13. Migrate to In the case of high density (“NO” in step S12), the process proceeds to white density processing (step S24), the details of which will be described later.

図6に戻り、次いでCPU24は、未処理画素の選択を行う(ステップS13)。未処理画素の選択は、ワーキングメモリ270に格納した重心位置の座標に最も近い位置にある画素を選択する。重心を利用してセルを構成する未処理画素を選択するため、上述したようにセルは円状になりやすく、その重心にドットを形成させることで、ドット間距離が一定で快適な印刷出力を得ることができるのである。図13(a)の例では、ワーキングメモリ領域270の領域270aに重心位置x重心=0、y重心=0が格納されているので、この位置から最も近い画素位置を選択することになる。この例の場合に、重心位置に最も近い画素としては、(1,0)と(0,1)に位置する2つの画素が存在する。この場合CPU24は、ランダムにいずれか1つの画素を選択することにする。固定順(例えば次に選択すべき未処理画素は右隣の画素、次に選択すべき画素はその画素の下にある画素など)に選択すると、最終的に構成されるセルが規則的に並びすぎることによって、印刷出力のある領域でドットが周期的に発生する周期パターンが生じることになる。このようなパターンは視覚に入り易く快適な印刷出力を得ることができない。このような理由から、選択すべき画素が複数あれば、ランダムに選択するのである。図13(a)の例では、CPU24は、(1,0)に位置する画素をランダムに未処理画素として選択することにする(図13(b)の入力データ領域261a参照)。 Returning to FIG. 6, the CPU 24 then selects an unprocessed pixel (step S13). The unprocessed pixel is selected by selecting a pixel at a position closest to the coordinates of the barycentric position stored in the working memory 270. Since the unprocessed pixels that make up the cell are selected using the center of gravity, as described above, the cell tends to be circular, and by forming dots at the center of gravity, a comfortable print output with a constant distance between dots is possible. You can get it. In the example of FIG. 13A, since the barycentric position x barycenter = 0 and y barycenter = 0 are stored in the area 270a of the working memory area 270, the pixel position closest to this position is selected. In this example, there are two pixels located at (1, 0) and (0, 1) as the pixels closest to the center of gravity. In this case, the CPU 24 selects any one pixel at random. When selected in a fixed order (for example, the unprocessed pixel to be selected next is the pixel on the right, the pixel to be selected next is the pixel below the pixel, etc.), the cells that are finally configured are regularly arranged. If it is too large, a periodic pattern in which dots are periodically generated in a certain area of print output is generated. Such a pattern is easily visible and a comfortable print output cannot be obtained. For this reason, if there are a plurality of pixels to be selected, they are selected at random. In the example of FIG. 13A, the CPU 24 randomly selects a pixel located at (1, 0) as an unprocessed pixel (see the input data area 261a in FIG. 13B).

図6に戻り、次いでCPU24は閾値制御処理を行う(ステップS14)。セルを構成するための閾値を変化させることで、滑らかな階調を表現するとともにエッジの再現性を高めるためである。図8に閾値制御処理のフローチャートを示す。   Returning to FIG. 6, the CPU 24 then performs a threshold control process (step S14). This is because by changing the threshold value for configuring the cell, smooth gradation is expressed and edge reproducibility is enhanced. FIG. 8 shows a flowchart of the threshold control process.

まず、CPU24は本処理(ステップS14)に移行すると新たに選択した画素を含めた最大値と最小値、及び平均階調値を演算する(ステップS141)。図13(a)の例では、新たに(1,0)の画素を未処理画素として選択した(ステップS13)ので、この画素を含めたセル内の最大値等を演算する。この場合、選択画素(1,0)の階調値は“20”なので、最大値は“20”、最小値も“20”、そして平均階調値も“20”(=(20+20)/2)となり、これらの値をCPU24は各領域270b、270cに格納することになる(図13(b)の領域270b、270c参照)。   First, when proceeding to this process (step S14), the CPU 24 calculates the maximum value, the minimum value, and the average gradation value including the newly selected pixel (step S141). In the example of FIG. 13A, since a new pixel (1,0) is selected as an unprocessed pixel (step S13), the maximum value in the cell including this pixel is calculated. In this case, since the gradation value of the selected pixel (1, 0) is “20”, the maximum value is “20”, the minimum value is “20”, and the average gradation value is “20” (= (20 + 20) / 2. The CPU 24 stores these values in the areas 270b and 270c (see the areas 270b and 270c in FIG. 13B).

次いでCPU24は、セルの平均階調値を引数とする関数により画素を選択するための閾値を変更する(ステップS142)。平均階調値が高いとき、閾値となるまで画素を選択するとすぐに閾値に達してしまい上述したようにドットが密集することで粒状的なドットを発生させてしまう。滑らかな階調を表現するために閾値を変更するのである。本実施例では、平均階調値(mean)が“30”より小さいときは閾値は“255”、“30”以上で“80”よりも小さいとき閾値を“510”に変更し、さらに“80”以上のときは“765”に変更する。もちろん、これは一例でこれ以外の平均値の値でもよいし、これ以外の閾値でもよい。また、3段階で閾値を設定するようにしているが、2段階に設定しても、4段階以上であってもよい。粒状的なドットを発生させないように、画像出力装置20ごとにその値を設定すればよい。この場合の関数の一例を図23に示す。この関数は、いわゆるプログラム上の読出し関数(threshold())である。この図に示すように平均階調値(mean)の値によって出力する閾値(threshold)を変化させている。もちろん、関数として数式を用いた演算式によって閾値を変化させてもよい。例えば、以下の演算式である。
(式2)
threshold = (2+75×(階調値の合計値)/(選択画素数)/255)×255(thresholdは閾値)
この式で、“2”は画像出力装置20の特性に合わせた特性値を示し、“75”は閾値を線形に変化させるための係数である。(階調値の合計値)/(選択画素数)で平均階調値を表すことになる。この関数も平均階調値が高いほど閾値も高くなるように設定されている。なお、この演算式及び図23に示した呼び出し関数ともにROM25等に格納され、CPU24が本処理(ステップS14)の際に適宜読み出して実行することで、各値が得られる。すなわち図13(b)に示すように、ステップS141で領域270cに格納した平均階調値“20”を読出して、(式2)や呼び出し関数(threshold())に代入等することで、閾値“255”を得て、領域270dにCPU24によって再び格納されることになる。
Next, the CPU 24 changes a threshold value for selecting a pixel by a function using the average gradation value of the cell as an argument (step S142). When the average gradation value is high, the threshold value is reached as soon as the pixel is selected until the threshold value is reached, and as described above, the dots are densely formed and granular dots are generated. The threshold value is changed in order to express a smooth gradation. In this embodiment, when the average gradation value (mean) is smaller than “30”, the threshold is changed to “255”, when the average gradation value (mean) is greater than “30” and smaller than “80”, the threshold is changed to “510”. If it is above, change it to “765”. Of course, this is an example, and other average values may be used, or other threshold values may be used. Further, the threshold value is set in three stages, but it may be set in two stages or four or more stages. The value may be set for each image output device 20 so as not to generate granular dots. An example of the function in this case is shown in FIG. This function is a so-called program read function (threshold ()). As shown in this figure, the output threshold value (threshold) is changed according to the value of the average gradation value (mean). Of course, the threshold value may be changed by an arithmetic expression using a mathematical expression as a function. For example, the following arithmetic expression.
(Formula 2)
threshold = (2 + 75 × (total value of gradation values) / (number of selected pixels) / 255) × 255 (threshold is a threshold value)
In this equation, “2” indicates a characteristic value that matches the characteristic of the image output apparatus 20, and “75” is a coefficient for linearly changing the threshold value. The average gradation value is expressed by (total gradation value) / (number of selected pixels). This function is also set so that the threshold value increases as the average gradation value increases. It should be noted that both the equation and the calling function shown in FIG. 23 are stored in the ROM 25 and the like, and each value is obtained by the CPU 24 reading and executing it appropriately during this processing (step S14). That is, as shown in FIG. 13B, the average gradation value “20” stored in the region 270c in step S141 is read and substituted into (Equation 2) or the calling function (threshold ()), etc. “255” is obtained and stored in the area 270d by the CPU 24 again.

図8に戻り、次いでCPU24は画素群であるセル内の階調値の最大値と最小値の差が所定値よりも大きいか否か判断する(ステップS143)。上述したように入力階調値の差からエッジの領域であるか否かを検出するためである。ステップS141で最大階調値、最小階調値ともに領域270bに格納されているので、CPU24はこの値を領域270bから読み出すことによって処理を行う。本実施例では所定値として“50”を設定し、ROM25に格納されているものとする。図13(b)の例では、最大値“20”、最小値“20”でその差は“0”よって所定値“50”よりも小さいので本ステップS143で“NO”が選択され閾値制御処理が終了して図6のステップS15に移行する。なお、本ステップS143で所定値よりも大きいとき(“YES”のとき)、閾値を下げる処理を行う(ステップS144)がその詳細は後述する。   Returning to FIG. 8, next, the CPU 24 determines whether or not the difference between the maximum value and the minimum value of the gradation values in the cell which is the pixel group is larger than a predetermined value (step S143). This is for detecting whether or not the region is an edge region from the difference in input gradation values as described above. Since both the maximum gradation value and the minimum gradation value are stored in the area 270b in step S141, the CPU 24 performs processing by reading out these values from the area 270b. In this embodiment, it is assumed that “50” is set as the predetermined value and is stored in the ROM 25. In the example of FIG. 13B, the difference between the maximum value “20” and the minimum value “20” is “0”, which is smaller than the predetermined value “50”. Therefore, “NO” is selected in this step S143 and the threshold value control process is performed. Is completed and the process proceeds to step S15 in FIG. Note that when the value is larger than the predetermined value in this step S143 (“YES”), a process of lowering the threshold value (step S144) will be described in detail later.

図6に戻り、閾値制御処理が終了するとCPU24は階調値の合計が閾値を超えるか否か判断する(ステップS15)。閾値制御処理(ステップS14)で変更した閾値に基づき、セルを構成する画素を閾値に達するまで選択するためである。図13(b)の例では、セルを構成する画素の階調値の合計は、(0,0)と(1,0)の画素の階調値の合計値である“40”となり、閾値である“255”を超えない。よって本ステップS15で“NO”が選択され、ステップS16に移行する。   Returning to FIG. 6, when the threshold control process is completed, the CPU 24 determines whether or not the sum of the gradation values exceeds the threshold (step S15). This is because the pixels constituting the cell are selected until the threshold value is reached based on the threshold value changed in the threshold value control process (step S14). In the example of FIG. 13B, the sum of the gradation values of the pixels constituting the cell is “40”, which is the sum of the gradation values of the (0, 0) and (1, 0) pixels. Does not exceed “255”. Therefore, “NO” is selected in step S15, and the process proceeds to step S16.

ステップS16でCPU24は、未処理画素を含めた基準点、すなわち重心位置の演算を行う。未処理画素として選択(ステップS13)した画素を含めたセルの重心位置を更新するためである。重心位置の演算は、上述した(式1)を用いる。図13(b)の例で重心位置を演算すると、x重心=0.5、y重心=0を得て、メモリ領域270の領域270aにCPU24によって格納されることになる(同図の領域270a参照)。 In step S16, the CPU 24 calculates a reference point including unprocessed pixels, that is, the position of the center of gravity. This is because the barycentric position of the cell including the pixel selected as an unprocessed pixel (step S13) is updated. The calculation of the center of gravity position uses the above-described (Equation 1). When the center-of-gravity position is calculated in the example of FIG. 13B, x- centroid = 0.5 and y- centroid = 0 are obtained and stored in the area 270a of the memory area 270 by the CPU 24 (area 270a in FIG. 13B). reference).

次いでCPU24は、階調値の合計を演算してワーキングメモリ270の領域270aに格納する(ステップS17)。図13(b)の示すように選択画素((0,0)と(1,0))の階調値の合計は“40”なので、この値が領域270aに格納されることになる。また、CPU24は、ステップS13で未処理画素として選択した画素の入力データ領域261aの位置に“−1”を格納する(同図の入力データ領域261a参照)。以後の処理で未処理画素として選択されないようにするためである。さらに、CPU24は、対応する出力データ領域261bの画素位置(1,0)にドットを打たないことを示す値(ここでは“0”)を格納する(同図出力データ領域261b参照)。   Next, the CPU 24 calculates the total of the gradation values and stores it in the area 270a of the working memory 270 (step S17). As shown in FIG. 13B, since the sum of the gradation values of the selected pixels ((0, 0) and (1, 0)) is “40”, this value is stored in the area 270a. Further, the CPU 24 stores “−1” in the position of the input data area 261a of the pixel selected as the unprocessed pixel in step S13 (see the input data area 261a in FIG. 5). This is to prevent selection as an unprocessed pixel in subsequent processing. Further, the CPU 24 stores a value (in this case, “0”) indicating that a dot is not placed at the pixel position (1, 0) of the corresponding output data area 261b (see the output data area 261b in the figure).

次いでCPU24は、ワーキングメモリ270の領域270aに格納した階調値の合計が閾値と等しいか否か判断する(ステップS18)。階調値の合計と閾値はそれぞれ領域270a、270dに格納されているのでこれらの値をCPU24が適宜読み出し比較することで処理が行われる。図13(b)の例では、階調値の合計は“40”、閾値は“255”で等しくないため本ステップS18で“NO”が選択され、再びステップS13に移行する。   Next, the CPU 24 determines whether or not the sum of the gradation values stored in the area 270a of the working memory 270 is equal to the threshold value (step S18). Since the sum of the gradation values and the threshold value are stored in the areas 270a and 270d, respectively, the CPU 24 reads and compares these values as appropriate for processing. In the example of FIG. 13B, the sum of the gradation values is “40”, and the threshold value is “255”, so that “NO” is selected in step S18, and the process proceeds to step S13 again.

そして、CPU24は選択した画素の階調値の合計が閾値と等しい(ステップS18で“YES”)か、閾値を超える(ステップS15)まで、未処理画素を選択していく。図13(c)の例は、セルを構成する画素として4つの画素((0,0)、(1,0)、(0,1)、及び(1,1)の画素)を選択してステップS18に移行したときの状態を示す。ここまでは、階調値の合計は“80”、選択画素の階調値はすべて同じ値のためその最大値、最小値、平均階調値ともに“20”、閾値も平均階調値が“20”のままで“30”以上となっていないため“255”のままである。また、重心位置は(式1)により演算した結果、(0.5,0.5)となる(同図の領域270a〜270d参照)。ステップS18でCPU24は、階調値の合計“80”は閾値“255”と等しくないため本ステップで“NO”が選択され再び未処理画素の選択を行う(ステップS13)。   Then, the CPU 24 selects unprocessed pixels until the sum of the gradation values of the selected pixels is equal to the threshold (“YES” in step S18) or exceeds the threshold (step S15). In the example of FIG. 13C, four pixels (pixels (0, 0), (1, 0), (0, 1), and (1, 1)) are selected as the pixels constituting the cell. The state when the process proceeds to step S18 is shown. Up to this point, the total of the gradation values is “80”, and the gradation values of the selected pixels are all the same value, so that the maximum value, the minimum value, and the average gradation value are both “20”, and the average gradation value is also “ “20” remains “255” because it is not “30” or more. Further, the position of the center of gravity is (0.5, 0.5) as a result of calculation according to (Equation 1) (see regions 270a to 270d in the same figure). In step S18, the CPU 24 selects “NO” in this step because the total tone value “80” is not equal to the threshold value “255”, and selects an unprocessed pixel again (step S13).

図13(c)に示すように4つの画素を選択した後、重心位置(0.5,0.5)に最も近い画素として、(2,0)、(2,1)、(1,2)、(0,2)に位置する4つの画素があるがランダムに(2,0)の画素を選択するものとする(ステップS13、図14(a)の入力データ領域261a参照)。そして閾値制御処理(ステップS14)に移行するが、ステップS141にて選択画素(2,0)の階調値が“25”のため、セルを構成する画素の階調値の最大値が“25”、さらに平均階調値も“21”(=(80+25)/5)に更新される(図14(b)の領域270b、270c参照)。   As shown in FIG. 13C, after selecting four pixels, the pixels closest to the center of gravity (0.5, 0.5) are (2, 0), (2, 1), (1, 2 ), There are four pixels located at (0, 2), but the pixel of (2, 0) is selected at random (see step S13, input data area 261a in FIG. 14A). Then, the process proceeds to threshold value control processing (step S14). Since the gradation value of the selected pixel (2, 0) is “25” in step S141, the maximum gradation value of the pixels constituting the cell is “25”. Furthermore, the average gradation value is also updated to “21” (= (80 + 25) / 5) (see the areas 270b and 270c in FIG. 14B).

次いでCPU24は閾値の変更処理を行う(ステップS142)が、平均階調値は“21”で“30”以下となるので、閾値は変更されず“255”を領域270dに格納することになる。そして、階調値の最大値“25”と最小値“20”の差は“5”で所定値である“50”以下である。従ってステップS143で“NO”が選択され、閾値を下げることはせずに閾値制御処理は終了することになる。   Next, the CPU 24 performs a threshold value changing process (step S142). However, since the average gradation value is “21” and “30” or less, the threshold value is not changed and “255” is stored in the area 270d. The difference between the maximum value “25” and the minimum value “20” of the gradation value is “5”, which is equal to or less than the predetermined value “50”. Therefore, “NO” is selected in step S143, and the threshold value control process ends without lowering the threshold value.

その後、階調値の合計は“105”なのでステップS15で“NO”が選択され、CPU24は重心位置を演算し(ステップS16)、階調値の演算(ステップS17)を行い、図14(b)の領域270aに示す値を得る。また、CPU24は当該画素位置(2,0)で入力データ領域261aに“−1”を格納し、出力データ領域261bに“0”を格納することになる(図14(b)の入力、出力各データ領域261a、261b参照)。この場合でも階調値の合計“105”は、閾値“255”以下なのでステップS18で“NO”が選択され、再び未処理画素を選択することになる(ステップS13)。   After that, since the total of the gradation values is “105”, “NO” is selected in step S15, and the CPU 24 calculates the position of the center of gravity (step S16), calculates the gradation value (step S17), and FIG. ) Is obtained in the area 270a. Further, the CPU 24 stores “−1” in the input data area 261a and stores “0” in the output data area 261b at the pixel position (2, 0) (input and output in FIG. 14B). (Refer to each data area 261a, 261b). Even in this case, since the total tone value “105” is equal to or smaller than the threshold value “255”, “NO” is selected in step S18, and an unprocessed pixel is selected again (step S13).

以後、図14(c)から順に説明すると、次にCPU24は未処理画素として(2,1)を選択する(ステップS13)。当該画素の階調値は“25”で、最大値はかわらず、平均階調値は“21.7”(≒(105+25)/6)に更新される(図14(c)メモリ領域270参照)。よって“30”以下なので閾値の変更はなく、また閾値を下げることもない。このときのセルを構成する画素の階調値の合計は、“130”で閾値“255”に達しないのでステップS18で“NO”が選択され再び未処理画素の選択を行う(ステップS13)。   Hereinafter, in order from FIG. 14C, the CPU 24 next selects (2, 1) as an unprocessed pixel (step S13). The gradation value of the pixel is “25” and the average gradation value is updated to “21.7” (≈ (105 + 25) / 6) regardless of the maximum value (see the memory area 270 in FIG. 14C). ). Therefore, since it is “30” or less, the threshold value is not changed and the threshold value is not lowered. At this time, since the sum of the gradation values of the pixels constituting the cell is “130” and does not reach the threshold value “255”, “NO” is selected in step S18 and the unprocessed pixel is selected again (step S13).

次にCPU24は、未処理画素として図15(a)に示すように、重心位置に最も近い画素として(1,2)を選択する。当該画素の階調値は“20”、平均階調値は“21.4”(≒(130+20)/7)となる。平均階調値は“30”以下なので閾値の変更はなく、また最大、最小の差も“50”以下なので閾値を下げる処理も行われない。   Next, as shown in FIG. 15A, the CPU 24 selects (1, 2) as the pixel closest to the barycentric position as the unprocessed pixel. The gradation value of the pixel is “20”, and the average gradation value is “21.4” (≈ (130 + 20) / 7). Since the average gradation value is “30” or less, the threshold value is not changed, and since the maximum and minimum difference is also “50” or less, the threshold value is not reduced.

かかる処理を繰り返すことで、図15(b)の状態となる。これは、これまで選択した画素の階調値の合計が“250”で、閾値である“255”に達する直前の状態である。この状態での重心位置、最大値、最小値、平均階調値、閾値は図15(b)のメモリ270の各領域270a〜270dに示す値となっている。この状態のときも、階調値の合計は閾値と等しくないためステップS18で“NO”が選択され、再び未処理画素の選択を行う(ステップS13)。   By repeating such processing, the state shown in FIG. This is the state immediately before the sum of the gradation values of the pixels selected so far is “250” and reaches the threshold value “255”. The barycentric position, maximum value, minimum value, average gradation value, and threshold value in this state are values shown in the respective areas 270a to 270d of the memory 270 in FIG. Even in this state, since the sum of the gradation values is not equal to the threshold value, “NO” is selected in step S18, and the unprocessed pixel is selected again (step S13).

CPU24はステップS13において、領域270aに格納された重心位置から、この位置に最も近い画素を選択する。複数あればランダムに選択する。図15(c)に示すように、CPU24は(2,3)に位置する画素を選択するものとする。当該画素の階調値は“25”なので、最大値は“25”のまま、平均階調値は“22.7”となる(ステップS141)。“30”以下なので閾値の変更は行われず(ステップS142)、また最大値と最小値の差も“50”以下なので、閾値を下げる処理も行われず(ステップS143で“NO”が選択)、ステップS15に移行する。   In step S13, the CPU 24 selects a pixel closest to this position from the barycentric positions stored in the area 270a. If there are multiple, select randomly. As shown in FIG. 15C, the CPU 24 selects the pixel located at (2, 3). Since the gradation value of the pixel is “25”, the maximum value remains “25” and the average gradation value becomes “22.7” (step S141). Since it is “30” or less, the threshold value is not changed (step S142), and since the difference between the maximum value and the minimum value is “50” or less, the threshold value is not reduced (“NO” is selected in step S143). The process proceeds to S15.

ステップS15においてCPU24は、階調値の合計は最後に選択した画素を含めると“275”(=250+25)となるため閾値“255”を超えることになるため、本ステップで“YES”が選択され閾値を超えた場合の演算処理(ステップS22)に移行することになる。本処理のフローチャートを図9に示す。   In step S15, the CPU 24 adds “275” (= 250 + 25) to the total of the gradation values and exceeds the threshold value “255”. Therefore, “YES” is selected in this step. The process proceeds to the calculation process (step S22) when the threshold value is exceeded. A flowchart of this process is shown in FIG.

本処理に移行するとまずCPU24は、閾値から濃度の合計、すなわちこれまで構成したセルの階調値の合計の減算処理を行う(ステップS221)。図15(c)の例では、閾値“255”からこれまでの階調値の合計“250”を減算すると“5”を得る。上述したようにこれまで選択した画素の階調値の合計は領域270aに格納されているので、CPU24は適宜この領域270aから値を読み出すことで処理が行われる。   When shifting to this process, the CPU 24 first performs a subtraction process of the sum of the density from the threshold, that is, the sum of the gradation values of the cells configured so far (step S221). In the example of FIG. 15C, “5” is obtained by subtracting the total “250” of the gradation values so far from the threshold “255”. As described above, since the total of the gradation values of the pixels selected so far is stored in the area 270a, the CPU 24 performs processing by appropriately reading the values from the area 270a.

次いでCPU24は、このステップS221で減算した値を最後に選択した画素の階調値として重心位置の演算を行う(ステップS222)。すなわち、最後に選択した画素の階調値をそのまま用いると閾値を超えてしまうので、閾値と丁度等しくなる値を当該画素の階調値として重心演算を行うのである。演算式は以下の式を用いる。
(式3)
重心={{(セルの重心のx座標)×(セルの階調値の合計)}
+{(選択した未処理画素のx座標)×(閾値までに必要な階調値)}}
/(セルの階調値の合計+閾値まで必要な階調値)
重心={{(セルの重心のy座標)×(セルの階調値の合計)}
+{(選択した未処理画素のy座標)×(閾値までに必要な階調値)}}
/(セルの階調値の合計+閾値まで必要な階調値)
(x重心、y重心は重心位置の座標)
(式1)との違いは、選択した未処理画素の階調値をそのまま用いるのではなく、セルの階調値の合計が閾値と同じになる値(“閾値までに必要な階調値”)を用いる点が異なる。この演算式は、(式1)の場合と同様に予めROM25に格納されており、CPU24が本ステップを実行する際にROM25から読み出すことで処理される。図15(c)の例で演算すると、重心位置はx重心≒1.75、y重心≒0.96となる。演算した重心位置は、CPU24の制御によりワーキングメモリ270の領域270aに格納される(図15(c)の領域270a参照)。そして、CPU24は閾値を超えた場合の階調値演算処理を終了させ、図7のステップS23に移行する。
Next, the CPU 24 calculates the gravity center position using the value subtracted in step S221 as the gradation value of the pixel selected last (step S222). That is, if the gradation value of the last selected pixel is used as it is, the threshold value is exceeded, so that the centroid calculation is performed with the value just equal to the threshold value as the gradation value of the pixel. The following formula is used as the arithmetic expression.
(Formula 3)
x centroid = {{(x coordinate of centroid of cell) × (sum of cell gradation values)}
+ {(X coordinate of selected unprocessed pixel) × (gradation value necessary until threshold)}}
/ (Total tone value of cells + required tone value up to threshold)
y centroid = {{(y coordinate of the centroid of the cell) × (total sum of cell gradation values)}
+ {(Y coordinate of selected unprocessed pixel) × (gradation value necessary until threshold)}}
/ (Total tone value of cells + required tone value up to threshold)
(X center of gravity , y center of gravity are coordinates of the center of gravity)
The difference from (Equation 1) is that the gradation value of the selected unprocessed pixel is not used as it is, but the value in which the sum of the gradation values of the cells is the same as the threshold value (“the gradation value necessary until the threshold value”). ) Is different. This arithmetic expression is stored in advance in the ROM 25 as in the case of (Expression 1), and is processed by being read from the ROM 25 when the CPU 24 executes this step. When calculating in the example of FIG. 15C, the center-of-gravity positions are x- centroid≈1.75 and y- centroid≈0.96 . The calculated barycentric position is stored in the area 270a of the working memory 270 under the control of the CPU 24 (see the area 270a in FIG. 15C). Then, the CPU 24 ends the gradation value calculation process when the threshold value is exceeded, and proceeds to step S23 in FIG.

ステップS23でCPU24は、残った階調値を未処理画素に戻す処理を行う。図15(c)の例では、最後に選択した画素(2,3)の階調値は“25”、重心演算の際に“5”の階調値として演算したので、減算した“20”(=25−5)を入力データ領域261aの当該画素位置(2,3)に戻すことになる(同図の入力データ領域261a参照)。セルを構成する画素以外の画素に戻すことも考えられるが、それではその画素の階調値でない値を有することになるので、入力階調値に忠実なドットを生成させることができない。よって、最後に選択した画素に減算後の値を戻し、以後再び未処理画素として選択できるようにするのである。またCPU24は、選択した未処理画素の対応する出力データ領域261bに“0”を格納する。図15(c)の出力データ領域261bに示すように、この例では(2,3)に“0”が格納される。   In step S <b> 23, the CPU 24 performs processing for returning the remaining gradation values to the unprocessed pixels. In the example of FIG. 15C, the gradation value of the pixel (2, 3) selected last is “25”, and is calculated as a gradation value of “5” in the centroid calculation. (= 25-5) is returned to the pixel position (2, 3) in the input data area 261a (refer to the input data area 261a in the figure). Although it is conceivable to return to a pixel other than the pixels constituting the cell, it has a value that is not the gradation value of that pixel, so that it is not possible to generate a dot that is faithful to the input gradation value. Therefore, the value after subtraction is returned to the last selected pixel so that it can be selected again as an unprocessed pixel. Further, the CPU 24 stores “0” in the output data area 261b corresponding to the selected unprocessed pixel. As shown in the output data area 261b of FIG. 15C, “0” is stored in (2, 3) in this example.

そしてCPU24は、重心位置に黒ドットを生成させる処理を行う(ステップS23)。すなわち、ワーキングメモリ270の領域270aにはこれまで構成したセルの重心位置が格納されているのでCPU24がこの値を読出し、出力データ領域261bの重心位置の存在する画素位置に“255”を格納することになる。図15(c)の例では、これまで演算した重心位置(1.75、0.96)がメモリ270に格納されているので、この位置にある出力データ領域261bの画素(2,1)にドット生成を示す“255”を格納することになる(図16(a)の出力データ領域261b参照)。そして、処理はステップS20に移行する。   And CPU24 performs the process which produces | generates a black dot in a gravity center position (step S23). That is, since the centroid position of the cell configured so far is stored in the area 270a of the working memory 270, the CPU 24 reads this value and stores “255” at the pixel position where the centroid position exists in the output data area 261b. It will be. In the example of FIG. 15C, since the center of gravity position (1.75, 0.96) calculated so far is stored in the memory 270, the pixel (2, 1) of the output data area 261b at this position is stored. “255” indicating dot generation is stored (see the output data area 261b in FIG. 16A). Then, the process proceeds to step S20.

一方、ステップS18で閾値と等しい場合(“YES”の場合)も、すでにセルを構成する階調値の合計が閾値に達したことになるので、同様に重心位置に黒ドットを生成する処理(ステップS19)を行うことになる。そして、同様にステップS20に処理は移行する。   On the other hand, also in the case where it is equal to the threshold value in the step S18 (in the case of “YES”), since the sum of the gradation values already constituting the cell has reached the threshold value, similarly, a process of generating black dots at the center of gravity position ( Step S19) will be performed. Similarly, the process proceeds to step S20.

ステップS20においてCPU24は、未処理画素があるか否か判断する。図16(a)の例では、これまで1つのセルを構成しその重心位置に黒ドットを発生させるように処理を行ったことになるので、再び未処理画素を探索してセルを構成していくのである。なお、未処理画素か否かの判断は、入力データ領域261aで処理済みの画素には“−1”が格納されているので、すべての画素位置で“−1”が格納されたか否かで判断することができる。図16(a)の例では、すべての画素位置に“−1”が格納されていないので本ステップS20で“YES”が選択され、再びステップS11に移行することになる。   In step S20, the CPU 24 determines whether there is an unprocessed pixel. In the example of FIG. 16 (a), processing has been performed so far so that one cell is formed and a black dot is generated at the center of gravity of the cell. It goes. Whether or not the pixel is an unprocessed pixel is determined based on whether or not “−1” is stored at all pixel positions since “−1” is stored in the pixel processed in the input data area 261a. Judgment can be made. In the example of FIG. 16A, since “−1” is not stored in all pixel positions, “YES” is selected in this step S20, and the process proceeds to step S11 again.

ステップS11に移行するとCPU24は、上述したようにラスタ方向に未処理画素の探索を行い、図16(b)に示すように(4,0)の画素を初期画素として選択する。以後、上述したような処理を行うと、画素を4つ選択((4,0)、(5,0)、(4,1)、(5,1)の画素)し、再び未処理画素として(6,0)を選択した場合(ステップS13)で以下説明する。この4つの画素を選択したときの平均階調値は“30”(=(30×4)/4)であるが、(6,0)の階調値は“35”であるため、これを含めた平均階調値を演算すると(ステップS141)、“31”(=(120+35)/5)となる。この値は、図23に示す呼び出し関数から“30”を超える値のため閾値を“255”から“510”に変更することになる(ステップS142)。CPU24は、平均階調値“31”と、この変更された閾値“510”をワーキングメモリ270の各領域270c、270dに格納する(図16(c)の各領域270c、270d参照)。入力階調値が比較的大きな値を有する領域と判断したため、セルの大きさをさらに大きく確保するのである。上述したように、このように閾値を高く設定することでセルの大きさを確保し、ドット間距離を保つためである。また階調の表現も上述したように入力階調値が大きい領域ではセルが大きくなるものの、ドット1つはその変更した閾値分大きくなるため結果的に入力階調値に忠実な階調表現を実現しているのである。すなわち、滑らかな階調を表現することができるのである。もちろん、閾値の変更がない領域では入力階調値が高いとその分セルの大きさは小さくなり、結果的にドット密度が高くなるため、この場合でも滑らかな階調を表現することができる。   In step S11, the CPU 24 searches for an unprocessed pixel in the raster direction as described above, and selects the pixel (4, 0) as the initial pixel as shown in FIG. Thereafter, when the above-described processing is performed, four pixels are selected (pixels (4, 0), (5, 0), (4, 1), and (5, 1)), and again as unprocessed pixels. A case where (6, 0) is selected (step S13) will be described below. The average gradation value when these four pixels are selected is “30” (= (30 × 4) / 4), but the gradation value of (6, 0) is “35”. When the included average gradation value is calculated (step S141), "31" (= (120 + 35) / 5) is obtained. Since this value exceeds “30” from the calling function shown in FIG. 23, the threshold value is changed from “255” to “510” (step S142). The CPU 24 stores the average gradation value “31” and the changed threshold value “510” in the respective areas 270c and 270d of the working memory 270 (see the respective areas 270c and 270d in FIG. 16C). Since it is determined that the input gradation value has a relatively large value, a larger cell size is secured. As described above, this is because the cell size is secured and the inter-dot distance is maintained by setting the threshold value high in this way. In addition, as described above, although the cell becomes large in the region where the input gradation value is large as described above, one dot is increased by the changed threshold value, so that gradation expression faithful to the input gradation value is obtained as a result. It has been realized. That is, a smooth gradation can be expressed. Of course, in the region where the threshold value is not changed, the higher the input gradation value, the smaller the cell size and the higher the dot density. As a result, even in this case, a smooth gradation can be expressed.

具体的に図16(c)以降の図を参照しながら説明する。図16(c)で未処理画素(6,0)を選択して(ステップS13)、閾値制御処理(ステップS14)を終了すると、階調値の合計“155”(=120+35)は変更した閾値“510”を超えない。従って、ステップS15で“NO”が選択され、重心位置の演算(ステップS16)、階調値の合計値の演算等(ステップS17)を行い、各領域270a等にその値が格納される(図17(a)参照)。階調値の合計は閾値と等しくないためステップS18で“NO”が選択され再びセルを構成する未処理画素の選択を行う(ステップS13)。かかる処理を繰り返すことで、図17(b)に示す値を得る。この図に示すのは、階調値の合計が閾値である“510”となる直前の状態である。この図では、これまで8つの画素が選択されている。重心位置等の値は、図17(b)の各領域270a〜270dに示す値を得る。そして、CPU24は重心位置(5.67,1.4)から最も近い未処理画素として、図17(c)に示す(6,4)の画素を選択するものとする。当該画素の階調値は“35”、これまで構成したセルの階調値の合計は“490”、従って階調値の合計は“525”で閾値である“510”を超えることになり、ステップS15で“YES”が選択されステップS22に移行する。   This will be specifically described with reference to FIG. When the unprocessed pixel (6, 0) is selected in FIG. 16C (step S13) and the threshold value control process (step S14) is completed, the total gradation value “155” (= 120 + 35) is changed. It does not exceed “510”. Accordingly, “NO” is selected in step S15, the center of gravity position is calculated (step S16), the total value of the gradation values is calculated (step S17), and the value is stored in each area 270a and the like (FIG. 17 (a)). Since the sum of the gradation values is not equal to the threshold value, “NO” is selected in step S18, and the unprocessed pixels constituting the cell are selected again (step S13). By repeating this process, the values shown in FIG. 17B are obtained. This figure shows a state immediately before the sum of the gradation values reaches the threshold value “510”. In this figure, eight pixels have been selected so far. The values such as the position of the center of gravity are values shown in the respective areas 270a to 270d in FIG. Then, the CPU 24 selects the pixel (6, 4) shown in FIG. 17C as the unprocessed pixel closest to the gravity center position (5.67, 1.4). The gradation value of the pixel is “35”, the total gradation value of the cells configured so far is “490”, and therefore the total gradation value is “525”, which exceeds the threshold value “510”. In step S15, “YES” is selected, and the process proceeds to step S22.

ステップS22の階調値演算処理において、まずCPU24は閾値“510”からこれまで構成したセルの階調値の合計値“490”を減算する(ステップS221)。その減算値“20”が最後に選択した(6,4)の画素の階調値として(式3)を用いて重心を演算する(ステップS222)。重心位置はメモリ270の領域270aに格納される。そして、図6に戻り、残り濃度“15”(=35−20)を選択画素(6,4)に戻して(図17(c)の入力データ領域261a参照)、重心位置に黒ドットを生成する(ステップS23)。   In the gradation value calculation process in step S22, first, the CPU 24 subtracts the total value “490” of the gradation values of the cells configured so far from the threshold value “510” (step S221). The center of gravity is calculated by using (Equation 3) as the gradation value of the pixel (6, 4) that is the last selected subtraction value “20” (step S222). The position of the center of gravity is stored in the area 270a of the memory 270. Then, returning to FIG. 6, the remaining density “15” (= 35−20) is returned to the selected pixel (6, 4) (see the input data area 261a in FIG. 17C), and a black dot is generated at the center of gravity. (Step S23).

この黒ドット生成の際、閾値として“510”を設定し階調値の合計が“510”となるまで画素を選択したため、ドット生成を示す値“255”を2画素に割り当てることになる。すなわち、図18(a)の出力データ領域261aに示すように、CPU24はまず重心位置に存在する画素(6,2)に“255”を割り当てる。このとき、階調値の合計値は“255”(=510−255)となる(同図の領域270a参照)。さらに、重心位置に最も近い画素(5,2)に“255”を割り当てる(図18(b)の出力データ領域261a参照)。このようにすることで、セルとして選択した階調値分の値を割り当てることになる。   At the time of black dot generation, since “510” is set as a threshold value and pixels are selected until the total of gradation values reaches “510”, a value “255” indicating dot generation is assigned to two pixels. That is, as shown in the output data area 261a of FIG. 18A, the CPU 24 first assigns “255” to the pixel (6, 2) existing at the center of gravity. At this time, the total value of the gradation values is “255” (= 510-255) (see region 270a in FIG. 5). Furthermore, “255” is assigned to the pixel (5, 2) closest to the center of gravity (see the output data area 261a in FIG. 18B). By doing in this way, the value for the gradation value selected as a cell is allocated.

したがって、入力階調値が大きい領域では閾値を高く設定してセルの大きさを確保し、ドット間距離を保つとともに、入力階調値に応じた滑らかな階調を表現することができる。また、閾値を予め設定した値より高く設定することでセル内に取り込まれるべき画素数が増加する場合もある。このとき重心位置にドットを打つと上述したように閾値を高くした分、ドット生成を示す値を割り当てるべき画素の数も増加する。すなわち、セルの大きさは大きくなるがそのドットはそれに応じて大きく成長しやすいため、ドット間距離を保ったまま入力階調値に応じた階調を表現することができるのである。上述した図3(b)において、右側のドットは左側のドットを比較してその大きさは大きいもので全体としてみると右側の方がドット密度が上がっているように見える。入力階調値の変化に応じてドットどうしが引っ付いたりすることのない、滑らかな階調を表現している、といえる。   Therefore, in a region where the input tone value is large, the threshold value is set high to ensure the cell size, maintain the inter-dot distance, and express a smooth tone corresponding to the input tone value. Moreover, the number of pixels to be taken into the cell may increase by setting the threshold value higher than a preset value. At this time, when a dot is hit at the center of gravity, the number of pixels to which a value indicating dot generation is assigned increases as the threshold is increased as described above. That is, although the size of the cell increases, the dot easily grows accordingly, so that the gradation according to the input gradation value can be expressed while maintaining the distance between the dots. In FIG. 3B described above, the dots on the right side are larger in size than the dots on the left side, and as a whole, the dot density on the right side seems to be higher. It can be said that it expresses a smooth gradation in which dots do not stick to each other according to the change in the input gradation value.

再び処理に戻ると、CPU24は未処理画素がなくなる(図7のステップS20で“NO”)まで上述した処理を繰り返すことになる。その結果を図18(c)に示す。出力データ領域261aに格納された値が量子化データとしてハーフトーン処理部211から出力され、パルス幅変調部212を介して印刷エンジン22に出力されて、ホストコンピュータ10で生成した印刷データが印刷されるのである。   When returning to the processing again, the CPU 24 repeats the above-described processing until there is no unprocessed pixel (“NO” in step S20 in FIG. 7). The result is shown in FIG. The value stored in the output data area 261a is output as quantized data from the halftone processing unit 211, output to the print engine 22 via the pulse width modulation unit 212, and print data generated by the host computer 10 is printed. It is.

上述の例では、入力階調値が図面上左側から除々に大きくなる例で説明したため、エッジの検出が結果的に行われず、図8の閾値制御処理においてステップS143で常に“NO”が選択され閾値を下げる処理が行われなかった。次の例としてかかるエッジの領域での処理について説明する。以下、図19以降に示した図を参照しながら説明する。なお、全体の処理自体は上述したものと全く同じで図6等に示したフローチャートに沿って処理が行われる。   In the above-described example, the input gradation value is gradually increased from the left side in the drawing, so that the edge detection is not performed as a result, and “NO” is always selected in step S143 in the threshold control process of FIG. Processing to lower the threshold was not performed. As a next example, processing in the edge region will be described. Hereinafter, description will be made with reference to the drawings shown in FIG. The entire process itself is exactly the same as described above, and the process is performed according to the flowchart shown in FIG.

入力データ領域261aには図19(a)に示す階調値がホストコンピュータ10から入力されたものとする。画素位置(5,0)を境に階調値が急激に変化している。   It is assumed that the gradation value shown in FIG. 19A is input from the host computer 10 to the input data area 261a. The gradation value changes abruptly at the pixel position (5, 0).

まずCPU24は、上述した処理と同様に初期画素を選択するため入力データ領域261a上をラスタ方向に探索する。そして、(0,0)に位置する画素を初期画素として選択する(ステップS11)。そして、重心位置を演算し、セルを構成する画素が閾値と等しくなる(ステップS18で“YES”)か、超える(ステップS15で“YES”)まで画素を選択し続ける。その結果、図19(b)の出力データ領域261bに示す出力データを得る。この選択の途中で、平均階調値は“30”を超えないので閾値の変更(ステップS142)は行われず、またその階調値の最大と最小の差も“50”を越えないため閾値を下げる処理(ステップS144)も行われない。   First, the CPU 24 searches the input data area 261a in the raster direction in order to select the initial pixel in the same manner as the above-described processing. Then, the pixel located at (0, 0) is selected as the initial pixel (step S11). Then, the position of the center of gravity is calculated, and the pixels are continuously selected until the pixels constituting the cell are equal to the threshold value (“YES” in step S18) or exceeded (“YES” in step S15). As a result, the output data shown in the output data area 261b of FIG. 19B is obtained. In the middle of this selection, since the average gradation value does not exceed “30”, the threshold value is not changed (step S142), and the difference between the maximum and minimum of the gradation value does not exceed “50”. The lowering process (step S144) is also not performed.

再び初期画素をラスタ方向に探索して、(4,0)に位置する画素を初期画素として選択し(ステップS11、図19(b)の入力データ領域261a参照)、閾値以上となるまで画素を選択する。この選択の途中で、4つの画素((4,0)、(4,1)、(5,0)、(5,1)の画素)をセルとして構成し、未処理画素として(6,0)を選択したときの状態を図19(c)に示す。   The initial pixel is searched again in the raster direction, the pixel located at (4, 0) is selected as the initial pixel (see step S11, input data area 261a in FIG. 19B), and the pixel is selected until the threshold value is exceeded. select. In the middle of this selection, four pixels (pixels of (4,0), (4,1), (5,0), (5,1)) are configured as cells, and (6,0) as unprocessed pixels. FIG. 19C shows a state when “” is selected.

CPU24は、(6,0)の画素を未処理画素として選択すると(ステップS13)、閾値制御(ステップS14)に移行する。まず、CPU24は新たに選択した画素(6,0)を含めたセル内の画素の階調値の最大値、最小値、及び平均階調値を演算して対応する領域270b、270cに格納する(ステップS141)。最小値は変わらず“30”、最大値は(6,0)の画素の階調値“100”、平均階調値は“44”(=(120+100)/5)、となる(図20(a)の領域270b、270c参照)。   When the CPU 24 selects the pixel (6, 0) as an unprocessed pixel (step S13), the CPU 24 proceeds to threshold control (step S14). First, the CPU 24 calculates the maximum value, minimum value, and average gradation value of the gradation values of the pixels in the cell including the newly selected pixel (6, 0) and stores them in the corresponding areas 270b and 270c. (Step S141). The minimum value is unchanged, “30”, the maximum value is the gradation value “100” of the pixel of (6, 0), and the average gradation value is “44” (= (120 + 100) / 5) (FIG. 20 ( a) 270b, 270c).

次いでCPU24は、関数を読み出して平均階調値を引数として閾値を変更する(ステップS142)。この場合に、平均階調値は“30”より大きく“80”以下の範囲にあるので、図23に示す関数から閾値は“510”に変更されることになる(図20(a)の領域270d参照)。入力階調値が高い領域と判断されることになる。   Next, the CPU 24 reads out the function and changes the threshold value using the average gradation value as an argument (step S142). In this case, since the average gradation value is in a range larger than “30” and not larger than “80”, the threshold value is changed to “510” from the function shown in FIG. 23 (the region in FIG. 20A). 270d). It is determined that the input gradation value is a high region.

次いでCPU24は、セル内の画素の最大階調値と最小階調値の差が所定値である“50”を超えるか否か判断する(ステップS143)が、領域270b、270cに格納された値を読み出すとその差は“70”(=100−30)で所定値“50”を超える。よって本ステップで“YES”が選択されて閾値を下げる処理を行う。ここで、この領域はエッジの領域であると判断されたことになる。   Next, the CPU 24 determines whether or not the difference between the maximum gradation value and the minimum gradation value of the pixels in the cell exceeds a predetermined value “50” (step S143), but the values stored in the areas 270b and 270c. Is read out, the difference is “70” (= 100−30), which exceeds the predetermined value “50”. Therefore, “YES” is selected in this step, and the process of lowering the threshold value is performed. Here, it is determined that this area is an edge area.

この閾値を下げる処理もステップS142と同様に関数を呼び出してこの値を決定するようにしてもよいし、(式2)のような演算式を用いて決定してもよい。本実施例では図23に示すように関数threshold()を呼び出してその値を決定するようにする。すなわち
、図23の後半部分にあるように最大値(max_value)と最小値(min_value)との差が50を超えると、その閾値を一律に“255”に設定するようにしている。図20(b)の領域270dに示すようにその閾値を“510”から“255”に変更することになる。閾値を下げる処理としては、これ以外にも例えば、ステップS142の閾値の変更と同様に平均階調値に応じて、段階的にその閾値を下げるようにすることでもよい。例えば、“30”以下のときの閾値は“255”のままで、“30”より大きく“80”以下のときも“255”、“80”より大きいときは“510”と設定することもできる。これまでの閾値より小さい値でかつドット間距離を保つように設定すればよい。
The process of lowering the threshold value may be determined by calling a function in the same manner as in step S142, or may be determined using an arithmetic expression such as (Expression 2). In this embodiment, as shown in FIG. 23, the function threshold () is called to determine its value. That is, as shown in the latter half of FIG. 23, when the difference between the maximum value (max_value) and the minimum value (min_value) exceeds 50, the threshold value is uniformly set to “255”. As shown in a region 270d in FIG. 20B, the threshold value is changed from “510” to “255”. As another process for lowering the threshold value, for example, the threshold value may be lowered stepwise in accordance with the average gradation value as in the case of changing the threshold value in step S142. For example, the threshold when “30” or less remains “255”, and can be set to “255” when it is greater than “30” and “80” or less, and “510” when it is greater than “80”. . What is necessary is just to set so that the distance between dots may be kept smaller than the threshold value so far.

図20(b)の場合、閾値制御処理(ステップS14)が終了するとCPU24は、重心の演算(ステップS16)、階調値の演算(ステップS17)を行い、各演算値が領域270aに格納され、さらに入力データ領域261aの当該未処理画素(6,0)に“−1”、出力データ領域261bに“0”を格納することになる。なお、階調値の合計は“220”で閾値である“255”を超えないのでステップS15は“NO”が選択される。   In the case of FIG. 20B, when the threshold control process (step S14) is completed, the CPU 24 calculates the center of gravity (step S16) and the gradation value (step S17), and each calculated value is stored in the area 270a. Further, “−1” is stored in the unprocessed pixel (6, 0) of the input data area 261a, and “0” is stored in the output data area 261b. Since the total of the gradation values is “220” and does not exceed the threshold value “255”, “NO” is selected in step S15.

次いでCPU24は、ステップS18で“NO”が選択され、再びセルを構成する未処理画素を重心位置から最も近い画素から選択する(ステップS13)。この例の場合、図21(a)に示すように、(6,1)の画素が選択される。閾値制御処理(ステップS14)に移行するとCPU24は、平均階調値等を演算する(ステップS141)が、この場合、平均値は“53.3”(≒(220+100)/6)となり、関数を呼び出して閾値が再び“510”に変更される(ステップS142、図21(a)の領域270d参照)。しかし、これまで構成したセルの最大階調値と最小階調値の差はこの場合も“70”で、所定値以上となるためステップS143で“YES”が選択され閾値を下げることになる(ステップS144)。この場合もエッジの領域であると判断されたためである。同様に閾値は“255”に変更されCPU24によって領域270dに格納されることになる(図21(b)の領域270d参照)。そして、閾値制御処理(ステップS14)が終了して、図6のステップS15に移行することになる。   Next, the CPU 24 selects “NO” in step S18, and again selects the unprocessed pixels constituting the cell from the pixels closest to the centroid position (step S13). In this example, as shown in FIG. 21A, the pixel (6, 1) is selected. When the process proceeds to the threshold control process (step S14), the CPU 24 calculates an average gradation value or the like (step S141). In this case, the average value is “53.3” (≈ (220 + 100) / 6), and the function is The threshold value is again changed to “510” (see step S142, area 270d in FIG. 21A). However, the difference between the maximum gradation value and the minimum gradation value of the cells configured so far is also “70”, which is equal to or greater than the predetermined value, so “YES” is selected in step S143 to lower the threshold value ( Step S144). This is also because it is determined that the region is an edge region. Similarly, the threshold value is changed to “255” and stored in the area 270d by the CPU 24 (see the area 270d in FIG. 21B). Then, the threshold control process (step S14) ends, and the process proceeds to step S15 in FIG.

同様にCPU24は、最後に選択した画素を含めたセルの階調値の合計が閾値を超えるか否か判断する(ステップS15)が、この場合には閾値は“255”で、最後に選択した画素(6,1)を含めたセルの階調値の合計は“320”となるので、本ステップで“YES”が選択されることになる。そして、上述したように、閾値を超えた場合の階調値の演算処理(ステップS22)により、(6,1)の画素の階調値は“35”(=255−220)として(式3)を用いて重心を演算する(ステップS222)。残った階調値“65”(=100−35)を当該画素位置に戻して演算した重心位置に黒ドット生成を示す“255”を割り当てることになる(図21(c)参照)。   Similarly, the CPU 24 determines whether or not the sum of the gradation values of the cells including the last selected pixel exceeds the threshold value (step S15). In this case, the threshold value is “255” and the last selected value is selected. Since the sum of the gradation values of the cells including the pixel (6, 1) is “320”, “YES” is selected in this step. Then, as described above, the gradation value of the pixel of (6, 1) is set to “35” (= 255−220) by the gradation value calculation process (step S22) when the threshold value is exceeded (Expression 3). ) Is used to calculate the center of gravity (step S222). The remaining gradation value “65” (= 100−35) is returned to the pixel position, and “255” indicating black dot generation is assigned to the calculated gravity center position (see FIG. 21C).

かかる処理を未処理画素がなくなるまで(図7のステップS20で“NO”)繰り返すことで処理が終了する(ステップS21)。この結果を図22(a)に示す。   By repeating this process until there is no unprocessed pixel (“NO” in step S20 in FIG. 7), the process ends (step S21). The result is shown in FIG.

このようにエッジを検出すると設定した閾値を下げるようにすることで、セルの大きさが小さくなるため、ドット密度が上がり、エッジの再現性が向上した印刷出力を得ることができるのである。図22(a)の出力データ領域261bに示すように(5,0)から(5,6)までのエッジの領域はまわりの画素と比較して多数の小さいドットにより再現しているため、解像度が落ちることなく、エッジの再現性が向上した快適な印刷出力を得ることができる。   By detecting the edge in this way and lowering the set threshold value, the cell size is reduced, so that the dot density is increased and the print output with improved edge reproducibility can be obtained. As shown in the output data area 261b of FIG. 22A, the edge area from (5, 0) to (5, 6) is reproduced by a larger number of smaller dots than the surrounding pixels, so that the resolution A comfortable print output with improved edge reproducibility can be obtained without falling.

次に出力ドットのサイズを“255”よりも小さい単位で出力する場合の例について説明する。上述した例では、1ドットの出力はすべて“255”としたため、1画素分すべての領域にドットを打った場合の例で説明したが、この例では1画素分の所定領域幅にドットを打つ場合である。   Next, an example in which the output dot size is output in units smaller than “255” will be described. In the above-described example, since the output of one dot is all “255”, the example has been described in which dots are applied to all areas for one pixel. In this example, dots are applied to a predetermined area width for one pixel. Is the case.

図24(a)の入力データの例を示す。この場合の入力データ領域261aの構成は、7行8列の構成である。説明の便宜のためであって、もちろんこれ以外の構成でもよいことは上述の例と同様である。各座標位置は入力画像の各画素位置に対応することも同様である。この図の例でも、入力データ領域261a上、左側から右側にかけて除々にその階調値が増加している。なお、ワーキングメモリ270、出力データ領域261bも上述の例と同様の構成である。   The example of the input data of Fig.24 (a) is shown. The configuration of the input data area 261a in this case is a 7 × 8 configuration. For convenience of explanation, it is of course the same as the above example that other configurations may be used. Similarly, each coordinate position corresponds to each pixel position of the input image. Also in the example of this figure, the gradation value gradually increases from the left side to the right side on the input data area 261a. The working memory 270 and the output data area 261b have the same configuration as in the above example.

CPU24が行う処理の動作も図6乃至図11に示すフローチャートに従う。すなわち、まずCPU24は本処理を実行するためのプログラムを読出しで処理が開始される(図6のステップS10)。次いで、初期画素を決定し、基準点を初期画素の座標位置に設定する(ステップS11)。図24(b)に示すように入力データ領域261aをラスタ方向に探索すると、(0,0)の画素が未処理画素なので(“−1”が格納されてないので)、この画素を初期画素とする。そして、セルを構成する画素のうち最大階調値と最小階調値、及び平均階調値をワーキングメモリ270の各領域270b、270cに格納する(同図の各領域270b、270c参照)。また、平均階調値は“70”なので、CPU24はセルを構成する画素を選択するための閾値を“510”に設定し、この値をメモリ270の領域270dに格納する(同図の領域270d参照)。さらに、CPU24は上述の(式1)を用いて重心位置を演算しその演算値と、セルを構成する画素の階調値の合計値とを領域270aに格納するとともに、入力データ領域261aの選択した初期画素の画素位置に“−1”、対応する出力データ領域261bに“0”を格納する(図24(c)参照)。   The processing operations performed by the CPU 24 also follow the flowcharts shown in FIGS. That is, first, the CPU 24 reads a program for executing this process and starts the process (step S10 in FIG. 6). Next, the initial pixel is determined, and the reference point is set at the coordinate position of the initial pixel (step S11). When the input data area 261a is searched in the raster direction as shown in FIG. 24B, since the pixel (0, 0) is an unprocessed pixel (since “−1” is not stored), this pixel is changed to the initial pixel. And Then, the maximum gradation value, the minimum gradation value, and the average gradation value among the pixels constituting the cell are stored in the respective areas 270b and 270c of the working memory 270 (see the respective areas 270b and 270c in the same figure). Further, since the average gradation value is “70”, the CPU 24 sets the threshold value for selecting the pixels constituting the cell to “510” and stores this value in the area 270d of the memory 270 (area 270d in the figure). reference). Further, the CPU 24 calculates the position of the center of gravity using the above (Equation 1), stores the calculated value and the total value of the gradation values of the pixels constituting the cell in the area 270a, and selects the input data area 261a. “−1” is stored in the pixel position of the initial pixel, and “0” is stored in the corresponding output data area 261b (see FIG. 24C).

そして、図6に戻り、初期画素の初期濃度(階調値)“70”は“127”より小さい値なのでステップS11で低濃度と判定され(“YES”)以下ステップS13以降が実行される。すなわち、ワーキングメモリ270の領域270aに格納された重心位置に最も近い未処理画素を選択し(ステップS13)、セルを構成する画素の階調値の合計が閾値と等しいか(ステップS18で“YES”)、閾値を超えるまで(ステップS15で“YES”)、この未処理画素の選択を続ける。このとき、ステップS14でセルを構成する画素の階調値の平均値が、例えば30以下なら、この画素選択のための閾値を“255”のままにし、30より大きく80以下のときは閾値を“510”、80より大きいときは“765”にする(ステップS142)。セルの大きさをある程度大きくすることでドット間距離を保つためである。そして、セルを構成する画素の最大階調値と最小階調値の差が、例えば“50”より大きいときは(ステップS143で“YES”)、エッジの領域であるとして、その閾値を“255”にする(ステップS144)。ドット密度を上げることでエッジの再現性を向上させるためである。   Returning to FIG. 6, since the initial density (gradation value) “70” of the initial pixel is smaller than “127”, it is determined that the density is low in step S11 (“YES”), and step S13 and subsequent steps are executed. That is, the unprocessed pixel closest to the barycentric position stored in the area 270a of the working memory 270 is selected (step S13), and the sum of the gradation values of the pixels constituting the cell is equal to the threshold (“YES” in step S18). ") Until the threshold value is exceeded (" YES "in step S15), the selection of this unprocessed pixel is continued. At this time, if the average value of the gradation values of the pixels constituting the cell in step S14 is 30 or less, for example, the threshold value for pixel selection is left at “255”, and if it is greater than 30 and 80 or less, the threshold value is set. If “510” or greater than 80, “765” is set (step S142). This is because the distance between dots is maintained by increasing the cell size to some extent. When the difference between the maximum gradation value and the minimum gradation value of the pixels constituting the cell is larger than “50”, for example (“YES” in step S143), the threshold value is set to “255” as an edge region. "(Step S144). This is because the reproducibility of the edge is improved by increasing the dot density.

図25(a)は、6つの画素を未処理画素として選択し、さらに7番目の未処理画素として(2,1)の画素を選択したときの例である。このとき、セルを構成するこの7つの画素の階調値の合計は“500”で、画素選択のための閾値は、平均階調値が“71”なので “510”となっている(同図の領域270a、270d参照)。ちょうど、階調
値の合計が閾値となる直前の例である。
FIG. 25A shows an example in which six pixels are selected as unprocessed pixels, and (2,1) is selected as the seventh unprocessed pixel. At this time, the sum of the gradation values of the seven pixels constituting the cell is “500”, and the threshold value for pixel selection is “510” because the average gradation value is “71” (see FIG. Area 270a, 270d). This is just an example immediately before the sum of the gradation values becomes the threshold value.

そして、領域270aに格納された重心位置から最も近い未処理画素として、(2,0)の画素を選択する(ステップS13、図25(b)の入力データ領域261a参照)。このとき、階調値の合計値は、“580”(=510+70)となるので領域270dに格納された閾値“510”を超えるのでステップS15で“YES”が選択され、閾値を超えた場合の階調値演算処理を行う(ステップS22)。   Then, the pixel of (2, 0) is selected as the unprocessed pixel closest to the barycentric position stored in the area 270a (see step S13, input data area 261a in FIG. 25B). At this time, since the total value of the gradation values is “580” (= 510 + 70) and exceeds the threshold value “510” stored in the area 270d, “YES” is selected in step S15, and the threshold value is exceeded. A gradation value calculation process is performed (step S22).

すなわち、閾値“510”からこれまでセルとして選択した画素の階調値の合計値“500”を減算し(ステップS221)、その減算値“10”が最後に選択した画素(2,0)の階調値として重心の演算を行う(ステップS222)。演算結果がCPU24によって領域270aに格納され(図25(c)の領域270a参照)、残った階調値を(2,0)の画素に戻し、黒ドットの生成を行う(ステップS23)。   That is, the total value “500” of the gradation values of the pixels selected as the cells so far is subtracted from the threshold value “510” (step S221), and the subtraction value “10” is the value of the last selected pixel (2, 0). The center of gravity is calculated as the gradation value (step S222). The calculation result is stored in the area 270a by the CPU 24 (see the area 270a in FIG. 25C), the remaining gradation value is returned to the pixel of (2, 0), and black dots are generated (step S23).

この黒ドットの生成で、上述の例ではまず重心位置に存在する画素にドット生成を示す値“255”を割り当て、閾値が“510”のときはさらにその重心位置に最も近い画素を選択、さらに閾値が“765”のときはその重心位置から2番目に近い画素を選択と、重心位置に近い画素から順にドット生成を示す値 “255”を割り当てるようにしてい
た。しかし、本例では、最初に重心位置に存在する画素に“255”を割り当てると、閾値がそれ以上のときはその選択画素に隣接する処理済みの画素を選択するようにする。そして、隣接する画素が複数あれば均等に割り当てるのである。このようにすることで、1画素分の大きさに1ドットすべて印刷するよりも、細かな階調表現が可能になる。
With this black dot generation, in the above example, first, a value “255” indicating dot generation is assigned to the pixel existing at the centroid position, and when the threshold is “510”, the pixel closest to the centroid position is selected. When the threshold is “765”, the second closest pixel from the center of gravity position is selected, and the value “255” indicating dot generation is assigned in order from the pixel near the center of gravity position. However, in this example, when “255” is first assigned to the pixel present at the center of gravity, a processed pixel adjacent to the selected pixel is selected when the threshold is higher than that. If there are a plurality of adjacent pixels, they are allocated equally. In this way, finer gradation expression can be achieved than when all the dots are printed in the size of one pixel.

図25(c)の例では、まず重心位置(0.76,0.98)に存在する画素(1,1)にドット生成を示す値“255”を割り当てる(同図の出力データ領域261b参照)。このとき閾値は“510”でさらに“255”の階調値分だけドットを割り当てる必要がある。この重心位置に存在する画素に隣接する処理済みの画素((1,0)、(0,1)、(1,1)、(1,2)に位置する画素)を選択し、4つの画素に全体として“255”となるよう均等に、64、64、64、63を割り当てる(図26(a)の出力データ領域261b参照)。そして、この出力データを量子化データとして、パルス幅変調部212を介して印刷エンジン22に出力する。この領域の印刷出力の例を図29(a)に示す。   In the example of FIG. 25C, first, a value “255” indicating dot generation is assigned to the pixel (1, 1) existing at the center of gravity (0.76, 0.98) (see the output data area 261b in FIG. 25). ). At this time, the threshold value is “510” and it is necessary to assign dots for the gradation value of “255”. Select the processed pixels (pixels located at (1, 0), (0, 1), (1, 1), (1, 2)) adjacent to the pixel existing at this barycentric position and select four pixels 64, 64, 64, and 63 are equally allocated to “255” as a whole (see the output data area 261b in FIG. 26A). The output data is output as quantized data to the print engine 22 via the pulse width modulation unit 212. An example of print output in this area is shown in FIG.

この印刷出力の例に示すように(0,1)の画素と(2,1)の画素とは同じドットの生成を示す値“64”が割り当てられているが、前者の画素は右からドットが成長し、後者の画素は左からドットが成長している。すなわち、重心位置に存在する画素の左側の画素は右からドットが成長し、逆に右側に位置する画素は左からドットが成長している。CPU24は、この重心位置が存在する画素の右側に位置する画素か左側に位置する画素かによって左右どちらの側からドットが成長すべきかのデータを量子化データとともにパルス幅変調部212に出力するのである。   As shown in the example of the print output, the value “64” indicating the generation of the same dot is assigned to the pixel (0, 1) and the pixel (2, 1), but the former pixel is a dot from the right. The latter pixel has dots growing from the left. That is, the dot on the left side of the pixel located at the center of gravity is grown from the right, and conversely, the dot located on the right side is grown from the left. The CPU 24 outputs, to the pulse width modulation unit 212, the data indicating which dot should grow from the left or right side depending on whether the pixel is located on the right side or the left side of the pixel where the center of gravity exists. is there.

図26(a)の例でさらに処理を続けると、重心位置に黒ドットを生成すると、まだ未処理画素があるため再び未処理画素の選択を行う(ステップS20で“YES”が選択されて、ステップS11に移行する)。ラスタ方向に探索すると(2,0)の画素位置は未処理画素であるので、この画素を選択する。このとき、この画素の階調値は“70”であるが、例えば“20”となっているときに、次に未処理画素として(3,0)を選択すると、セルを構成する画素の最大階調値と最小最小値の差が“50”を超えてエッジとして検出されてしまう可能性がある。そこで、CPU24は未処理画素として選択された画素に対応する出力データ領域261bの画素にすでに処理すみである“0”が格納されていれば本来の階調値ではなく、ステップS23で戻しデータであることを認識して、最大階調値、最小階調値、及び平均階調値の演算をスキップするようにする。これにより、エッジとして間違って検出されるのを防ぐのである。   If the processing is further continued in the example of FIG. 26A, when a black dot is generated at the center of gravity position, since there are still unprocessed pixels, the unprocessed pixels are selected again ("YES" is selected in step S20, The process proceeds to step S11). When searching in the raster direction, the pixel position (2, 0) is an unprocessed pixel, so this pixel is selected. At this time, although the gradation value of this pixel is “70”, for example, when it is “20”, if (3, 0) is selected as the unprocessed pixel next, the maximum of the pixels constituting the cell There is a possibility that the difference between the gradation value and the minimum / minimum value exceeds 50 and is detected as an edge. Therefore, the CPU 24 does not use the original gradation value but returns the returned data in step S23 if “0”, which is the process area, has already been stored in the pixel of the output data area 261b corresponding to the pixel selected as the unprocessed pixel. Recognizing that there is, the calculation of the maximum gradation value, the minimum gradation value, and the average gradation value is skipped. This prevents erroneous detection as an edge.

以後、セルを構成する未処理画素を選択していき図26(c)に示すように(4,0)を選択したとする。このとき、平均階調値は“83”となり、閾値制御処理(図6のステップS14)で閾値が“765”に変更される(ステップS142)ことになる。そして、同様に未処理画素の選択を続けて、図27(a)に示す値を得る。これは、セルを構成する画素の階調値の合計が閾値である“765”を超える直前の状態である。   Thereafter, it is assumed that an unprocessed pixel constituting the cell is selected and (4, 0) is selected as shown in FIG. At this time, the average gradation value is “83”, and the threshold value is changed to “765” (step S142) in the threshold value control process (step S14 in FIG. 6). Similarly, the selection of unprocessed pixels is continued to obtain the values shown in FIG. This is a state immediately before the sum of the gradation values of the pixels constituting the cell exceeds the threshold value “765”.

図27(a)に示すように(5,2)の画素を選択したとき、その階調値の合計は“850”(=760+90)で閾値である“765”を超えるため(図6のステップS15で“YES”)、閾値を超えた場合の演算処理(ステップS22)に移行する。閾値“765”からこれまでの階調値の合計“760”を減算し、その“5”が当該画素(5,2)の階調値として重心の演算を行う(ステップS221、S222、図27(c)参照)。   As shown in FIG. 27A, when the pixel of (5, 2) is selected, the sum of the gradation values is “850” (= 760 + 90) and exceeds the threshold value “765” (step in FIG. 6). If “YES” in S15), the process proceeds to a calculation process (step S22) when the threshold value is exceeded. The total “760” of the gradation values so far is subtracted from the threshold value “765”, and “5” is calculated as the gradation value of the pixel (5, 2) (steps S221 and S222, FIG. 27). (See (c)).

そして、最後に選択した画素(5,2)に残りの階調値“85”(=90−5)を戻し(図27(b)の入力データ領域261a参照)、黒ドットの生成を行う(ステップS23)。黒ドットの生成は、まず重心位置(3.74,0.79)に存在する画素(4,1)に“255”を割り当てる(図27(c)の出力データ領域261b参照)。階調値の合計はまだ“510”の値分あるので、この(4,1)の画素に隣接する4つの処理済みの画素((4,0)、(3,1)、(5,1)、(4,2)の画素)に均等に、128、128、127、127(全部で“510”)を割り当てることになる(図28(a)の出力データ領域261b参照)。この場合の、出力ドットは図29(b)に示すものを得る。まわりの画素から均等にドット生成を示す値を割り当てているので、入力階調値に忠実なドットで、さらに階調表現にすぐれたドットを生成することができる。この場合も、画素位置(3,1)は重心位置の左側なのでドットが右から成長するようにし、(5,1)の画素は重心位置の右側なのでドットが左側から成長するようにドットが打たれる。   Then, the remaining gradation value “85” (= 90−5) is returned to the last selected pixel (5, 2) (see the input data area 261a in FIG. 27B), and black dots are generated ( Step S23). In generating the black dots, first, “255” is assigned to the pixel (4, 1) existing at the center of gravity (3.74, 0.79) (see the output data area 261b in FIG. 27C). Since the total number of gradation values is still “510”, four processed pixels ((4, 0), (3, 1), (5, 1) adjacent to the (4, 1) pixel are present. ), (4, 2) pixels) are equally assigned 128, 128, 127, 127 (a total of “510”) (see the output data area 261b in FIG. 28A). In this case, output dots shown in FIG. 29B are obtained. Since values indicating dot generation are equally assigned from surrounding pixels, it is possible to generate dots that are more faithful to the input gradation value and that are more excellent in gradation expression. Also in this case, since the pixel position (3, 1) is on the left side of the barycentric position, the dot grows from the right, and since the pixel of (5, 1) is on the right side of the barycentric position, the dot is hit so that the dot grows from the left side. Be drunk.

以下、上述した処理を繰り返すことで図28(b)に示す出力データを得る。このように1画素分のドット幅のうち所定幅の領域にドットを生成させることのできる画像出力装置20であっても、上述した例と同様に滑らかな階調を表現でき、エッジの再現性が向上したドットを出力することができる。   Thereafter, the above-described processing is repeated to obtain output data shown in FIG. As described above, even in the image output apparatus 20 that can generate dots in a region having a predetermined width out of the dot width of one pixel, a smooth gradation can be expressed and the reproducibility of the edge as in the above-described example. Can output improved dots.

次に白濃度処理(図10乃至図11)について説明する。上述の例では、初期画素を選択した(ステップS11)あと、その階調値が“127”よりも低い値を有していたのでステップS12で低濃度と判定されて以下処理を行っていた。ここでは、初期画素の階調値が低濃度でない場合について説明する。例えば図30(a)の入力データ領域261aに示すデータが入力されるとすると、上述したようにラスタ方向に未処理画素を探索し(0,0)の画素を選択するとする。このとき、(0,0)に位置する画素の階調値は“185”で、“127”より高い値なのでステップS12で“NO”と判定され白濃度処理(ステップS24)に移行することになる。   Next, white density processing (FIGS. 10 to 11) will be described. In the above-described example, after the initial pixel is selected (step S11), the gradation value has a value lower than “127”. Therefore, it is determined that the density is low in step S12, and the following processing is performed. Here, a case where the gradation value of the initial pixel is not low density will be described. For example, if the data shown in the input data area 261a in FIG. 30A is input, it is assumed that the unprocessed pixel is searched in the raster direction and the (0, 0) pixel is selected as described above. At this time, since the gradation value of the pixel located at (0, 0) is “185”, which is higher than “127”, “NO” is determined in step S12, and the process proceeds to white density processing (step S24). Become.

白濃度処理の動作を示すフローチャートを図11乃至図12に示す。ほぼ、低濃度のときの処理(図6のステップS13からステップS20)と同様である。セルを構成する画素が閾値と等しいか(ステップS248で“YES”)、超える(ステップS245で“YES”)まで重心位置から最も近い画素を選択し続ける。複数あればランダムに選択する。そして、閾値制御処理(ステップS244、図8参照)も同様で、平均階調値が所定値以上のときこれまでの閾値をより大きな値に設定して(ステップS142)、最大階調値と最小階調値の差が所定値以上のときエッジの部分であるとしてその設定した閾値を低い値に設定する(ステップS144)。   Flow charts showing the operation of the white density processing are shown in FIGS. This is almost the same as the processing at the low density (step S13 to step S20 in FIG. 6). Until the pixel constituting the cell is equal to the threshold value ("YES" in step S248) or exceeded ("YES" in step S245), the pixel closest to the center of gravity position is continuously selected. If there are multiple, select randomly. The threshold control process (step S244, see FIG. 8) is the same. When the average gradation value is equal to or greater than a predetermined value, the threshold value so far is set to a larger value (step S142), and the maximum gradation value and the minimum gradation value are set. When the difference between the gradation values is equal to or greater than a predetermined value, the threshold value thus set is set to a low value as being an edge portion (step S144).

この白濃度処理で、低濃度の処理のときとの違いは、まず選択した未処理画素の階調値をそのまま使用するのではなく、入力階調値の最大値(ここでは“255”)からの差を演算して、その値が当該画素の階調値として重心等の演算を行うようにする。例えば、図30(a)の例では(0,0)の画素は“185”の階調値を有するが、最大値から減算すると“70”(=255−185)を得る。これを各未処理画素選択のたびに行うことで、図30(b)の入力データ領域261aに示す値を有することになる。ただし、処理の上では各未処理画素を選択した後に減算(ステップS242)を行っているので、すべての画素に対してこの図に示す値に直してから処理が行われるものではない。この場合、結局図24に示す値と同じ値を有するものとして処理が行われることになる。   The difference between the white density process and the low density process is that the gradation value of the selected unprocessed pixel is not used as it is, but from the maximum value of the input gradation value (here, “255”). And the value is used as the gradation value of the pixel to calculate the center of gravity. For example, in the example of FIG. 30A, the pixel (0, 0) has a gradation value of “185”, but when subtracted from the maximum value, “70” (= 255-185) is obtained. By performing this for each unprocessed pixel selection, the value shown in the input data area 261a in FIG. 30B is obtained. However, in processing, since each unprocessed pixel is selected and then subtracted (step S242), the processing is not performed after the values shown in FIG. In this case, the process is eventually performed assuming that it has the same value as that shown in FIG.

また、低濃度の処理のときとの違いは、未処理画素を選択すると、低濃度のときは対応する出力データ領域261bの画素位置にドットを生成しないことを示す値“0”を格納したが、白濃度処理のときでは対応する画素位置にドットを生成することを示す値(ここでは“255”)を格納する(図10のステップS243)。図30(c)に示すように(0,0)の画素を未処理画素として選択したとき、出力データ領域261bの対応する(0,0)に“255”をCPU24の制御によって格納されることになる。そして、セルを構成する画素の階調値の合計が閾値と等しい(ステップS248で“YES”)か、超える(ステップS245で“YES”)と重心位置にドットを生成することになるが、低濃度のときとは異なり、ドットを生成しないことを示す値(ここでも“0”)を重心位置に存在する画素位置に割り当てるのである(図30(d)参照)。ただし、複数の画素に“0”を割り当てなければならないとき、画素の選択は低濃度の処理と同様に重心位置に最も近い画素を選択したり、或いは最初に選択した画素に隣接する画素に均等に割り当てる方法であってもよい。均等に割り当てるときは、まわりの画素の“255”の値から減算した値となる。   Also, the difference from the low density processing is that a value “0” indicating that no dot is generated at the pixel position of the corresponding output data area 261b when the unprocessed pixel is selected is stored. In the case of white density processing, a value (here, “255”) indicating that a dot is to be generated is stored at the corresponding pixel position (step S243 in FIG. 10). As shown in FIG. 30 (c), when the pixel (0, 0) is selected as an unprocessed pixel, “255” is stored in the corresponding (0, 0) of the output data area 261b by the control of the CPU 24. become. If the sum of the gradation values of the pixels constituting the cell is equal to the threshold value (“YES” in step S248) or exceeds (“YES” in step S245), a dot is generated at the center of gravity position. Unlike the case of density, a value indicating that dots are not generated (also “0” here) is assigned to the pixel position existing at the center of gravity (see FIG. 30D). However, when it is necessary to assign “0” to a plurality of pixels, the pixel selection is performed by selecting the pixel closest to the center of gravity as in the low-density processing, or even for the pixels adjacent to the first selected pixel. The method of assigning to may be used. In the case of even allocation, the value is subtracted from the value “255” of surrounding pixels.

さらに、階調値の合計が閾値を超えた場合に、低濃度のときは最後に選択した画素の階調値が丁度閾値と等しくなる値にし、残りを当該画素に戻していたが、白濃度処理も同様に残りの階調値を当該画素に戻す処理が行われる(ステップS253)。ただし、ステップS242で階調値の減算を行ったので、本来の階調値に直して戻すことになる。例えば、図30(d)に示すように最後に(2,0)を選択して当該画素の階調値を“10”(ステップS242の減算後階調値は“80”となり、これまでのセルの階調値の合計値が“500”だったので、閾値である“510”と等しくさせるために“10”とした)として演算し、残った階調値は“70”であるが、これは本来の階調値ではなくステップS242で減算した値である。よって、本来の階調値“185”に戻して当該画素に戻すのである(同図の入力データ領域261a参照)。   Furthermore, when the total of the gradation values exceeds the threshold value, when the density is low, the gradation value of the last selected pixel is set to a value that is exactly equal to the threshold value, and the rest is returned to the pixel. Similarly, the process of returning the remaining gradation value to the pixel is performed (step S253). However, since the gradation value is subtracted in step S242, the original gradation value is restored. For example, as shown in FIG. 30D, (2, 0) is finally selected and the gradation value of the pixel is “10” (the gradation value after subtraction in step S242 is “80”). Since the total value of the cell gradation values was “500”, it was calculated as “10” in order to make it equal to the threshold value “510”, and the remaining gradation value was “70”. This is not the original gradation value but the value obtained by subtraction in step S242. Therefore, the original gradation value “185” is restored and the pixel is restored (see the input data area 261a in the figure).

このように、各画素で白成分が多い低濃度の場合と、黒成分が多い高濃度の場合(白濃度処理を行う場合)とで処理を異ならしめているのは、高濃度の成分に対して低濃度と同様の処理を行うと2つや3つの画素ですぐに閾値に達してしまうためセルの大きさを確保できず、その重心にドットを生成させてもセルが小さい分隣り合ったドットと距離を保てず、ドットが重なって発生するようになり、不快な印刷出力となってしまうからである。   As described above, the processing is different between the case of low density with many white components in each pixel and the case of high density with many black components (when performing white density processing). If the same processing as that for low density is performed, the threshold value is reached immediately at two or three pixels, so the size of the cell cannot be secured. This is because the distance cannot be maintained and dots are overlapped, resulting in an unpleasant print output.

以上のような白濃度処理においても、閾値制御処理自体の内容は低濃度の処理と同様であるため、滑らかな階調が表現され、エッジの再現性が向上した印刷出力を得ることができる。   Also in the white density processing as described above, since the content of the threshold control processing itself is the same as that of the low density processing, it is possible to obtain a print output in which smooth gradation is expressed and edge reproducibility is improved.

上述の例で低濃度、高濃度の双方とも画素選択のための閾値として“255”の整数倍(510、765、…)として処理を行ってきたが、必ずしもこれに拘泥せず任意の整数値であってもよい。図31(a)に示すように、閾値として“450”が設定された場合に、重心位置に“255”を割り当て、残りの値“195”をこの画素位置に隣接する処理済みの4つの画素に均等に割り当てている。また図31(b)に示すように、重心位置に“255”を割り当て、残りの値“195”を重心位置に最も近い画素に割り当ててもよい。このような場合でも、平均階調値が所定の値以上のときに画素選択のための閾値を“450”から例えば“480”にすることで、セルの大きさを確保しドット間距離を保つことができる。要するに、平均階調値を引数とする関数を用いて、平均階調値に応じた閾値を設定するようにすればよい。   In the above example, both low density and high density have been processed as an integer multiple of “255” (510, 765,...) As a threshold value for pixel selection. It may be. As shown in FIG. 31A, when “450” is set as the threshold value, “255” is assigned to the center of gravity position, and the remaining value “195” is processed four pixels adjacent to this pixel position. Are allocated evenly. Further, as shown in FIG. 31B, “255” may be assigned to the center of gravity position, and the remaining value “195” may be assigned to the pixel closest to the center of gravity position. Even in such a case, when the average gradation value is equal to or higher than a predetermined value, the threshold for pixel selection is changed from “450” to, for example, “480”, thereby ensuring the cell size and maintaining the inter-dot distance. be able to. In short, a threshold value corresponding to the average gradation value may be set using a function having the average gradation value as an argument.

さらに、以下のような変形例においても同様の効果を奏する。すなわち、上述の例において、本発明が適用されるハーフトーン処理部211は画像出力装置20において処理が行われていたが、それ以外にも図32に示すようにハーフトーン処理部211がホストコンピュータ10内に設けられ、このハーフトーン処理部211において本発明が適用されることによっても、上述したものと全く同様の効果を奏することができる。この場合、ハーフトーン処理211から出力される量子化データがホストコンピュータ10から画像出力装置20に入力されて、パルス幅変調212から印刷エンジン22にドット生成を示す制御データが出力され印刷が行われることになる。   Further, the same effect is obtained in the following modified example. That is, in the above-described example, the halftone processing unit 211 to which the present invention is applied is processed in the image output apparatus 20, but the halftone processing unit 211 is also connected to the host computer as shown in FIG. Even when the present invention is applied to the halftone processing unit 211, the same effect as described above can be obtained. In this case, the quantized data output from the halftone processing 211 is input from the host computer 10 to the image output device 20, and control data indicating dot generation is output from the pulse width modulation 212 to the print engine 22 for printing. It will be.

また、ホストコンピュータ10以外にも例えば携帯電話やPDA(Personal Digital Assistance)、その他の情報携帯端末において、印刷対象のデータが生成されて画像出力
装置20に出力されるようになされていてもよい。さらには、かかる端末に本発明が適用されるハーフトーン処理部211を備えるようにしてもよい。さらには、紙とディスプレイとを組み合わせた、いわゆる電子ペーパーにおいてかかる本発明のハーフトーン処理211が設けられ、2値化(又は多値化)された値で文書や画像を表示したり、画像出力装置20との組み合わせて印刷出力を得るようにしてもよい。これらの場合でも、上述した効果を得ることができる。
In addition to the host computer 10, for example, in a mobile phone, a PDA (Personal Digital Assistance), or other information portable terminal, data to be printed may be generated and output to the image output device 20. Further, the terminal may include a halftone processing unit 211 to which the present invention is applied. Furthermore, the halftone processing 211 of the present invention is provided in so-called electronic paper in which paper and a display are combined, and a document or an image is displayed with a binarized (or multivalued) value, or an image output A print output may be obtained in combination with the apparatus 20. Even in these cases, the above-described effects can be obtained.

また、CC法による処理で、セルを構成する画素を選択するとき、演算した重心位置を用いて選択したが、それ以外にも階調値を考慮せず座標位置のみの中心位置から最も近い画素を選択するようにしてもよい。すなわち、(座標位置の和)/(選択画素の数)により演算した(x、y)の座標位置からセルを構成する画素を選択するのである。例えば、(0,0)と(1,0)の2つの画素をセルを構成する画素として選択した場合、その中心位置は(0.5,0)、この中心位置から最も近い位置にある未処理画素を選択する。さらに(0,1)を加えた3つの画素の場合、その中心位置は(0.5,0.5)、その画素位置から最も近い画素位置を未処理画素として選択するようにする。要するに、セルを構成する未処理画素を選択するときに常にテーブル等を利用して固定して選択するのではなく、画素選択のための基準点の位置(上述の例で説明した重心位置や、階調値を考慮せず座標位置のみで演算した中心位置)が移動すればよい。このように移動することで、セルの形状が固定の場合と比較してより円状に成長する可能性が高まり、ドット間距離が保たれた快適な画像出力を得られるからである。   In addition, when selecting a pixel constituting a cell by processing by the CC method, the pixel is selected using the calculated center of gravity position, but other than that, the pixel closest to the center position of only the coordinate position without considering the gradation value May be selected. That is, the pixels constituting the cell are selected from the coordinate position (x, y) calculated by (sum of coordinate positions) / (number of selected pixels). For example, when two pixels (0, 0) and (1, 0) are selected as the pixels constituting the cell, the center position is (0.5, 0), which is not closest to the center position. A processing pixel is selected. Further, in the case of three pixels to which (0, 1) is added, the center position is (0.5, 0.5), and the pixel position closest to the pixel position is selected as an unprocessed pixel. In short, when selecting unprocessed pixels constituting a cell, it is not always fixed and selected using a table or the like, but the position of the reference point for pixel selection (the centroid position described in the above example, The center position calculated only by the coordinate position without considering the gradation value may be moved. By moving in this way, there is a higher possibility that the cell shape will grow more circularly than in the case where the cell shape is fixed, and a comfortable image output in which the inter-dot distance is maintained can be obtained.

上述の例では、平均階調値をセルを構成する画素を選択するごとに演算したが、例えば、初期画素選択後、1画素、2画素等、固定画素数選択したときまで平均階調値を演算し、その後は平均階調値の演算を行わない場合でも同様の効果を奏する。重心付近の数画素を選択して平均階調値を演算して閾値を設定するようにすることで、毎回画素選択のたびに演算するよりも、演算量を少なくすることができ全体の処理を早めることもできる。   In the above example, the average gradation value is calculated every time the pixel constituting the cell is selected. For example, after the initial pixel selection, the average gradation value is obtained until a fixed number of pixels such as one pixel, two pixels, etc. are selected. The same effect can be obtained even when the calculation is performed and thereafter the average gradation value is not calculated. By selecting several pixels near the center of gravity and calculating the average gradation value and setting a threshold value, the calculation amount can be reduced rather than calculating each time the pixel is selected. You can also speed up.

さらに、上述の例では平均階調値によりその閾値を更新させるようにしたが、画素数により閾値を変化させるようにしてもよい。例えば、最小画素数を設定し、それ以上の画素がセルを構成する画素として選択されると、閾値をこれまでの“255”から“510”に設定するなどとすることができる。   Furthermore, in the above example, the threshold value is updated by the average gradation value, but the threshold value may be changed by the number of pixels. For example, when the minimum number of pixels is set and more pixels are selected as the pixels constituting the cell, the threshold value can be set from “255” to “510” so far.

また、上述の例ではエッジの検出としてセル内の最大階調値と最小階調値の差から演算したが、例えばそれ以外にも階調値の分散値や標準偏差から演算するようにしても全く同様の作用効果を奏する。すなわち、平均階調値をμ、分散をσ2 とすると、分散、標準
偏差はそれぞれ、
σ2 = {1/(画素数)}×Σ(各画素の階調値―μ)2
標準偏差 = √σ2
となる。この分散値や、標準偏差の値がある値以上のときは、エッジであるとしてその閾値を更新させるのである。
In the above example, the edge is detected by calculating from the difference between the maximum gradation value and the minimum gradation value in the cell. However, for example, it may be calculated from the dispersion value or standard deviation of the gradation value. Exhibits exactly the same effect. That is, if the average gradation value is μ and the variance is σ2, the variance and standard deviation are
σ 2 = {1 / (number of pixels)} × Σ (gradation value of each pixel−μ) 2
Standard deviation = √σ2
It becomes. When this variance value or standard deviation value is greater than or equal to a certain value, the threshold is updated as an edge.

さらに、上述の例では平均階調値によりその閾値を更新させるようにしたが、画素数により閾値を変化させるようにしてもよい。例えば、最小画素数を設定し、それ以上の画素がセルを構成する画素として選択されると、閾値をこれまでの“255”から“510”に設定するなどとすることができる。   Furthermore, in the above example, the threshold value is updated by the average gradation value, but the threshold value may be changed by the number of pixels. For example, when the minimum number of pixels is set and more pixels are selected as the pixels constituting the cell, the threshold value can be set from “255” to “510” so far.

さらに上述の例では、ホストコンピュータ10から出力されるデータはモノクロデータであるとして説明してきたが、CMYK(シアン、マゼンダ、イエロー、ブラック)のカラーデータに対して処理を行ってもよい。すなわち、ラスタライズ部12で各画素ごとRGB(レッド、グリーン、ブルー)の階調データを生成し、画像出力装置20内に色変換部を設けてこのRGBデータをテーブル又は関数等を利用することでCMYKの各色データに変換する。この変換後のCMYKの各データ(シアン、マゼンダ、イエロー、ブラックの各データごと)に対して上述したCC法による処理を行うのである。この場合でも、各色成分で平均階調値が高い領域では閾値をこれまでの値より大きくしてドット間距離を保ち、階調値の差が大きい領域ではエッジの部分としてその大きくした閾値を下げてドット密度を高めエッジの再現性を向上させるのである。もちろん、カラーを表現する色成分としてC、M、Y、Kの4色以外にもライトシアン、ライトマゼンダを含めた6色や、さらにそれ以外の色成分を含めた複数色の場合でも同様の効果を得ることができる。   Furthermore, in the above-described example, the data output from the host computer 10 has been described as monochrome data. However, processing may be performed on color data of CMYK (cyan, magenta, yellow, black). That is, the rasterizing unit 12 generates RGB (red, green, blue) gradation data for each pixel, and a color conversion unit is provided in the image output device 20 to use the RGB data by using a table or a function. Conversion into CMYK color data. The above-described CC method is performed on each converted CMYK data (each data of cyan, magenta, yellow, and black). Even in this case, in the area where the average gradation value is high for each color component, the threshold value is made larger than the previous value to maintain the inter-dot distance, and in the area where the gradation value difference is large, the increased threshold value is lowered as an edge portion. This increases the dot density and improves edge reproducibility. Of course, the same effect can be obtained even when there are six colors including light cyan and light magenta in addition to the four colors C, M, Y, and K as a color component that expresses a color and a plurality of colors including other color components. Can be obtained.

本発明が適用されるシステム全体の構成を示す図である。It is a figure which shows the structure of the whole system to which this invention is applied. 画像出力装置の具体的構成を示す図である。It is a figure which shows the specific structure of an image output device. 除々に入力階調値が変化する場合の印刷出力例である。This is an example of print output when the input gradation value gradually changes. エッジの検出を行わなかった場合の印刷出力例である。It is an example of print output when no edge is detected. エッジの検出を行って閾値を変更させた場合の印刷出力例である。It is an example of print output when the threshold value is changed by detecting an edge. CC法による処理の動作を示すフローチャートである。It is a flowchart which shows the operation | movement of the process by CC method. CC法による処理の動作を示すフローチャートである。It is a flowchart which shows the operation | movement of the process by CC method. 閾値制御処理の動作を示すフローチャートである。It is a flowchart which shows operation | movement of a threshold value control process. 閾値を超えた場合の階調値演算処理の動作を示すフローチャートである。It is a flowchart which shows the operation | movement of the gradation value calculation process at the time of exceeding a threshold value. 白濃度演算処理の動作を示すフローチャートである。It is a flowchart which shows the operation | movement of a white density calculation process. 白濃度演算処理の動作を示すフローチャートである。It is a flowchart which shows the operation | movement of a white density calculation process. RAM26の内部構成の例を示す図である。2 is a diagram illustrating an example of an internal configuration of a RAM 26. FIG. RAM26の内部構成の例を示す図である。2 is a diagram illustrating an example of an internal configuration of a RAM 26. FIG. RAM26の内部構成の例を示す図である。2 is a diagram illustrating an example of an internal configuration of a RAM 26. FIG. C、Mに対する処理全体の動作を示すフローチャートである。It is a flowchart which shows the operation | movement of the whole process with respect to C and M. RAM26の内部構成の例を示す図である。2 is a diagram illustrating an example of an internal configuration of a RAM 26. FIG. RAM26の内部構成の例を示す図である。2 is a diagram illustrating an example of an internal configuration of a RAM 26. FIG. RAM26の内部構成の例を示す図である。2 is a diagram illustrating an example of an internal configuration of a RAM 26. FIG. RAM26の内部構成の例を示す図である。2 is a diagram illustrating an example of an internal configuration of a RAM 26. FIG. RAM26の内部構成の例を示す図である。2 is a diagram illustrating an example of an internal configuration of a RAM 26. FIG. RAM26の内部構成の例を示す図である。2 is a diagram illustrating an example of an internal configuration of a RAM 26. FIG. RAM26の内部構成の例を示す図である。2 is a diagram illustrating an example of an internal configuration of a RAM 26. FIG. 閾値を変更する関数の一例である。It is an example of the function which changes a threshold value. RAM26の内部構成の例を示す図である。2 is a diagram illustrating an example of an internal configuration of a RAM 26. FIG. RAM26の内部構成の例を示す図である。2 is a diagram illustrating an example of an internal configuration of a RAM 26. FIG. RAM26の内部構成の例を示す図である。2 is a diagram illustrating an example of an internal configuration of a RAM 26. FIG. RAM26の内部構成の例を示す図である。2 is a diagram illustrating an example of an internal configuration of a RAM 26. FIG. RAM26の内部構成の例を示す図である。2 is a diagram illustrating an example of an internal configuration of a RAM 26. FIG. ドットの印刷出力例である。It is an example of dot printout. RAM26の内部構成の例を示す図である。2 is a diagram illustrating an example of an internal configuration of a RAM 26. FIG. RAM26の内部構成の例を示す図である。2 is a diagram illustrating an example of an internal configuration of a RAM 26. FIG. 本発明が適用される他のシステム全体の構成を示す図である。It is a figure which shows the structure of the other whole system with which this invention is applied.

符号の説明Explanation of symbols

10 ホストコンピュータ 20 画像出力装置 21 画像処理部 211 ハーフトーン処理部 212 パルス幅変調部 22 印刷エンジン 24 CPU 25 ROM 261a 入力データ格納領域 261b 出力データ格納領域 270 ワーキングメモリ領域 270a 重心位置と階調値の合計値とが格納される領域 270b セルの最大階調値と最小階調値とが格納される領域 270c 平均階調値が格納される領域 270d 閾値が格納される領域 DESCRIPTION OF SYMBOLS 10 Host computer 20 Image output device 21 Image processing part 211 Halftone processing part 212 Pulse width modulation part 22 Print engine 24 CPU 25 ROM 261a Input data storage area 261b Output data storage area 270 Working memory area 270a The area where the total value is stored 270b The area where the maximum gradation value and the minimum gradation value of the cell are stored 270c The area where the average gradation value is stored 270d The area where the threshold value is stored

Claims (11)

画素ごとにN(Nは整数)種類以上のレベル値を有する階調データを、画素ごとにM(Mは整数)種類のレベル値を有するデータに変換する画像処理装置において、
画素選択のための第1の基準点に基づいて、画素ごとの前記N種類のレベル値の総和が閾値以上となるまで画素を選択して画素群を生成する画素群生成手段と、
前記画素群生成手段で生成した画素群の第2の基準点を決定する画素群基準点決定手段と、
前記画素群基準点決定手段で決定した前記第2の基準点に位置する画素に前記M種類のレベル値を付与する付与手段と、を備え、
前記画素群生成手段は、前記第1の基準点を更新して当該第1の基準点に基づいて前記画素を選択し、さらに生成した前記画素群内のレベル値に応じて前記閾値を更新することを特徴とする画像処理装置。
In an image processing apparatus that converts gradation data having N (N is an integer) or more level values for each pixel into data having M (M is an integer) level values for each pixel.
Pixel group generation means for selecting a pixel and generating a pixel group based on a first reference point for pixel selection until the sum of the N types of level values for each pixel is equal to or greater than a threshold;
Pixel group reference point determining means for determining a second reference point of the pixel group generated by the pixel group generating means;
Providing means for assigning the M types of level values to the pixels located at the second reference point determined by the pixel group reference point determining means;
The pixel group generation unit updates the first reference point, selects the pixel based on the first reference point, and further updates the threshold according to the generated level value in the pixel group. An image processing apparatus.
請求項1記載の画像処理装置において、
前記画素群生成手段は、生成した前記画素群内の画素のレベル値の平均値に応じて前記閾値を更新する、ことを特徴とする画像処理装置。
The image processing apparatus according to claim 1.
The image processing apparatus, wherein the pixel group generation unit updates the threshold value according to an average value of the level values of the generated pixels in the pixel group.
請求項1記載の画像処理装置において、
前記画素群生成手段は、生成した前記画素群内のレベル値が第1の値より大きいとき、前記閾値をこれまでの第2の値から前記第2の値より大きい第3の値に更新する、ことを特徴とする画像処理装置。
The image processing apparatus according to claim 1.
When the level value in the generated pixel group is larger than the first value, the pixel group generation unit updates the threshold value from the second value so far to a third value larger than the second value. An image processing apparatus characterized by that.
請求項1記載の画像処理装置において、
前記画素群生成手段は、生成した前記画素群内のレベル値の最大値と最小値の差が第4の値よりも大きいとき、前記閾値をこれまでの第5の値から前記第5の値より低い第6の値に更新する、ことを特徴とする画像処理装置。
The image processing apparatus according to claim 1.
When the difference between the maximum value and the minimum value of the level value in the generated pixel group is larger than the fourth value, the pixel group generation means changes the threshold value from the fifth value so far to the fifth value. An image processing apparatus that updates to a lower sixth value.
請求項1記載の画像処理装置において、
前記第2の基準点は、前記画素群の各画素位置と各画素の前記N種類のレベル値とから演算した重心位置である、ことを特徴とする画像処理装置。
The image processing apparatus according to claim 1.
The image processing apparatus according to claim 2, wherein the second reference point is a barycentric position calculated from each pixel position of the pixel group and the N kinds of level values of each pixel.
請求項1記載の画像処理装置において、
前記画素群生成手段は、前記第1の基準点に基づいて選択すべき画素が複数あるときはランダムにいづれか一の画素を選択する、ことを特徴とする画像処理装置。
The image processing apparatus according to claim 1.
The image processing apparatus, wherein the pixel group generation unit randomly selects one pixel when there are a plurality of pixels to be selected based on the first reference point.
画素ごとにN(Nは整数)種類以上のレベル値を有する階調データを、画素ごとにM(Mは整数)種類のレベル値を有するデータに変換する画像処理装置において、
前記N種類のレベル値を有する画素を選択し、選択した画素ごとのレベル値の総和が閾値となるまで未処理画素を選択して画素群を生成する画素群生成手段と、
前記画素群生成手段で生成した画素群の所定画素に対して前記M種類のレベル値を付与する付与手段と、を備え、
前記画素群生成手段は、生成した前記画素群内のレベル値に応じて前記閾値を更新することを特徴とする画像処理装置。
In an image processing apparatus that converts gradation data having N (N is an integer) or more level values for each pixel into data having M (M is an integer) level values for each pixel.
A pixel group generation unit that selects pixels having the N types of level values, selects unprocessed pixels until a sum of level values for each selected pixel reaches a threshold value, and generates a pixel group;
Providing means for assigning the M kinds of level values to predetermined pixels of the pixel group generated by the pixel group generating means;
The image processing apparatus, wherein the pixel group generation unit updates the threshold value according to the generated level value in the pixel group.
画素ごとにN(Nは整数)種類以上のレベル値を有する階調データを、画素ごとにM(Mは整数)種類のレベル値を有するデータを出力する画像処理方法において、
画素選択のための第1の基準点に基づいて、画素ごとの前記N種類のレベル値の総和が閾値以上となるまで画素を選択して画素群を生成する画素群生成工程と、
前記画素群生成工程で生成した画素群の第2の基準点を決定する画素群基準点決定工程と、
前記画素群基準点決定工程で決定した前記第2の基準点に位置する画素に前記M種類のレベル値を付与する付与工程と、を備え、
前記画素群生成工程は、前記第1の基準点を更新して当該第1の基準点に基づいて前記画素を選択し、さらに生成した前記画素群内のレベル値に応じて前記閾値を更新することを特徴とする画像処理方法。
In an image processing method for outputting gradation data having N (N is an integer) or more level values for each pixel and data having M (M is an integer) level values for each pixel,
A pixel group generation step of selecting a pixel and generating a pixel group based on a first reference point for pixel selection until the sum of the N types of level values for each pixel is equal to or greater than a threshold;
A pixel group reference point determining step for determining a second reference point of the pixel group generated in the pixel group generating step;
An applying step of applying the M kinds of level values to the pixels located at the second reference point determined in the pixel group reference point determining step,
The pixel group generation step updates the first reference point, selects the pixel based on the first reference point, and further updates the threshold value according to the generated level value in the pixel group. An image processing method.
画素ごとにN(Nは整数)種類以上のレベル値を有する階調データを、画素ごとにM(Mは整数)種類のレベル値を有するデータを出力する画像処理方法において、
前記N種類のレベル値を有する画素を選択し、選択した画素ごとのレベル値の総和が閾値となるまで未処理画素を選択して画素群を生成する画素群生成工程と、
前記画素群生成手段で生成した画素群の所定画素に対して前記M種類のレベル値を付与する付与工程と、を備え、
前記画素群生成工程は、生成した前記画素群内のレベル値に応じて前記閾値を更新することを特徴とする画像処理方法。
In an image processing method for outputting gradation data having N (N is an integer) or more level values for each pixel and data having M (M is an integer) level values for each pixel,
A pixel group generation step of selecting pixels having the N types of level values, and selecting unprocessed pixels until a sum of level values for the selected pixels reaches a threshold value to generate a pixel group;
An application step of applying the M kinds of level values to predetermined pixels of the pixel group generated by the pixel group generation means,
The pixel group generation step updates the threshold value according to the generated level value in the pixel group.
画素ごとにN(Nは整数)種類以上のレベル値を有する階調データに対して、画素ごとにM(Mは整数)種類のレベル値を有するデータを出力する処理をコンピュータに実行させるためのプログラムにおいて、
画素選択のための第1の基準点に基づいて、画素ごとの前記N種類のレベル値の総和が閾値以上となるまで画素を選択して画素群を生成する画素群生成処理と、
前記画素群生成処理で生成した画素群の第2の基準点を決定する画素群基準点決定処理と、
前記画素群基準点決定処理で決定した前記第2の基準点に位置する画素に前記M種類のレベル値を付与する付与処理と、を備え、
前記画素群生成処理は、前記第1の基準点を更新して当該第1の基準点に基づいて前記画素を選択し、さらに生成した前記画素群内のレベル値に応じて前記閾値を更新することを特徴とするプログラム。
For causing a computer to execute a process of outputting data having M (M is an integer) type of level value for each pixel with respect to gradation data having N or more (N is an integer) type of level value for each pixel. In the program
Based on a first reference point for pixel selection, a pixel group generation process for generating a pixel group by selecting pixels until the sum of the N kinds of level values for each pixel is equal to or greater than a threshold value;
A pixel group reference point determination process for determining a second reference point of the pixel group generated by the pixel group generation process;
A provisioning process for imparting the M kinds of level values to the pixels located at the second reference point determined by the pixel group reference point determination process,
The pixel group generation process updates the first reference point, selects the pixel based on the first reference point, and further updates the threshold according to the generated level value in the pixel group. A program characterized by that.
画素ごとにN(Nは整数)種類以上のレベル値を有する階調データに対して、画素ごとにM(Mは整数)種類のレベル値を有するデータを出力する処理をコンピュータに実行させるプログラムにおいて、
前記N種類のレベル値を有する画素を選択し、選択した画素ごとのレベル値の総和が閾値となるまで未処理画素を選択して画素群を生成する画素群生成処理と、
前記画素群生成手段で生成した画素群の所定画素に対して前記M種類のレベル値を付与する付与処理と、を備え、
前記画素群生成処理は、生成した前記画素群内のレベル値に応じて前記閾値を更新することを特徴とするプログラム。
In a program for causing a computer to execute a process of outputting data having M (M is an integer) type of level value for each pixel with respect to gradation data having N (N is an integer) type of level value or more for each pixel. ,
A pixel group generation process of selecting pixels having the N types of level values, selecting unprocessed pixels until a sum of level values for each selected pixel reaches a threshold value, and generating a pixel group;
A provisioning process for imparting the M kinds of level values to predetermined pixels of the pixel group generated by the pixel group generation unit,
The pixel group generation processing updates the threshold value according to the generated level value in the pixel group.
JP2004296548A 2003-10-10 2004-10-08 Image processing apparatus, image processing method, and program Pending JP2005136976A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004296548A JP2005136976A (en) 2003-10-10 2004-10-08 Image processing apparatus, image processing method, and program

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2003352270 2003-10-10
JP2004296548A JP2005136976A (en) 2003-10-10 2004-10-08 Image processing apparatus, image processing method, and program

Publications (1)

Publication Number Publication Date
JP2005136976A true JP2005136976A (en) 2005-05-26

Family

ID=34656112

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004296548A Pending JP2005136976A (en) 2003-10-10 2004-10-08 Image processing apparatus, image processing method, and program

Country Status (1)

Country Link
JP (1) JP2005136976A (en)

Similar Documents

Publication Publication Date Title
JP2005210731A (en) Method for creating halftones from plural pixels, and method and system for processing halftones
JP5482535B2 (en) Image processing apparatus and image processing method
JP7185186B2 (en) Image processor, method for training machine learning model, and computer program
JP4412248B2 (en) Image processing apparatus, image processing method, and image processing program
JPWO2005109851A1 (en) Image processing apparatus, image processing method, and program
JP2005136976A (en) Image processing apparatus, image processing method, and program
JP5678501B2 (en) Image processing apparatus and image processing method
JP2005136975A (en) Image processing apparatus, image processing method, and program
JP2012165192A (en) Printer and printing method
JP2005117642A (en) Halftoning method, image processor, image processing method, and program
JP3951953B2 (en) Printing apparatus, image processing apparatus, printing method, image processing method, and program
JP2005341142A (en) Image processor, processing method and program, and recording medium with the program stored
JP2005295131A (en) Apparatus, method, and program for processing image
JP5458969B2 (en) Image processing apparatus, image processing method, and program
US10798267B2 (en) Image processing to set output pixel values subject to edge or thin line correction
JP7257806B2 (en) Image forming device, generation device, conversion method, and generation method
JP2004320374A (en) Image processor, image processing method, printer, printing method, and program
JP6565711B2 (en) Image processing apparatus, image forming apparatus, and threshold matrix shaping method
JP2005080217A (en) Image processing apparatus, image processing method, and program
JP2005318402A (en) Image processing device, method and program, and recording medium recorded with program
JP4337670B2 (en) Image processing apparatus, image processing method, and program
JP2005269131A (en) Image processing apparatus, image processing method, and image processing program
JP2005341351A (en) Image processor, processing method and program
JP2006025220A (en) Image processing apparatus, image processing method, image processing program, and recording medium recorded with the program
JP2006060645A (en) Image processing device, method, and program, and recording medium with image processing program recorded thereon