JP2005311414A - Apparatus, method and program for image processing and recording medium recording this program - Google Patents

Apparatus, method and program for image processing and recording medium recording this program Download PDF

Info

Publication number
JP2005311414A
JP2005311414A JP2004121477A JP2004121477A JP2005311414A JP 2005311414 A JP2005311414 A JP 2005311414A JP 2004121477 A JP2004121477 A JP 2004121477A JP 2004121477 A JP2004121477 A JP 2004121477A JP 2005311414 A JP2005311414 A JP 2005311414A
Authority
JP
Japan
Prior art keywords
pixel
gradation data
pixel group
level values
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.)
Withdrawn
Application number
JP2004121477A
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 JP2004121477A priority Critical patent/JP2005311414A/en
Publication of JP2005311414A publication Critical patent/JP2005311414A/en
Withdrawn legal-status Critical Current

Links

Abstract

<P>PROBLEM TO BE SOLVED: To provide an image processing apparatus having less amplification of a quantization noise without using a special table to obtain an output image in which the generation of a unique pattern is suppressed; and to provide an image processing method, an image processing program, and a recording medium recording the program. <P>SOLUTION: In gradation data conversion processing (pre-gradation conversion processing: S20) to be performed before color correction processing, gradation data of an input image is converted into a level value having reduced kinds, thereby giving variation to the gradation data of the input image. Then, in gradation data conversion processing (post-gradation conversion processing: S40) by halftone processing, an unprocessed pixel is selected based on the centroid of a cell to generate a cell. At this time, error data exceeding a threshold are returned to a pixel which is lastly incorporated into the cell. <P>COPYRIGHT: (C)2006,JPO&NCIPI

Description

本発明は、プリンタなどの画像出力装置において、入力画像の階調データを、所定の手法にて階調データ変換することによって、画像出力装置の出力画像に生じうる特異パターンの発生などを抑える画像処理技術に関する。   The present invention provides an image that suppresses the occurrence of a peculiar pattern that can occur in an output image of an image output device by converting the tone data of the input image using a predetermined method in an image output device such as a printer. It relates to processing technology.

従来より、レーザープリンタやインクジェットプリンタなど画像出力装置では、入力画像の階調データを画素ごとに所定の閾値で2値化し、2値化によって所定のレベル値が付与された画素の位置に、所定の大きさのドットを形成して印刷用紙に印刷することにより、印刷物として出力画像を出力することが行われている。ここで、多値の階調データを、2値化した階調データに変換する処理のことをハーフトーン処理と一般に称している。   Conventionally, in an image output apparatus such as a laser printer or an ink jet printer, gradation data of an input image is binarized with a predetermined threshold value for each pixel, and a predetermined level value is given to a pixel position to which a predetermined level value is given by binarization. An output image is output as a printed matter by forming dots having a size of 1 and printing on printing paper. Here, the process of converting multi-value gradation data into binarized gradation data is generally referred to as halftone processing.

ハーフトーン処理については、形成するドットの位置によって、出力画像に、例えばドットが鎖状につながるなど、入力画像には存在しなかった特異パターンが発生することがある。そこで、このような特異パターンの発生を抑えるため、例えば、ドットのつながりを少なくする技術が特許文献1に提案されている。特許文献1では、入力画像の画素について、階調データのレベル値合計が閾値に達するまで所定のテーブルにより画素を探索してセルを生成し、セルの中央付近の位置にドットを形成する技術が開示されている。   For halftone processing, depending on the position of the dot to be formed, a unique pattern that does not exist in the input image may occur in the output image, for example, dots may be connected in a chain. In order to suppress the occurrence of such a unique pattern, for example, Patent Document 1 proposes a technique for reducing dot connections. Japanese Patent Application Laid-Open No. 2004-151867 discloses a technique for searching for a pixel by a predetermined table until a total level value of gradation data reaches a threshold value for a pixel of an input image, and generating a dot at a position near the center of the cell. It is disclosed.

また、同じく画像出力装置では、入力画像の階調データを、画像出力装置の出力色に合わせて色補正処理することも通常行われている。この色補正処理に際して、色補間処理を省いて色補正処理を高速化する目的で、色補正処理のために使用する色補正表の種類数を少なくすることが提案されている。すなわち、色補正処理の前に、階調データの変換処理、つまり入力画像の階調データのレベル値の数を、所定の種類のレベル値の数まで減らす処理を行う技術が特許文献2に開示されている。また、この特許文献2には、その後所定の手法にてハーフトーン処理を行う技術も開示されている。   Similarly, in the image output apparatus, color correction processing is usually performed on the gradation data of the input image in accordance with the output color of the image output apparatus. In this color correction process, it has been proposed to reduce the number of types of color correction tables used for the color correction process in order to omit the color interpolation process and speed up the color correction process. That is, Patent Document 2 discloses a technique for performing gradation data conversion processing, that is, processing for reducing the number of level values of input image gradation data to a predetermined number of level values before color correction processing. Has been. Further, Patent Document 2 discloses a technique for performing halftone processing by a predetermined method thereafter.

特開平11−27528号公報JP 11-27528 A 特開平7−30772号公報JP-A-7-30772

特許文献1におけるハーフトーン処理では、特異パターンの発生を抑えるため、セルを構成する画素の探索を所定の探索順を記録したテーブルを用いて行う方法が提案されているが、テーブル内で左側に存在する画素は、既に処理済みの場合が多く、結果的に生成されるセルが歪んだ形(例えば三日月型)となってしまう。かかる形状のセルでは、セルの中央付近がそのセルの外側に位置することもある。このようなセルについては、セルの中央付近の位置にドットを形成させると、隣のセルのドットと重なってしまうことが生じるため、出力ドットの偏りが発生し、結果的に特異パターンを発生させていまうという課題があった。   In the halftone processing in Patent Document 1, in order to suppress the occurrence of singular patterns, there has been proposed a method of searching for pixels constituting a cell using a table in which a predetermined search order is recorded. The existing pixels are often already processed, and as a result, the generated cells are distorted (for example, crescent moon type). In a cell having such a shape, the vicinity of the center of the cell may be located outside the cell. For such cells, if dots are formed near the center of the cell, they may overlap with the dots in the adjacent cells, resulting in biased output dots, resulting in a singular pattern. There was a problem of keeping up.

また、特許文献1では、同じ形状のセルが連続することに起因して出力画像に生じる規則的なパターンを防ぐため、画素の探索順を記録したテーブルを複数用意し、使用するテーブルを、セル毎に順にまたはランダムに切り替え、セルの形状を不規則にする処理も提案されている。しかしながら、かかる処理は、複数のテーブルを切り替えるために処理負荷が大きく、処理速度が遅くなってしまうという課題があった。また、例えば、入力画像がおおよそ同じ濃度の階調データであるような場合は、探索順をランダムにしてもほぼ同じ形状のセルが生成されてしまうこともあり、結果的に規則的な特異パターンを生じてしまうという課題もあった。   Further, in Patent Document 1, in order to prevent a regular pattern generated in an output image due to a series of cells having the same shape, a plurality of tables in which the search order of pixels is recorded are prepared, and the table to be used is defined as a cell. A process of switching the cell shape irregularly by switching sequentially or randomly every time has also been proposed. However, this processing has a problem that the processing load is large because a plurality of tables are switched, and the processing speed becomes slow. For example, if the input image is gradation data having approximately the same density, cells having substantially the same shape may be generated even if the search order is random, resulting in a regular unique pattern. There was also a problem of generating.

また、特許文献2における色補正処理前に行う階調データ変換処理技術は、前述したように階調データの色補正に関する処理負荷を軽減し処理速度を速めるためのものであった。このため、ハーフトーン処理による階調データ変換後、最終的に出力画像に現れる特異パターンの発生を抑えることを特に考慮したものではなかった。従って、特許文献2では、色補正前の階調データ変換処理およびハーフトーン処理の両方の処理を、誤差拡散法の手法を用いて変換処理を行うことが記載されているが、誤差拡散法では、両方の処理において、量子化に伴って生ずる注目画素の画素値差分を同じ方向に分散するため、量子化ノイズが増幅されて特異パターンが生じてしまうという課題があった。   In addition, the gradation data conversion processing technique performed before the color correction processing in Patent Document 2 is for reducing the processing load related to color correction of gradation data and increasing the processing speed as described above. For this reason, after gradation data conversion by halftone processing, it was not particularly considered to suppress the occurrence of unique patterns that finally appear in the output image. Therefore, Patent Document 2 describes that both the gradation data conversion process and the halftone process before color correction are performed using the error diffusion method, but in the error diffusion method, In both processes, since the pixel value difference of the pixel of interest that occurs with quantization is distributed in the same direction, there is a problem that quantization noise is amplified and a singular pattern is generated.

本発明は、このような課題の少なくとも一部を解決し、特異パターンの発生を抑えた出力画像を得るため、特別なテーブルを用いず量子化ノイズの増幅が少ない画像処理装置、画像処理方法、画像処理プログラム、またはそのプログラムを記録した記録媒体を提供することを目的とする。   The present invention solves at least a part of such problems and obtains an output image in which the occurrence of singular patterns is suppressed. Therefore, an image processing apparatus, an image processing method, and a low quantization noise amplification without using a special table, An object is to provide an image processing program or a recording medium on which the program is recorded.

上記目的を達成する本発明の画像処理装置は、画素ごとに、少なくとも、P(Pは2以上の整数)種類のレベル値を有する階調データからQ(Q<P、Pは2以上の整数)種類のレベル値を有する階調データに変換する第1の階調データ変換と、N(Nは2以上の整数)種類のレベル値を有する階調データからM(Mは2以上の整数)種類のレベル値を有する階調データに変換する第2の階調データ変換と、を実施する画像処理装置であって、前記第2の階調データ変換に際し、画素ごとのレベル値の総和が閾値以上となるまで前記N種類のレベル値を有する画素を選択して画素群を生成する画素群生成部と、生成した前記画素群の所定画素に対して前記M種類のレベル値を付与するデータ付与部とを備えたことを要旨とする。   The image processing apparatus of the present invention that achieves the above object is characterized in that Q (Q <P, P is an integer of 2 or more) from gradation data having at least P (P is an integer of 2 or more) kinds of level values for each pixel. ) First gradation data conversion for converting into gradation data having various level values, and M (M is an integer equal to or greater than 2) from gradation data having N (N is an integer equal to or greater than 2) kinds of level values. An image processing apparatus that performs second gradation data conversion for converting to gradation data having various level values, wherein the sum of level values for each pixel is a threshold value in the second gradation data conversion. A pixel group generation unit that generates a pixel group by selecting pixels having the N types of level values until the above is satisfied, and data provision that provides the M types of level values to the predetermined pixels of the generated pixel group The main point is that the

かかる画像処理装置によれば、例えば、色補正処理の前に行う階調データの変換処理に際して、入力画像の階調データを、種類を減少したレベル値に変換することによって、入力画像の階調データにバラツキをあたえる。そして、その後ハーフトーン処理による階調データの変換処理において、バラツキが与えられた階調データを有する画素について、画素ごとの階調データのレベル値の総和が閾値以上となるまで、階調データの階調変換未処理画素を選択して画素群(以下、「セル」と呼ぶ)を生成する。そして、生成したセル内の画素のレベル値合計が閾値以上となったセルの所定画素に、M種類のレベル値を付与する。こうすることによって、画素の選択に際して、選択順をセルごとに変更しなくても画素の選択順がバラツクことになるため、生成されるセルの形状が不規則となり、特異パターンの発生を抑えた視覚的に快適な出力画像を得ることができる。   According to such an image processing device, for example, in the gradation data conversion process performed before the color correction process, the gradation data of the input image is converted into the level value with reduced types, thereby converting the gradation of the input image. Disperse data. Then, in the gradation data conversion process by the halftone process, for the pixels having the gradation data to which the variation is given, the gradation data is changed until the sum of the level values of the gradation data for each pixel becomes equal to or greater than the threshold value. A pixel group (hereinafter referred to as “cell”) is generated by selecting a pixel not subjected to gradation conversion. Then, M kinds of level values are assigned to the predetermined pixels of the cell in which the total level value of the pixels in the generated cell is equal to or greater than the threshold value. In this way, when selecting pixels, the selection order of the pixels varies even if the selection order is not changed for each cell. Therefore, the shape of the generated cell becomes irregular, and the occurrence of a unique pattern is suppressed. A visually comfortable output image can be obtained.

さらに、本発明の画像処理装置は、前記第2の階調データ変換の実施に際し、前記画素群生成部で生成した画素群の重心位置を決定する画素群重心決定部を備え、前記画素群生成部は、前記画素群重心決定部で決定した重心から最も近い画素を、画素ごとのレベル値の総和が閾値以上となるまで選択し続けることにより前記画素群を生成し、前記データ付与部は、前記画素群重心決定部で決定した重心に位置する画素に前記M種類のレベル値を付与することとしてもよい。   The image processing apparatus of the present invention further includes a pixel group centroid determining unit that determines a centroid position of the pixel group generated by the pixel group generating unit when performing the second gradation data conversion, and the pixel group generating unit The unit generates the pixel group by continuing to select the pixel closest to the centroid determined by the pixel group centroid determination unit until the sum of the level values for each pixel is equal to or greater than a threshold, and the data providing unit is The M kinds of level values may be given to pixels located at the center of gravity determined by the pixel group center of gravity determination unit.

こうすれば、セルの生成処理に際して、常にセルの重心に最も近い画素を選択してセルに組み入れていくため、生成されるセルの形状はセルの重心を中心としたおおよそ円形状になる。そして、その円のおおよそ中心位置にドットが形成されることになるため、例えば、形成されるドット間距離がほぼ均一で、ドットの分散性が向上し、快適な出力画像を得ることができる。   In this way, in the cell generation process, the pixel closest to the center of gravity of the cell is always selected and incorporated into the cell, so the shape of the generated cell is approximately circular with the center of gravity of the cell as the center. Since dots are formed at approximately the center position of the circle, for example, the formed inter-dot distance is substantially uniform, the dot dispersibility is improved, and a comfortable output image can be obtained.

ここで、前記画素群生成部は、前記画素群重心決定部で決定した重心から最も近い画素を、画素ごとのレベル値の総和が閾値以上となるまで選択し続け、選択した前記画素群におけるレベル値の総和が前記閾値を超えたとき、超えた分の前記レベル値を前記画素群生成部で最後に選択した前記画素に戻すこととしてもよい。   Here, the pixel group generation unit continues to select the pixel closest to the centroid determined by the pixel group centroid determination unit until the sum of the level values for each pixel is equal to or greater than a threshold, and the level in the selected pixel group When the sum of the values exceeds the threshold value, the excess level value may be returned to the pixel selected last by the pixel group generation unit.

こうすれば、閾値を超えたセルに最後に組み入れられた画素に、閾値を超えた分のレベル値を戻しているため、ハーフトーン処理前の入力画像のレベル値が失われず、元の画像とほぼ同じ位置に画像全体のレベル値が残るため、入力画像に忠実なドットを形成させることができる。   In this way, since the level value of the portion exceeding the threshold value is returned to the last pixel incorporated in the cell that exceeds the threshold value, the level value of the input image before halftone processing is not lost, and the original image and Since the level value of the entire image remains at substantially the same position, it is possible to form a faithful dot in the input image.

また、本発明の画像処理装置は、前記第1の階調データ変換の実施に際し、階調データ変換の手法として、組織的ディザ法または誤差拡散法または平均誤差最小法を用いることとしてもよい。こうすれば、例えば、入力画像がおおよそ同じ濃度を表す階調データであるような場合、入力画像の階調データのレベル値を所定のレベル値に変換することによって増減することができる。この結果、階調データがバラツクことになり、その後行われる第2の階調データ変換であるハーフトーン処理において、セルごとに画素の選択順を変更しなくても、ほぼ同じ形状のセルが生成される確率が減少し、出力画像に特異パターンが生じ難くなる。   The image processing apparatus of the present invention may use a systematic dither method, an error diffusion method, or an average error minimum method as a method of gradation data conversion when performing the first gradation data conversion. In this way, for example, when the input image is gradation data representing approximately the same density, it can be increased or decreased by converting the level value of the gradation data of the input image to a predetermined level value. As a result, the gradation data varies, and in the subsequent halftone process, which is the second gradation data conversion, cells having substantially the same shape are generated without changing the pixel selection order for each cell. The probability of being reduced is reduced, and a unique pattern is less likely to occur in the output image.

また、上記目的を達成する本発明の画像処理方法は、画素ごとに、少なくとも、P(Pは2以上の整数)種類のレベル値を有する階調データからQ(Q<P、Pは2以上の整数)種類のレベル値を有する階調データに変換する第1の階調データ変換と、N(Nは2以上の整数)種類のレベル値を有する階調データからM(Mは2以上の整数)種類のレベル値を有する階調データに変換する第2の階調データ変換とを行う画像処理方法であって、前記第2の階調データ変換の実施に際し、画素ごとのレベル値の総和が閾値以上となるまで前記N種類のレベル値を有する画素を選択して画素群を生成する画素群生成工程と、前記画素群生成工程で生成した画素群の重心位置を決定する画素群重心決定工程と、前記画素群重心決定工程で決定した重心に位置する画素に前記M種類のレベル値を付与するデータ付与工程とを備え、前記画素群生成工程は、前記画素群重心決定工程で決定した重心から最も近い画素を、画素ごとのレベル値の総和が閾値以上となるまで選択し続けることにより前記画素群を生成することを特徴とする。   Further, the image processing method of the present invention that achieves the above object is characterized in that Q (Q <P, P is 2 or more) from gradation data having at least P (P is an integer of 2 or more) kinds of level values for each pixel. First gradation data conversion for converting into gradation data having various level values, and M (M is two or more) from gradation data having N (N is an integer of two or more) kinds of level values. An integer) image processing method for performing second gradation data conversion for converting to gradation data having various kinds of level values, and performing the second gradation data conversion, the sum of the level values for each pixel A pixel group generation step of selecting a pixel having the N types of level values until a threshold value is equal to or greater than a threshold value to generate a pixel group, and a pixel group centroid determination of determining a centroid position of the pixel group generated in the pixel group generation step And the weight determined in the pixel group center of gravity determination step A data providing step for assigning the M kinds of level values to the pixels located at the pixel group, and the pixel group generation step selects a pixel closest to the center of gravity determined in the pixel group center of gravity determination step as a level value for each pixel. The pixel group is generated by continuing to select until the sum reaches a threshold value or more.

かかる画像処理方法によれば、例えば、色補正処理の前に行っていた階調データの変換処理に際して、種類数を減じたレベル値に、入力画像の階調データを変換することによって階調データにバラツキをあたえることができる。そして、その後行うハーフトーン処理による階調データの変換処理によって、このバラツキが与えられた階調データを有する画素を、所定の方法によって選択することによってセルを生成し、生成したセルの重心位置にドットを形成する。こうすることによって、画素の選択に際して選択順をセルごとに変更しなくても、同じような形状のセルが連続して生成される確率が減少するため、特異パターンの発生を抑えた視覚的に快適な出力画像を得ることができる。   According to such an image processing method, for example, in the gradation data conversion process performed before the color correction process, the gradation data is converted by converting the gradation data of the input image to the level value obtained by reducing the number of types. Can give variation. Then, a cell is generated by selecting a pixel having gradation data given this variation by a predetermined method by gradation data conversion processing by the subsequent halftone processing, and the center of gravity position of the generated cell is set. Form dots. In this way, even if the selection order is not changed for each cell at the time of pixel selection, the probability that cells having the same shape are continuously generated decreases, so that the occurrence of singular patterns can be suppressed visually. A comfortable output image can be obtained.

また、本発明はコンピュータプログラムまたはそのプログラムを記録した記録媒体としてもよい。すなわち、画素ごとに、少なくとも、P(Pは2以上の整数)種類のレベル値を有する階調データからQ(Q<P、Pは2以上の整数)種類のレベル値を有する階調データに変換する第1の階調データ変換と、N(Nは2以上の整数)種類のレベル値を有する階調データからM(Mは2以上の整数)種類のレベル値を有する階調データに変換する第2の階調データ変換とを行う画像処理プログラムであって、前記第2の階調データ変換の実施に際し、画素ごとのレベル値の総和が閾値以上となるまで前記N種類のレベル値を有する画素を選択して画素群を生成する画素群生成処理と、前記画素群生成処理で生成した画素群の重心位置を決定する画素群重心決定処理と、前記画素群重心決定処理で決定した重心に位置する画素に前記M種類のレベル値を付与するデータ付与処理とをコンピュータに実行させ、前記画素群生成処理は、前記画素群重心決定処理で決定した重心から最も近い画素を、画素ごとのレベル値の総和が閾値以上となるまで選択し続けることにより前記画素群を生成するプログラムであることを特徴とする。また、このプログラムを記録した記録媒体としては、フレキシブルディスクやCD−ROM、ICカード、パンチカードなど、コンピュータが読み取り可能な種々の媒体を利用することができる。   Further, the present invention may be a computer program or a recording medium recording the program. That is, for each pixel, gradation data having at least P (P is an integer of 2 or more) kinds of level values is changed to gradation data having Q (Q <P, P is an integer of 2 or more) kinds of level values. First gradation data conversion to be converted, and gradation data having N (N is an integer of 2 or more) kinds of level values to gradation data having M (M is an integer of 2 or more) kinds of level values An image processing program for performing the second gradation data conversion, wherein when the second gradation data conversion is performed, the N kinds of level values are obtained until the sum of the level values for each pixel becomes equal to or greater than a threshold value. A pixel group generation process for selecting a pixel to generate a pixel group, a pixel group centroid determination process for determining a centroid position of the pixel group generated by the pixel group generation process, and a centroid determined by the pixel group centroid determination process The M types of labels The pixel group generation process is such that the sum of the level values for each pixel is greater than or equal to a threshold value for the pixel closest to the center of gravity determined in the pixel group center of gravity determination process. It is a program for generating the pixel group by continuing to select until. As a recording medium on which the program is recorded, various computer-readable media such as a flexible disk, a CD-ROM, an IC card, and a punch card can be used.

さらに、上記目的を達成する本発明の画像処理装置は、画素ごとに、少なくとも、P(Pは2以上の整数)種類のレベル値を有する階調データからQ(Q<P、Pは2以上の整数)種類のレベル値を有する階調データに変換する第1の階調データ変換と、N(Nは2以上の整数)種類のレベル値を有する階調データからM(Mは2以上の整数)種類のレベル値を有する階調データに変換する第2の階調データ変換とを行う画像処理装置であって、前記第2の階調データ変換の実施に際し、画素選択のための第1の基準点に基づいて、画素ごとのレベル値の総和が閾値以上となるまで前記N種類のレベル値を有する画素を選択して画素群を生成する画素群生成部と、前記画素群生成部で生成した画素群の第2の基準点を決定する画素群基準点決定部と、前記画素群基準点決定部で決定した前記第2の基準点に位置する画素に前記M種類のレベル値を付与するデータ付与部とを備え、前記画素群生成部は、前記第1の基準点を更新させて当該第1の基準点に基づいて画素を選択するようにしたことを特徴とする。   Furthermore, the image processing apparatus of the present invention that achieves the above-described object provides Q (Q <P, P is 2 or more) from gradation data having at least P (P is an integer of 2 or more) kinds of level values for each pixel. First gradation data conversion for converting into gradation data having various level values, and M (M is two or more) from gradation data having N (N is an integer of two or more) kinds of level values. An integer) image processing apparatus that performs second gradation data conversion to be converted into gradation data having various level values, and the first gradation selection is performed when the second gradation data conversion is performed. A pixel group generation unit that generates a pixel group by selecting pixels having the N types of level values until the sum of the level values for each pixel is equal to or greater than a threshold value based on the reference point; and the pixel group generation unit Pixel group reference point determination for determining the second reference point of the generated pixel group And a data providing unit that provides the M kinds of level values to the pixels located at the second reference point determined by the pixel group reference point determination unit, and the pixel group generation unit includes the first The reference point is updated, and a pixel is selected based on the first reference point.

かかる画像処理装置によれば、セルの生成に際してセルに組み入れる画素を選択するための基準点と、生成したセルに形成するドットの位置を決定する基準点とを区別する。こうすれば、例えば、組み入れる画素をセルの形状によって特定される基準点を用いて選択し、セル内の各画素のレベル値に無関係にセルを生成することができる。この結果、セルの形状のみに着目して、組み入れる画素を選択することができる。   According to such an image processing apparatus, a reference point for selecting a pixel to be incorporated into a cell at the time of cell generation is distinguished from a reference point for determining a position of a dot formed in the generated cell. In this way, for example, a pixel to be incorporated can be selected using a reference point specified by the shape of the cell, and a cell can be generated regardless of the level value of each pixel in the cell. As a result, it is possible to select a pixel to be incorporated by paying attention only to the shape of the cell.

ここで、前記画像群生成部は、前記第1の基準点を、前記画素を所定の回数選択するごとに更新させることとしてもよい。こうすれば、例えば、生成されるセルが第1の基準点を固定にした場合よりも円状に形成される可能性が高くなり、ドット間距離が均一に保たれ快適な出力画像を得ることが可能となる。   Here, the image group generation unit may update the first reference point every time the pixel is selected a predetermined number of times. In this case, for example, the generated cell is more likely to be formed in a circular shape than when the first reference point is fixed, and a comfortable output image is obtained in which the distance between dots is kept uniform. Is possible.

さらに、前記第1の基準点は、前記選択した画素の位置から演算した中心位置であり、前記第2の基準点は、前記画素群の画素の位置と階調画素データ値とから演算した重心位置であることとしてもよい。こうすれば、画素群に組み入れる画素の選択を各画素の位置を基準に演算すればよく、重心を演算する場合に比べて計算処理に関する処理負荷を軽減できる。また形成するドットの位置は、生成したセルの重心とするため、入力画像の階調データに忠実なドットをセル内に形成することができる。   Further, the first reference point is a center position calculated from the position of the selected pixel, and the second reference point is a center of gravity calculated from the pixel position of the pixel group and the gradation pixel data value. It may be a position. In this way, selection of pixels to be incorporated into the pixel group may be calculated based on the position of each pixel, and the processing load related to calculation processing can be reduced compared to the case where the center of gravity is calculated. Further, since the position of the dot to be formed is the center of gravity of the generated cell, it is possible to form a dot faithful to the gradation data of the input image in the cell.

あるいは、前記第1の基準点は、前記選択した画素の位置から演算した中心位置であり、前記第2の基準点は、前記画素群の画素の位置から演算した中心位置であることとしてもよい。こうすれば、例えば、画素選択に用いる基準点およびドットを形成させるための基準点を決定する処理に際して、両方とも画素のレベル値を含めた演算を行う必要がなくなるので、計算量を少なくして装置全体の処理効率を上げることができる。   Alternatively, the first reference point may be a center position calculated from the position of the selected pixel, and the second reference point may be a center position calculated from the pixel position of the pixel group. . In this way, for example, in the process of determining the reference point used for pixel selection and the reference point for forming dots, it is not necessary to perform an operation including the level value of the pixel. The processing efficiency of the entire apparatus can be increased.

さらに、本発明の上記画像処理装置は、前記第1の階調データ変換の実施に際し、階調データ変換の手法として、組織的ディザ法または誤差拡散法または平均誤差最小法を用いることとしてもよい。こうすれば、例えば、入力画像がおおよそ同じ濃度の階調データであるような場合、入力画像の階調データのレベル値を所定のレベル値に変換することによって増減することができる。この結果、階調データがバラツクことになり、その後行われる第2の階調データ変換であるハーフトーン処理において、セルごとに画素の選択順を変更することなく、ほぼ同じ形状のセルが生成される確率が減少し、出力画像に特異パターンが生じ難くなる。   Furthermore, the image processing apparatus of the present invention may use a systematic dither method, an error diffusion method, or an average error minimum method as a method of gradation data conversion when performing the first gradation data conversion. . In this way, for example, when the input image is gradation data having approximately the same density, it can be increased or decreased by converting the level value of the gradation data of the input image into a predetermined level value. As a result, the gradation data varies, and cells having substantially the same shape are generated without changing the pixel selection order for each cell in the halftone process that is the second gradation data conversion performed thereafter. The probability of occurrence of a peculiar pattern is less likely to occur in the output image.

また、上記目的を達成する本発明の画像処理方法は、画素ごとに、少なくとも、P(Pは2以上の整数)種類のレベル値を有する階調データからQ(Q<P、Pは2以上の整数)種類のレベル値を有する階調データに変換する第1の階調データ変換と、N(Nは2以上の整数)種類のレベル値を有する階調データからM(Mは2以上の整数)種類のレベル値を有する階調データに変換する第2の階調データ変換とを行う画像処理方法であって、前記第2の階調データ変換の実施に際し、画素選択のための第1の基準点に基づいて、画素ごとのレベル値の総和が閾値以上となるまで前記N種類のレベル値を有する画素を選択して画素群を生成する画素群生成工程と、前記画素群生成工程で生成した画素群の第2の基準点を決定する画素群基準点決定工程と、前記画素群基準点決定工程で決定した前記第2の基準点に位置する画素に前記M種類のレベル値を付与するデータ付与工程とを備え、前記画素群生成工程は、前記第1の基準点を更新させて当該第1の基準点に基づいて画素を選択するようにしたことを特徴とする。こうすれば、例えば、セルの生成に際してセルに組み入れる画素を選択するための基準点と、生成したセルに形成するドットの位置を決定する基準点とを区別する。こうすれば、例えば、組み入れる画素をセルの形状によって特定される基準点を用いて選択し、セル内の各画素のレベル値に無関係にセルを生成することができる。この結果、セルの形状のみに着目して、組み入れる画素を選択することができる。   Further, the image processing method of the present invention that achieves the above object is characterized in that Q (Q <P, P is 2 or more) from gradation data having at least P (P is an integer of 2 or more) kinds of level values for each pixel. First gradation data conversion for converting into gradation data having various level values, and M (M is two or more) from gradation data having N (N is an integer of two or more) kinds of level values. An image processing method for performing second gradation data conversion for converting into gradation data having an integer) type of level value, wherein the first gradation selection is performed when the second gradation data conversion is performed. A pixel group generation step of generating a pixel group by selecting pixels having the N types of level values until the sum of the level values for each pixel is equal to or greater than a threshold value based on the reference point, and the pixel group generation step Pixel group reference point for determining the second reference point of the generated pixel group And a data providing step for assigning the M kinds of level values to the pixels located at the second reference point determined in the pixel group reference point determining step, wherein the pixel group generating step includes One reference point is updated, and a pixel is selected based on the first reference point. In this way, for example, a reference point for selecting a pixel to be incorporated into a cell when generating the cell is distinguished from a reference point for determining the position of a dot formed in the generated cell. In this way, for example, a pixel to be incorporated can be selected using a reference point specified by the shape of the cell, and a cell can be generated regardless of the level value of each pixel in the cell. As a result, it is possible to select a pixel to be incorporated by paying attention only to the shape of the cell.

さらに、本発明はコンピュータプログラムまたはそのプログラムを記録した記録媒体としてもよい。すなわち、画素ごとに、少なくとも、P(Pは2以上の整数)種類のレベル値を有する階調データからQ(Q<P、Pは2以上の整数)種類のレベル値を有する階調データに変換する第1の階調データ変換と、N(Nは2以上の整数)種類のレベル値を有する階調データからM(Mは2以上の整数)種類のレベル値を有する階調データに変換する第2の階調データ変換とを行う画像処理プログラムであって、前記第2の階調データ変換の実施に際し、画素選択のための第1の基準点に基づいて、画素ごとのレベル値の総和が閾値以上となるまで前記N種類のレベル値を有する画素を選択して画素群を生成する画素群生成処理と、前記画素群生成処理で生成した画素群の第2の基準点を決定する画素群基準点決定処理と、前記画素群基準点決定処理で決定した前記第2の基準点に位置する画素に前記M種類のレベル値を付与するデータ付与処理とをコンピュータに実行させ、前記画素群生成処理は、前記第1の基準点を更新させて当該第1の基準点に基づいて画素を選択するようにしたプログラムであることを特徴とする。また、このプログラムを記録した記録媒体としては、フレキシブルディスクやCD−ROM、ICカード、パンチカードなど、コンピュータが読み取り可能な種々の媒体を利用することができる。   Furthermore, the present invention may be a computer program or a recording medium recording the program. That is, for each pixel, gradation data having at least P (P is an integer of 2 or more) kinds of level values is changed to gradation data having Q (Q <P, P is an integer of 2 or more) kinds of level values. First gradation data conversion to be converted, and gradation data having N (N is an integer of 2 or more) kinds of level values to gradation data having M (M is an integer of 2 or more) kinds of level values An image processing program for performing the second gradation data conversion, wherein when the second gradation data conversion is performed, the level value for each pixel is determined based on the first reference point for pixel selection. A pixel group generation process for generating a pixel group by selecting pixels having the N types of level values until the sum exceeds a threshold value, and a second reference point of the pixel group generated by the pixel group generation process is determined. Pixel group reference point determination processing and pixel group reference point determination And causing the computer to execute a data providing process for assigning the M kinds of level values to the pixels located at the second reference point determined in the process, and the pixel group generation process updates the first reference point. And a program for selecting a pixel based on the first reference point. As a recording medium on which the program is recorded, various computer-readable media such as a flexible disk, a CD-ROM, an IC card, and a punch card can be used.

次に、本発明を実施するための最良の形態を説明する。   Next, the best mode for carrying out the present invention will be described.

図1は、本発明が適用されるシステム全体を示す構成図である。全体としてホストコンピュータ10と、画像出力装置20とから構成される。   FIG. 1 is a block diagram showing 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へ出力する。もとより、ホストコンピュータ10は、スキャナなどの画像入力装置(図示せず)から出力されるデータを受け付け、このデータをアプリケーション部11が生成するデータとしてラスタライズ部12へ出力するものとしても差し支えない。   The host computer 10 includes an application unit 11 and a rasterizing unit 12. The application unit 11 generates output image data to be printed, such as character data, graphic data, and bitmap data. For example, the host computer 10 generates character data, graphic data, and the like by operating a keyboard or the like using an application program such as a word processor or a graphic tool. The generated data is output to the rasterizing unit 12. Of course, the host computer 10 may accept data output from an image input device (not shown) such as a scanner and output this data to the rasterization unit 12 as data generated by the application unit 11.

ラスタライズ部12は、アプリケーション部11から出力された印刷対象のデータを画素ごと(又はドットごと)に8ビットの階調データに変換する。本実施形態では、R(レッド)、G(グリーン)、B(ブルー)の色毎で、画素ごとに8ビットの階調データを出力する。したがって、出力される階調データは、画素ごとに0から255までの256種類の値(レベル値)を有することになる。ラスタライズ部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). In the present embodiment, 8-bit gradation data is output for each pixel for each color of R (red), G (green), and B (blue). Therefore, the output gradation data has 256 kinds of values (level values) from 0 to 255 for each pixel. The gradation data generation processing in the rasterizing unit 12 is actually performed 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.

画像出力装置20は、全体として画像処理部30と印刷エンジン40とから構成される。画像処理部30では、ホストコンピュータ10から出力された階調データに対して、まず階調数を変換する階調データ変換処理を行ったのち、色補正及び色変換処理、ハーフトーン処理、パルス幅変調処理を行い、処理後のデータが印刷エンジン40に出力され、この印刷エンジン40にて実際に印刷用紙等の記録媒体への印刷が行われる。   The image output apparatus 20 includes an image processing unit 30 and a print engine 40 as a whole. The image processing unit 30 first performs gradation data conversion processing for converting the number of gradations on the gradation data output from the host computer 10, and then performs color correction and color conversion processing, halftone processing, pulse width. Modulation processing is performed, and the processed data is output to the print engine 40. The print engine 40 actually performs printing on a recording medium such as printing paper.

画像処理部30は、階調データ変換部31と色補正及び色変換部32と、ハーフトーン処理部34と、パルス幅変調部35とから構成される。階調データ変換部31は、ホストコンピュータ10から出力される256種類のレベル値を有するRGB各8ビット(計24ビット)の階調データを受け取り、256種類より少ない種類のレベル値を有するRGBの階調データへ変換処理を行う。この変換処理によって、ホストコンピュータ10が出力した階調データにバラツキを持たせることができる。ここでの階調データの変換処理として、本実施形態では、誤差拡散法を用いることとする。この処理の具体的な内容は後述する。   The image processing unit 30 includes a gradation data conversion unit 31, a color correction and color conversion unit 32, a halftone processing unit 34, and a pulse width modulation unit 35. The gradation data converting unit 31 receives gradation data of 8 bits each of RGB (256 bits in total) having 256 kinds of level values output from the host computer 10 and receives RGB gradation data having less than 256 kinds of level values. Conversion processing to gradation data is performed. By this conversion processing, the gradation data output from the host computer 10 can be varied. In this embodiment, the error diffusion method is used as the gradation data conversion processing here. The specific contents of this process will be described later.

次に、色補正及び色変換部32は、階調変換されたRGBの階調データを受け取り、印刷エンジン40にて実際に印刷された印刷物において良好な色再生が得られるように、色補正表33を用いてRGBの階調データの補正処理を行う。その後、補正したRGBの階調データを、RGBからCMYに色変換処理を行うのである。ここで、Cはシアン、Mはマゼンタ、Yはイエローを示す。   Next, the color correction and color conversion unit 32 receives the gradation-converted RGB gradation data, and the color correction table so that good color reproduction can be obtained in the printed matter actually printed by the print engine 40. 33 is used to correct RGB gradation data. Thereafter, color correction processing is performed on the corrected RGB gradation data from RGB to CMY. Here, C represents cyan, M represents magenta, and Y represents yellow.

ハーフトーン処理部34は、色補正及び色変換部32から出力されるCMYの階調データに対して、所定の種類のレベル値を閾値とした量子化データ(2値あるいは4値などの多値の値)に変換し、その量子化データを出力する。ハーフトーン処理として、本実施形態では、複数の画素からなるセルを、画素群の重心を用いてセルを構成し、その重心にドットを生成させる処理(Circular Cell法、以下CC法)を用いる。CC法の具体的な内容は後述する。   The halftone processing unit 34 quantizes the CMY gradation data output from the color correction and color conversion unit 32 (multi-value such as binary or quaternary) using a predetermined type of level value as a threshold value. Value) and output the quantized data. In the present embodiment, as the halftone process, a process (Circular Cell method, hereinafter referred to as CC method) is used in which a cell composed of a plurality of pixels is formed using the center of gravity of the pixel group, and a dot is generated at the center of gravity. Specific contents of the CC method will be described later.

パルス幅変調部35は、ハーフトーン処理部34から出力された量子化データを入力し、この量子化データに対して所定のパルス幅をもったレーザ駆動パルスを、駆動データとして生成する。そして、この駆動データを印刷エンジン40に出力する。   The pulse width modulation unit 35 receives the quantized data output from the halftone processing unit 34, and generates a laser driving pulse having a predetermined pulse width as driving data for the quantized data. Then, this drive data is output to the print engine 40.

印刷エンジン40は、レーザドライバ41とレーザーダイオード(LD)42とから構成される。レーザドライバ41は、入力された駆動データから、レーザーダイオード42を駆動する制御データを生成し、レーザーダイオード42に出力する。レーザーダイオード42は、レーザドライバ41から出力された制御データに基づいて駆動され、さらに図示しない感光ドラムや転写ベルトが駆動されて、実際に印刷用紙等の記録媒体にホストコンピュータ10からのデータが印刷されることになる。   The print engine 40 includes a laser driver 41 and a laser diode (LD) 42. The laser driver 41 generates control data for driving the laser diode 42 from the input drive data and outputs the control data to the laser diode 42. The laser diode 42 is driven based on the control data output from the laser driver 41, and further, a photosensitive drum and a transfer belt (not shown) are driven to actually print data from the host computer 10 on a recording medium such as printing paper. Will be.

図1において、このような色補正処理の前に行う階調データのレベル値の種類数を減らす階調変換処理をプレ階調変換処理とも呼ぶ。また、プレ階調変換処理の後にハーフトーン処理のような階調データ変換処理を行う場合は、このような階調変換処理を、プレ階調変換処理に対してポスト階調変換処理とも呼ぶ。また、プレ階調変換は本発明の請求項に記載した第1の階調データ変換に相当し、ポスト階調変換は本発明の請求項に記載した第2の階調データ変換に相当する。   In FIG. 1, the gradation conversion process for reducing the number of types of gradation data level values performed before such color correction processing is also referred to as pre-gradation conversion processing. Further, when gradation data conversion processing such as halftone processing is performed after pre-gradation conversion processing, such gradation conversion processing is also referred to as post-gradation conversion processing with respect to pre-gradation conversion processing. The pre-gradation conversion corresponds to the first gradation data conversion described in the claims of the present invention, and the post-gradation conversion corresponds to the second gradation data conversion described in the claims of the present invention.

次に、図2を参照して、画像出力装置20の具体的構成について説明する。ここで、図1の画像出力装置20のうち、階調データ変換部31、色補正及び色変換部32、色補正表33、ハーフトーン処理部34及びパルス幅変調部35は、図2におけるCPU22、ハードディスク25、ROM26、及びRAM27に対応する。   Next, a specific configuration of the image output apparatus 20 will be described with reference to FIG. Here, in the image output device 20 in FIG. 1, the gradation data conversion unit 31, the color correction and color conversion unit 32, the color correction table 33, the halftone processing unit 34, and the pulse width modulation unit 35 are the CPU 22 in FIG. Corresponds to the hard disk 25, ROM 26, and RAM 27.

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

CPU22は、バスを介して、入力I/F21、ハードディスク25、ROM26、RAM27、印刷エンジン40それぞれと接続され、ハードディスク25またはROM26に格納されたプログラムを読み出して、後述する階調データ変換、ハーフトーン処理等の各種処理を行う。これらの処理を記録したプログラムは、予めハードディスク25やROM26に格納されていることとしてもよいし、例えばCD−ROMなどのコンピュータが読み取り可能な記録媒体によって外部から供給され、図示しないCD−R/RWドライブを介して画像出力装置20に備えられたハードディスク25に記憶することによって格納されるものとしてもよい。もとより、インターネットなどのネットワーク手段を介して、プログラムを供給するサーバー等にアクセスし、データをダウンロードすることによって格納されるものとしてもよい。   The CPU 22 is connected to the input I / F 21, the hard disk 25, the ROM 26, the RAM 27, and the print engine 40 via the bus, reads out a program stored in the hard disk 25 or the ROM 26, and performs gradation data conversion and halftone described later. Various processing such as processing is performed. The program in which these processes are recorded may be stored in advance in the hard disk 25 or the ROM 26, or may be supplied from the outside by a computer-readable recording medium such as a CD-ROM, and is not shown in the figure. The image may be stored by being stored in the hard disk 25 provided in the image output device 20 via the RW drive. Of course, it may be stored by accessing a server or the like that supplies a program via a network means such as the Internet and downloading data.

RAM27は、CPU22の制御によって実行される各処理のワーキングメモリとして役割を果たし、処理後の各種データを格納する。そして、印刷エンジン40のレーザドライバ41を駆動するための駆動データも格納する。RAM27の具体的構成等については後述する。   The RAM 27 serves as a working memory for each process executed under the control of the CPU 22 and stores various data after the process. Then, drive data for driving the laser driver 41 of the print engine 40 is also stored. A specific configuration of the RAM 27 will be described later.

印刷エンジン40は、図1の印刷エンジンと同様の構成で、CPU22の制御によりRAM27に格納された駆動データを入力し、上述した印刷処理を行うことになる。   The print engine 40 has the same configuration as that of the print engine of FIG. 1, and receives the drive data stored in the RAM 27 under the control of the CPU 22 and performs the above-described print processing.

次に、以上のように構成された画像出力装置20が行う具体的な処理を説明する前に、画像処理部30における各処理によって、ホストコンピュータ10が出力した階調データがどのように変換されるのかを図3を用いて説明する。これは、後ほど説明する本実施形態におけるプレ階調変換処理とポスト階調変換処理についての補足説明であり、説明の煩雑さを避けるため事前に説明を行うものである。   Next, before describing specific processing performed by the image output apparatus 20 configured as described above, how the gradation data output from the host computer 10 is converted by each processing in the image processing unit 30. This will be described with reference to FIG. This is a supplementary explanation of the pre-gradation conversion process and the post-gradation conversion process in the present embodiment, which will be described later, and will be described in advance in order to avoid complicated explanation.

図3において、まず、プレ階調変換部31には、ホストコンピュータ10が出力したR,G,Bの階調データRi、Gi、Biが入力される。Ri、Gi、Biの階調データはそれぞれ256階調すなわち0から255まで256種類のレベル値を有する階調データである。本実施形態では、プレ階調変換部31は、このR,G,Bデータを256階調から17階調へ変換処理する。この変換処理の目的は、上記で説明したように、入力画像データを意図的にバラツキを与えるためである。もとより、次に行う色補正処理を高速化するためでもある。   In FIG. 3, first, R, G, B gradation data Ri, Gi, Bi output from the host computer 10 are input to the pre-gradation conversion unit 31. The gradation data of Ri, Gi, Bi is 256 gradations, that is, gradation data having 256 kinds of level values from 0 to 255. In the present embodiment, the pre-gradation conversion unit 31 converts the R, G, B data from 256 gradations to 17 gradations. The purpose of this conversion process is to intentionally vary the input image data as described above. Of course, this is also for speeding up the color correction processing to be performed next.

プレ階調変換部31は、階調変換処理によって変換した17種類のレベル値(0、15、31、47、63、79、95、111、127、143、159、175、181、207、223、239、255)を有するR,G,Bの階調データRk,Gk,Bkを出力する。プレ階調変換の17個のレベル値は、ほぼ等間隔であるが、必ずしもそうである必要はない。   The pre-gradation conversion unit 31 has 17 kinds of level values (0, 15, 31, 47, 63, 79, 95, 111, 127, 143, 159, 175, 181, 207, 223) converted by the gradation conversion process. 239, 255), R, G, B gradation data Rk, Gk, Bk are output. The 17 level values of the pre-gradation conversion are substantially equally spaced, but this need not be the case.

次に、色補正及び色変換部32は、色補正表33を用いてRk,Gk,Bkのデータの色補正処理を行うと共に、R,G,BからC(シアン),M(マゼンタ),Y(イエロー)への色変換処理を行う。色変換処理は通常所定の色変換表(図示せず)を用いて行われる。本実施形態では、色変換に際して用いる色変換表のCMYの階調データは、各色8ビットずつの階調データとなっており、色補正及び色変換部32が出力する階調データCc、Mc、Ycは、0から255まで256種類のレベル値を有する階調データであるものとする。   Next, the color correction and color conversion unit 32 performs color correction processing of Rk, Gk, and Bk data using the color correction table 33, and from R, G, B to C (cyan), M (magenta), A color conversion process to Y (yellow) is performed. The color conversion process is usually performed using a predetermined color conversion table (not shown). In this embodiment, the CMY gradation data of the color conversion table used for color conversion is gradation data of 8 bits for each color, and gradation data Cc, Mc, Yc is gradation data having 256 kinds of level values from 0 to 255.

次に、本実施形態では、ポスト階調変換部34にて、ドットのオンオフを制御する2値化処理を行うものとして説明することとし、ポスト階調変換部34が出力する階調データCp、Mp、Ypは、2種類のレベル値0かレベル値255かに2値化(量子化)された階調データを出力する。最終的に、画像出力装置20は、出力されたレベル値に応じてドットの大きさとドットのオンオフを制御して印刷を行うのである。   Next, in the present embodiment, the post gradation conversion unit 34 will be described as performing binarization processing for controlling dot on / off, and the gradation data Cp, Mp and Yp output gradation data binarized (quantized) into two kinds of level values 0 or 255. Finally, the image output apparatus 20 performs printing by controlling dot size and dot on / off according to the output level value.

それでは、このような本実施形態における階調データを変換する処理について、図4のフローチャートを用いて説明する。この処理が開始されると、まずステップS10にて、ホストコンピュータ10が出力した画像データの入力処理を行う。続いて、本実施形態では、ステップS20にて誤差拡散法によるプレ階調変換処理を行う。   Now, the process of converting the gradation data in this embodiment will be described with reference to the flowchart of FIG. When this processing is started, first, in step S10, input processing of image data output from the host computer 10 is performed. Subsequently, in the present embodiment, pre-gradation conversion processing by the error diffusion method is performed in step S20.

誤差拡散法によるプレ階調変換処理について、図5〜図8を用いて説明する。誤差拡散法は、ドットマトリクス状に配列される入力画像の画素に対して注目画素を決め、この注目画素について水平方向(入力画像の画面左から右方向)の主走査を繰り返しつつ走査ラインを垂直方向(入力画像の画面上から下方向)に移動する副走査を実行することにより、全画素について階調データを所定の種類のレベル値を有する階調データに階調変換する。このようにして、注目画素を走査していくことにより、図5に示したように、注目画素上方行と下方行は階調変換済み領域と未変換領域とに分かれる。さらに注目画素の左方列と右方列も階調変換済み領域と階調未変換領域とに分かれる。基本的には階調変換した所定の種類のレベル値と、階調変換前の元のレベル値との差分値、つまり量子化による誤差データ値(以降、単に「誤差データ」)を、注目画素の右方及び下方に割り当てることにより、入力画像全体での階調データの誤差を少なくするのである。   The pre-gradation conversion process by the error diffusion method will be described with reference to FIGS. In the error diffusion method, a pixel of interest is determined for a pixel of an input image arranged in a dot matrix, and the scanning line is vertically aligned while repeating main scanning in the horizontal direction (from the left side of the input image to the right) for this pixel of interest. By executing sub-scanning that moves in the direction (downward from the top of the screen of the input image), the gradation data is converted into gradation data having a predetermined type of level value for all pixels. By scanning the pixel of interest in this way, as shown in FIG. 5, the upper row and the lower row of the pixel of interest are divided into gradation converted regions and unconverted regions. Further, the left column and the right column of the pixel of interest are also divided into a tone converted region and a tone non-converted region. Basically, a difference value between a predetermined type of gradation-converted level value and the original level value before gradation conversion, that is, an error data value by quantization (hereinafter simply referred to as “error data”) is used as a target pixel. By assigning them to the right and below, the error of the gradation data in the entire input image is reduced.

また、図6(a)〜(d)に示すように、差分値の割り当てに際しては、注目画素に対して所定の画素に重み付けをして誤差データを分散させている。このように所定の画素に重み付けをして分散することによって、入力画像の階調データに意図的なバラツキを持たせることができるのである。   As shown in FIGS. 6A to 6D, when assigning difference values, error data is distributed by weighting predetermined pixels with respect to the target pixel. In this way, by weighting and dispersing predetermined pixels, it is possible to give intentional variation to the gradation data of the input image.

それでは、本実施形態での17階調へのプレ階調変換処理について、図7のフローチャートと図8の模式図を用いて説明する。なお本実施形態での誤差データの分散は、図6(a)の重み付け方法を用いて行うものとしている。注目画素に生じた誤差データを、右隣の画素に2、下の画素に1、右下の画素に1の割合で分散するのである。   The pre-gradation conversion process to 17 gradations in this embodiment will be described with reference to the flowchart in FIG. 7 and the schematic diagram in FIG. Note that the distribution of error data in this embodiment is performed using the weighting method of FIG. The error data generated in the target pixel is distributed in a ratio of 2 to the right adjacent pixel, 1 to the lower pixel, and 1 to the lower right pixel.

この処理において、まず、p行q列目の画素に着目する。そしてこの画素のR,G,B各成分の階調データRi,Gi,Biを、例えばB成分であればdataB〔p〕〔q〕と表す。これを、R,G,Bそれぞれの成分について17階調化するのであるが、一例として、以下B成分を17階調化する処理について説明する。もとより、G,B成分についても処理は基本的に同じである。なお、p行q列目の画素の17階調化によって生じる誤差データを、err〔p〕〔q〕と表す。   In this process, attention is first focused on the pixel in the p-th row and the q-th column. The gradation data Ri, Gi, Bi of the R, G, B components of the pixel is represented as dataB [p] [q] for the B component, for example. This is converted to 17 gradations for each of the R, G, and B components. As an example, processing for converting the B component to 17 gradations will be described below. Of course, the processing is basically the same for the G and B components. Note that error data generated by the 17th gradation of the pixel in the p row and the q column is represented as err [p] [q].

同じくこの処理において、プレ階調変換処理後のB成分のレベル値(pre_B)を以下のように表す。
pre_B〔0〕=0;
pre_B〔1〕=15;
pre_B〔2〕=31;
pre_B〔3〕=47;

pre_B〔15〕=239;
pre_B〔16〕=255;
Similarly, in this process, the level value (pre_B) of the B component after the pre-gradation conversion process is expressed as follows.
pre_B [0] = 0;
pre_B [1] = 15;
pre_B [2] = 31;
pre_B [3] = 47;
...
pre_B [15] = 239;
pre_B [16] = 255;

また、プレ階調変換処理のために用いる16種類の閾値を「slsh〔i〕(i=0,1,2,…,15)」と定義し、slsh〔i〕=(pre_B〔i〕+pre_B〔i+1〕)/2となる値に設定する。この場合、具体的には閾値はつぎのようになる。
slsh〔0〕=7;
slsh〔1〕=23;
slsh〔2〕=39;

slsh〔15〕=247;
Further, 16 types of threshold values used for the pre-gradation conversion process are defined as “slsh [i] (i = 0, 1, 2,..., 15)”, and slsh [i] = (pre_B [i] + pre_B [I + 1]) / 2. In this case, specifically, the threshold value is as follows.
slsh [0] = 7;
slsh [1] = 23;
slsh [2] = 39;
...
slsh [15] = 247;

図7の処理が開始されると、最初にステップS201にて、入力画像データのp行q列目の注目画素のdata_Bのレベル値がslsh〔0〕のレベル値より小さいか否かを判定する処理を行う。判定の結果、注目する画素のdata_Bのレベル値が小さい場合は(YES)、pre_Bのレベル値をpre_B〔0〕の値0とする(ステップS202)。   When the processing of FIG. 7 is started, first, in step S201, it is determined whether or not the level value of data_B of the pixel of interest in the p-th row and the q-th column of the input image data is smaller than the level value of slsh [0]. Process. As a result of the determination, if the level value of data_B of the pixel of interest is small (YES), the level value of pre_B is set to 0 of pre_B [0] (step S202).

一方、data_Bのレベル値がslsh〔0〕より大きい場合は(NO)、ステップS203にて、注目画素のレベル値が、設定したそれぞれの閾値slsh〔0〕からslsh〔15〕のうち、どれかの閾値間に存在するか否かを判定する処理を行う。そして、どれかの閾値間にレベル値が存在する場合は(YES)、pre_Bのレベル値をその閾値間に存在するレベル値に設定する処理を行う(ステップS204)。   On the other hand, if the level value of data_B is greater than slsh [0] (NO), in step S203, the level value of the target pixel is any of the set threshold values slsh [0] to slsh [15]. The process of determining whether or not it exists between the threshold values is performed. If a level value exists between any threshold values (YES), a process of setting the level value of pre_B to a level value existing between the threshold values is performed (step S204).

一方、data_Bのレベル値が設定した閾値間に存在しない場合は(NO)、ステップS205にて、閾値slsh〔15〕以上か否かを判定する処理を行う。判定の結果、data_Bのレベル値が閾値slsh〔15〕以上であれば(YES)、pre_Bのレベル値をpre_B〔16〕の値255とする(ステップS206)。   On the other hand, if the level value of data_B does not exist between the set threshold values (NO), in step S205, it is determined whether or not the value is greater than or equal to the threshold slsh [15]. As a result of the determination, if the level value of data_B is equal to or greater than the threshold value slsh [15] (YES), the level value of pre_B is set to a value 255 of pre_B [16] (step S206).

基本的に、data_Bは以上の処理によって、17種類のレベル値のどれかに階調変換されることになるが、もしいずれにも変換されない場合、すなわちステップS205にて判定の結果NOである場合はデータエラーとして処理を終了する。   Basically, data_B is gradation-converted to any one of 17 kinds of level values by the above processing, but if it is not converted to any of them, that is, if the result of determination in step S205 is NO Terminates processing as a data error.

次に、ステップS202、S204、S206にて何れかに設定された階調データのレベル値pre_Bとdata_B〔p〕〔q〕とからerr〔p〕〔q〕を算出する処理を行う(ステップS207)。そして、次のステップS208にて、算出したerr〔p〕〔q〕を、図6(a)の重み付けに従って所定の画素に分散する処理を行う。   Next, a process of calculating err [p] [q] from the level value pre_B and data_B [p] [q] of the gradation data set in any one of steps S202, S204, and S206 is performed (step S207). ). In the next step S208, the calculated err [p] [q] is distributed to predetermined pixels in accordance with the weighting shown in FIG.

以上の処理を、所定の画素の走査順に従って行い、p、qすべて終了したか否かを判定し(ステップS209)、終了していない場合は(NO)p、qを更新し(ステップS210)、順次画素の階調データを変換することによって入力画像全ての画素について処理を終了し(YES)、プレ変換処理を終了する。もとより、入力画像の一行一列目の画素を最初の走査画素とし、その後、前述した主走査および副走査方法に従って注目画素を更新するのである。   The above processing is performed in accordance with the scanning order of predetermined pixels, and it is determined whether or not all p and q have been completed (step S209). If not completed (NO), p and q are updated (step S210). Then, by sequentially converting the gradation data of the pixels, the processing for all the pixels of the input image is finished (YES), and the pre-conversion processing is finished. Of course, the pixel in the first row and the first column of the input image is set as the first scanning pixel, and then the target pixel is updated according to the main scanning and sub-scanning methods described above.

図7のフローチャートで示した処理の様子を、一例として、図8の模式図を用いて説明する。ここでは、入力画像のB成分のレベル値が85である階調データをプレ階調変換するものとする。図8(a)に示したように、p行q列目の画素を注目画素とする。以降、画素を(q,p)というように表記する。   The process shown in the flowchart of FIG. 7 will be described as an example with reference to the schematic diagram of FIG. Here, it is assumed that the gradation data whose level value of the B component of the input image is 85 is pre-gradation converted. As shown in FIG. 8A, the pixel in the p-th row and the q-th column is set as a target pixel. Hereinafter, the pixel is expressed as (q, p).

閾値との比較によって、図8(b)に示したように、(q,p)はレベル値79の階調データに変換される。そして誤差データ6(=85−79)を重み付け方法に従って、(q+1,p)に3、(q,p+1)に1.5、(q+1,p+1)に1.5の誤差データをそれぞれ分散する。走査方法に従って(q+1,p)を次の注目画素とし(図8(c)網掛け部)、閾値との比較によって(q+1,p)はレベル値95の階調データに変換される(図8(d))。そして誤差データ−7(=88−95)を重み付け方法に従って、(q+2,p)に−3.5、(q+1,p+1)に−1.75、(q+2,p+1)に−1.75の誤差データをそれぞれ分散する。次に、走査方法に従って(q+2,p)を注目画素とし(図8(e)網掛け部)、閾値との比較によって(q+2,p)はレベル値79の階調データに変換される(図8(f))。そして誤差データ2.5(=81.5−79)を重み付け方法に従って、(q+3,p)に1.25、(q+2,p+1)に0.625、(q+3,p+1)に0.625の誤差データをそれぞれ分散する。このように階調データの変換処理を入力画像の全ての画素について繰り返し実施し、プレ階調変換処理を行うのである。   By comparison with the threshold value, (q, p) is converted into gradation data having a level value 79 as shown in FIG. Then, error data 6 (= 85-79) is distributed according to a weighting method, with error data of 3 in (q + 1, p), 1.5 in (q, p + 1), and 1.5 in (q + 1, p + 1). According to the scanning method, (q + 1, p) is set as the next pixel of interest (FIG. 8 (c), shaded portion), and (q + 1, p) is converted into gradation data having a level value of 95 by comparison with the threshold value (FIG. 8). (D)). Then, according to the weighting method, the error data -7 (= 88-95) is -3.5 in (q + 2, p), -1.75 in (q + 1, p + 1), and -1.75 in (q + 2, p + 1). Distribute each data. Next, according to the scanning method, (q + 2, p) is set as a target pixel (FIG. 8 (e), shaded portion), and (q + 2, p) is converted into gradation data having a level value 79 by comparison with a threshold value (FIG. 8). 8 (f)). The error data 2.5 (= 81.5−79) is an error of 1.25 for (q + 3, p), 0.625 for (q + 2, p + 1), and 0.625 for (q + 3, p + 1) according to the weighting method. Distribute each data. In this way, the gradation data conversion process is repeatedly performed for all the pixels of the input image, and the pre-gradation conversion process is performed.

以上説明したように、図8(f)に示した太枠で囲んだ画素と、図8(a)に示した画素との比較によって明らかなように、プレ階調変換によって入力階調データにバラツキを与えることができる。   As described above, the input gradation data is converted into the input gradation data by the pre-gradation conversion, as is apparent from the comparison between the pixels surrounded by the thick frame shown in FIG. 8F and the pixels shown in FIG. Can give variation.

次に図4に戻り、次のステップS30にてプレ階調変換後の階調データRk,Gk,Bkの色補正及び色変換処理を行う。本実施形態では、前述したように、色変換処理によって256階調を有するCc、Mc、Ycの階調データに変換するが、もとより、これらのCMYで表された階調データはプレ階調変換によって与えられたバラツキを有したものとなる。   Next, returning to FIG. 4, color correction and color conversion processing of the gradation data Rk, Gk, Bk after the pre-gradation conversion is performed in the next step S30. In this embodiment, as described above, the color conversion process converts the gradation data into Cc, Mc, and Yc gradation data having 256 gradations. With the variation given by.

次に、ステップS40にてCC法によるポスト階調変換処理を行う。CC法によるポスト階調変換の具体的な処理内容について、図9のフローチャートと図10の模式図を用いて説明する。ここでは、0と255の2種類のレベル値に階調変換(2値化)するものとして説明する。なお、図9のフローチャートで示した処理は、Cc、Mc、Ycのそれぞれの色成分の階調データに対して行われるものである。   Next, post gradation conversion processing by the CC method is performed in step S40. The specific processing content of post tone conversion by the CC method will be described with reference to the flowchart of FIG. 9 and the schematic diagram of FIG. Here, description will be made assuming that gradation conversion (binarization) is performed on two kinds of level values of 0 and 255. Note that the processing shown in the flowchart of FIG. 9 is performed on the gradation data of each color component of Cc, Mc, and Yc.

ポスト階調変換が実施されると、まずステップS401にて、入力画像を読み込む処理を行う。ここでは色成分Ccの階調データを入力画像として読み込むものとする。読み込んだ階調データの一例を図10(a)に示した。例えば、m行n列目の画素(以降(n,m)と表す)には、レベル値50の階調データが与えられている。   When post tone conversion is performed, first, in step S401, processing for reading an input image is performed. Here, the gradation data of the color component Cc is read as an input image. An example of the read gradation data is shown in FIG. For example, gradation data having a level value of 50 is given to the pixel in the m-th row and the n-th column (hereinafter referred to as (n, m)).

次にステップS402で、ポスト階調変換が未処理である画素を探索する処理を行い、探索未処理画素が有るか否かを判定する処理を行う。未処理画素の探索は、図5と同様、常に、まず水平方向に探索走査を行い、次に垂直方向へ探索走査を行う。すなわち、未処理画素が有る場合は、入力画像の全体で最も上側にある画素のうち、最も左側にある画素を探索することになる。もとより、ポスト階調変換処理の開始時では、1行1列目の画素(1,1)が探索されることになる。   Next, in step S402, a process for searching for a pixel for which post-gradation conversion has not been performed is performed, and a process for determining whether there is a search unprocessed pixel is performed. In the search for unprocessed pixels, as in FIG. 5, the search scan is always performed in the horizontal direction first, and then the search scan is performed in the vertical direction. That is, when there is an unprocessed pixel, the leftmost pixel is searched for among the uppermost pixels in the entire input image. Of course, at the start of the post-gradation conversion process, the pixel (1, 1) in the first row and the first column is searched.

次に、判定の結果、未処理画素が有った場合(YES)、次のステップS404へ進む。一方、判定の結果、未処理画素が無い場合は(NO)、入力画像全体はポスト階調変換されたものとして、2値化画像を出力する処理を行い(ステップS403)、ポスト階調変換処理ルーチンを終了する。   Next, when there is an unprocessed pixel as a result of the determination (YES), the process proceeds to the next step S404. On the other hand, if there is no unprocessed pixel as a result of the determination (NO), the entire input image is post-gradation converted, and a process of outputting a binarized image is performed (step S403), and the post-gradation conversion process is performed. End the routine.

ステップS404では、セルの拡大終了条件が成立するか否かを判定する処理を行う。そして、判定の結果、NOの場合はセルを拡大する処理を行う(ステップS405)。本実施形態では、セル内の画素のレベル値合計が255未満であることがセルを拡大する条件となる。また、セルの重心から最も近い画素をセルに組み入れることによってセルの拡大を行う。一方、判定の結果、YESの場合はセルの拡大を終了し、ステップS406へ進む。   In step S404, a process for determining whether or not a cell expansion end condition is satisfied is performed. If the result of determination is NO, processing for enlarging the cell is performed (step S405). In the present embodiment, the condition for expanding the cell is that the total level value of the pixels in the cell is less than 255. Further, the cell is expanded by incorporating the pixel closest to the center of gravity of the cell into the cell. On the other hand, if the result of determination is YES, cell expansion is terminated, and processing proceeds to step S406.

ステップS404およびステップS405での処理について、図10を用いて具体的に説明する。いま、探索した未処理画素が図10(a)の網掛け部で示したm行n列目の画素(n,m)であり、他の画素も全て未処理画素であったとする。このとき、(n,m)1画素のセルCLが生成されたことになる。そしてセルCLの重心GCの位置は、画素(n,m)の中心になる。   The processing in step S404 and step S405 will be specifically described with reference to FIG. Now, it is assumed that the searched unprocessed pixel is the pixel (n, m) in the m-th row and the n-th column indicated by the shaded portion in FIG. 10A, and all other pixels are also unprocessed pixels. At this time, a cell CL of (n, m) 1 pixel is generated. The position of the center of gravity GC of the cell CL is the center of the pixel (n, m).

次にセルCL内の画素のレベル値の合計は50となり、255未満であるので、セルCLの重心位置を算出し、図10(b)網掛け部で示したように、算出した重心GCの位置から最も近い未処理画素をセルCLに組み入れる。この場合、(n+1,m)(n,m+1)の2つが重心に最も近い画素として存在するが、本実施形態では走査方向の順序に従って(n+1,m)をセルに組み入れ、セルCLを拡大する。   Next, since the sum of the level values of the pixels in the cell CL is 50 and less than 255, the centroid position of the cell CL is calculated, and as shown in FIG. 10B, the calculated centroid GC The unprocessed pixel closest to the position is incorporated into the cell CL. In this case, two of (n + 1, m) (n, m + 1) exist as the pixels closest to the center of gravity, but in this embodiment, (n + 1, m) is incorporated in the cell according to the order in the scanning direction, and the cell CL is enlarged. .

次に、拡大したセルCL内(図10(c)の太枠内の部分)の画素のレベル値の合計は100となり、255未満であるので、セル内の画素位置と画素のレベル値からセルCLの重心GCの位置を算出する(図10(c))。そして、図10(c)網掛け部で示したように、算出した重心GCの位置から最も近い画素(n,m+1)(n+1,m+1)のうち、同じく走査方向の順序に従って(n,m+1)をセルに組み入れ、セルCLを拡大する。   Next, since the sum of the level values of the pixels in the enlarged cell CL (the portion in the thick frame in FIG. 10C) is 100 and less than 255, the cell position is determined from the pixel position in the cell and the pixel level value. The position of the center of gravity GC of CL is calculated (FIG. 10 (c)). 10C, among the pixels (n, m + 1) (n + 1, m + 1) closest to the calculated position of the center of gravity GC, (n, m + 1) according to the same order in the scanning direction. Is incorporated into the cell, and the cell CL is enlarged.

次に、拡大したセルCL内(図10(d)の太枠内の部分)の画素のレベル値の合計は150となり、255未満であるので、セルCL内の画素位置と画素のレベル値からセルCLの重心GCの位置を算出する。そして、図10(d)網掛け部で示したように、算出した重心GCの位置から最も近い画素(n+1,m+1)をセルに組み入れ、セルCLを拡大する。   Next, the sum of the level values of the pixels in the enlarged cell CL (the portion within the thick frame in FIG. 10D) is 150, which is less than 255, and therefore, from the pixel position in the cell CL and the level value of the pixel. The position of the center of gravity GC of the cell CL is calculated. Then, as shown by the shaded portion in FIG. 10D, the pixel (n + 1, m + 1) closest to the calculated position of the center of gravity GC is incorporated into the cell, and the cell CL is enlarged.

次に、拡大したセルCL内(図10(e)の太枠内の部分)の画素のレベル値の合計は205となり、255未満であるので、セルCL内の画素位置と画素のレベル値からセルCLの重心GCの位置を算出する。そして、図10(e)網掛け部で示したように、算出した重心GCの位置から最も近い画素(n+1,m+2)をセルに組み入れ、セルCLを拡大する。   Next, the sum of the level values of the pixels in the enlarged cell CL (the portion within the thick frame in FIG. 10E) is 205, which is less than 255, and therefore, from the pixel position in the cell CL and the level value of the pixel. The position of the center of gravity GC of the cell CL is calculated. Then, as shown in FIG. 10E, the pixel (n + 1, m + 2) closest to the calculated position of the center of gravity GC is incorporated into the cell, and the cell CL is enlarged.

次に、拡大したセルCL内(図10(f)の太枠内の部分)の画素のレベル値の合計は255となり、セルの拡大終了条件を満たすので、セルCLの拡大処理を終了する。   Next, the sum of the level values of the pixels in the enlarged cell CL (the portion within the thick frame in FIG. 10 (f)) is 255, and the cell enlargement end condition is satisfied.

次にステップS406(図9)で、セル内の画素のレベル値合計が閾値と等しいか否かを判定する処理を行う。判定の結果閾値と等しい場合は(YES)、前述の処理と同様、セル内の画素位置と画素のレベル値からセルの重心GCの位置を算出する処理を行う(ステップS407)。そして、算出した重心位置に存在する画素に、閾値と同じレベル値を与える処理を行い(ステップS408)、ステップS402に戻って未処理画素の探索処理以降を繰り返すのである。   Next, in step S406 (FIG. 9), processing for determining whether or not the total level value of the pixels in the cell is equal to the threshold value is performed. If it is equal to the threshold value as a result of the determination (YES), a process of calculating the position of the center of gravity GC of the cell from the pixel position in the cell and the level value of the pixel is performed (step S407). Then, a process of giving the same level value as the threshold value to the pixel existing at the calculated center of gravity position is performed (step S408), and the process returns to step S402 to repeat the search process for unprocessed pixels.

図10(f)に示したように、ステップS408では、ステップS407によって算出した重心GCの位置に存在する画素(n+1,m+1)に、レベル値「255」を与えるのである。この後の処理(後述するステップS50(図4))によって、このレベル値「255」が与えられた画素の位置に所定の色と大きさのドットを形成して画像を印刷するのである。   As shown in FIG. 10F, in step S408, the level value “255” is given to the pixel (n + 1, m + 1) existing at the position of the center of gravity GC calculated in step S407. By subsequent processing (step S50 (FIG. 4 described later)), a dot having a predetermined color and size is formed at the pixel position to which this level value “255” is given, and an image is printed.

一方、ステップS406で判定の結果、閾値と等しくない場合つまり閾値を超える場合は(NO)、余った誤差データを無視してセルの重心を算出する処理を行う(ステップS409)。そして、この誤差データを最後にセルに組み入れた画素に戻し(ステップS410)、誤差データを戻した画素を未処理画素とする処理を行う(ステップS411)。そして、ステップS408に進み、算出した重心位置に存在する画素に、閾値と同じレベル値を与える処理を行う。   On the other hand, if the result of determination in step S406 is not equal to the threshold value, that is, if the threshold value is exceeded (NO), processing for calculating the center of gravity of the cell is performed ignoring the remaining error data (step S409). Then, this error data is returned to the pixel that was last incorporated in the cell (step S410), and a process for setting the pixel for which the error data has been returned as an unprocessed pixel is performed (step S411). Then, the process proceeds to step S408, and a process of giving the same level value as the threshold value to the pixel existing at the calculated barycentric position is performed.

ステップS409からS411までの処理について、図11を用いて具体的に説明する。図11(a)は、図10(f)にて説明したセルCL1の生成処理に続き、ステップS402にて、所定の走査方法による走査方向に従って画素(n+2,m)が未処理画素として探索された状態を示している。そして図10にて説明した処理と同様に処理を行い、図11(b)では画素(n+2,m+1)を、図11(c)では画素(n+3,m+1)を、図11(d)では画素(n+3,m+2)をセルCL2に組み入れてセルを拡大する。   The processing from step S409 to S411 will be specifically described with reference to FIG. In FIG. 11A, following the generation processing of the cell CL1 described in FIG. 10F, in step S402, the pixel (n + 2, m) is searched as an unprocessed pixel according to the scanning direction by a predetermined scanning method. Shows the state. Then, processing is performed in the same manner as described with reference to FIG. 10, the pixel (n + 2, m + 1) in FIG. 11B, the pixel (n + 3, m + 1) in FIG. 11C, and the pixel in FIG. The cell is expanded by incorporating (n + 3, m + 2) into the cell CL2.

図11(e)に示したように、画素(n+3,m+2)がセルCL2に組み入れた時点で、セルCL2内の画素のレベル値合計は265となり、閾値255を超える。そこで、超えた分の誤差データ10(=265−255)を無視し、画素(n+3,m+2)がレベル値50(=60−10)であるとしてセルCL2の重心GC2を算出する。   As shown in FIG. 11E, when the pixel (n + 3, m + 2) is incorporated into the cell CL2, the total level value of the pixels in the cell CL2 is 265, which exceeds the threshold 255. Therefore, the excess error data 10 (= 265-255) is ignored, and the center of gravity GC2 of the cell CL2 is calculated assuming that the pixel (n + 3, m + 2) has the level value 50 (= 60-10).

そして、図11(f)に示したように、算出した重心GC2の位置に存在する画素(n+3,m+1)にレベル値「255」を付与する。このとき、最後にセルCL2に組み入れた画素(n+3,m+2)に誤差データ「10」を戻す。そして、画素(n+3,m+2)をレベル値10を有する未処理画素とし、セルCL2から除外する。   Then, as shown in FIG. 11F, the level value “255” is assigned to the pixel (n + 3, m + 1) existing at the calculated position of the center of gravity GC2. At this time, the error data “10” is returned to the pixel (n + 3, m + 2) last incorporated in the cell CL2. Then, the pixel (n + 3, m + 2) is set as an unprocessed pixel having a level value of 10, and is excluded from the cell CL2.

図9および図10、図11を用いて説明したCC法による階調変換処理を、階調データCc、Mc、Yc全てについて実施してステップS40を終了し、生成した「0」と「255」のレベル値を有する量子化データを出力する。次のステップS50(図4)にて印刷するための画像データとして出力する処理を行う。   The gradation conversion process based on the CC method described with reference to FIGS. 9, 10, and 11 is performed for all gradation data Cc, Mc, and Yc, and step S <b> 40 is terminated, and the generated “0” and “255” are generated. Quantized data having a level value of is output. In the next step S50 (FIG. 4), a process of outputting as image data for printing is performed.

ステップS50では、レベル値「255」の量子化データが付与された画素の位置にドットを形成するため、所定の駆動パルス幅を持ったレーザ駆動パルスを駆動データとして生成する。そして、この駆動データを印刷エンジン40に出力することによって所定の色と大きさのドットを印刷用紙などに形成して印刷物として出力するのである。   In step S50, a laser drive pulse having a predetermined drive pulse width is generated as drive data in order to form a dot at the pixel position to which the quantized data of the level value “255” is assigned. Then, by outputting this drive data to the print engine 40, dots of a predetermined color and size are formed on a printing paper or the like and output as a printed matter.

以上、本実施形態における画像処理内容を説明したが、CC法によるポスト階調変換処理によれば、常にセルの重心に最も近い画素を組み入れてセルを生成するため、閾値を付与する画素位置に対してほぼ円状となるセルを生成する。従って、閾値が付与された画素位置にドットを形成した場合、隣り合うドットが近かったり、あるいは重なったりする確率が減少することでき、このようなドットの重なりによる特異パターンの発生を抑えることができる。   The image processing content in the present embodiment has been described above. However, according to the post-gradation conversion processing by the CC method, a cell is always generated by incorporating the pixel closest to the center of gravity of the cell. On the other hand, a cell having a substantially circular shape is generated. Therefore, when a dot is formed at a pixel position to which a threshold value is assigned, the probability that adjacent dots are close or overlapped can be reduced, and the occurrence of a unique pattern due to such overlapping of dots can be suppressed. .

また、前述したように特許文献1や2における階調変換処理では、誤差データを隣接する画素やセルに移していくため、入力画像データを歪ませ、結果的に入力画像には存在しない特異パターンを発生しやすくしてしまっていたが、CC法によるポスト階調変換によれば、誤差データを元の画素に戻すため、入力画像データの歪みが小さくなり、入力画像の階調データに対して比較的忠実に階調変換処理を行うことができる。   Further, as described above, in the gradation conversion processing in Patent Documents 1 and 2, error data is transferred to adjacent pixels and cells, so that the input image data is distorted, resulting in a unique pattern that does not exist in the input image. However, according to the post-gradation conversion by the CC method, the error data is returned to the original pixel, so that the distortion of the input image data is reduced, and the gradation data of the input image is reduced. The gradation conversion process can be performed relatively faithfully.

さらに、本実施形態のように、誤差拡散法によるプレ階調変換処理と、CC法によるポスト階調変換処理とを組み合わせて実施することによって、規則的な特異パターンの発生を抑制することができる。この理由を次に説明する。   Furthermore, as in this embodiment, the occurrence of a regular singular pattern can be suppressed by combining the pre-gradation conversion process using the error diffusion method and the post-gradation conversion process using the CC method. . The reason for this will be described next.

図12は、一例として、ポスト階調変換処理前のCc成分の階調データを示したもので、(a)から(c)はプレ階調変換処理を行わない場合の入力画像の階調データを例示し、(d)から(f)はプレ階調変換処理を行った場合の入力画像の階調データを例示している。なお、階調データのうち説明の簡略化のため説明に必要でない画素のレベル値は一部省略し空白としている。   FIG. 12 shows, as an example, the gradation data of the Cc component before the post gradation conversion process. FIGS. 12A to 12C are the gradation data of the input image when the pre gradation conversion process is not performed. (D) to (f) illustrate the gradation data of the input image when the pre-gradation conversion process is performed. Note that some of the level values of the pixels that are not necessary for the description in the gradation data are omitted and left blank for the sake of simplicity.

プレ階調変換処理が行われない場合、通常、色補正及び色変換処理においては、入力画像データに対して、単に色補正や色変換処理を行うのみであり、入力画像データのレベル値にバラツキを与える処理ではないため、入力画像が均一な濃度の階調データであったときは、ポスト階調変換処理前の階調データもほぼ均一の濃度のレベル値が入力される。そこで、一例として、色成分C(シアン)の階調データCcが、入力画像の階調データを単に色変換した均一のレベル値85の階調データであるものとする。そして、図12(a)に示したように、ポスト階調変換前の階調データとして入力され、セルCL3が生成されているものとする。   When the pre-gradation conversion process is not performed, the color correction and the color conversion process usually only perform the color correction and the color conversion process on the input image data, and the level value of the input image data varies. Therefore, when the input image is gradation data having a uniform density, the gradation data before the post gradation conversion process is inputted with a level value having a substantially uniform density. Therefore, as an example, it is assumed that the gradation data Cc of the color component C (cyan) is gradation data having a uniform level value 85 obtained by simply color-converting the gradation data of the input image. Then, as shown in FIG. 12A, it is assumed that the cell CL3 is generated by being input as gradation data before post gradation conversion.

次にセルCL3に組み入れる画素を選択する処理が行われる。プレ階調変換を行わない場合は、図12(b)に示したように、重心GC3は画素(n,m)、(n+1,m)のレベル値が等しいため、これら2つの画素の中間に位置することになる。このとき、セルに組み入れる対象となる画素は(n,m+1)と(n+1,m+1)の2つの画素が存在する。そして、12図(c)に示したように、走査方向に従って(n,m+1)を選択し、セルに組み入れる。   Next, a process of selecting a pixel to be incorporated into the cell CL3 is performed. When the pre-gradation conversion is not performed, as shown in FIG. 12B, the center of gravity GC3 has the same level value of the pixels (n, m) and (n + 1, m). Will be located. At this time, there are two pixels (n, m + 1) and (n + 1, m + 1) as pixels to be incorporated into the cell. Then, as shown in FIG. 12 (c), (n, m + 1) is selected according to the scanning direction and incorporated into the cell.

このように、均一のレベル値の階調データを階調変換すると、セルに組み入れる対象となる画素が複数存在することが多くなり、そのとき選択される画素は所定の走査順に従って選択されるなど、セルに対して毎回ほぼ同じ位置関係の画素が選択される確率が高くなる。この結果、同じ形状のセルが連続して生成されることが発生し、上述した規則的な特異パターンが発生しやすくなる。   As described above, when gradation data having uniform level values is subjected to gradation conversion, there are often a plurality of pixels to be incorporated into a cell, and the pixels selected at that time are selected according to a predetermined scanning order. The probability that pixels having substantially the same positional relationship with respect to the cell are selected each time is increased. As a result, cells having the same shape are generated continuously, and the above-described regular unique pattern is likely to occur.

一方、プレ階調変換処理を行った場合、バラツキが与えられたまま色補正及び色変換処理がおこなわれるため、入力画像が均一な濃度であっても、ポスト階調変換処理前の階調データにはバラツキが与えられたレベル値が入力される。例えば、図12(a)の階調データを、図8にて説明したように実際に誤差拡散法によってプレ階調変換すると、ポスト階調変換前の階調データは図12(d)に示した状態になる。このとき、セルCL3が生成されているものとする。   On the other hand, when pre-gradation conversion processing is performed, color correction and color conversion processing are performed with variations provided, so even if the input image has a uniform density, gradation data before post-gradation conversion processing is used. Is inputted with a level value given a variation. For example, when the gradation data of FIG. 12A is actually pre-gradation converted by the error diffusion method as described in FIG. 8, the gradation data before the post gradation conversion is shown in FIG. It becomes a state. At this time, it is assumed that the cell CL3 is generated.

次にセルCL3に組み入れる画素を選択する処理に際して、図12(e)に示したように、プレ階調変換処理によって画素(n,m)、(n+1,m)のレベル値に差が生じているため、重心GC3は画素の中間にならず、画素(n+1,m)内に位置することになる。このとき、セルに組み入れる対象となる画素は(n+1,m+1)のみとなる。この結果、図12(f)に示したように、図12(c)とは異なる形状のセルが生成される。   Next, in the process of selecting a pixel to be incorporated into the cell CL3, as shown in FIG. 12E, a difference occurs in the level values of the pixels (n, m) and (n + 1, m) by the pre-gradation conversion process. Therefore, the center of gravity GC3 is not in the middle of the pixel, but is located in the pixel (n + 1, m). At this time, only (n + 1, m + 1) pixels are to be incorporated into the cell. As a result, as shown in FIG. 12F, a cell having a shape different from that in FIG. 12C is generated.

図12での説明から明らかなように、バラツキが与えられたレベル値の階調データを階調変換すると、重心の位置は、バラツキが与えられたことによって画素の中間に位置する確率が減り、レベル値が大きくなった画素内に位置する確率が高くなる。このため、セルに組み入れる対象となる画素は、レベル値のバラツキに合わせて、適当にバラツクことになる。この結果、同じ形状のセルが連続して生成される確率が減り、上述した規則的な特異パターンの発生を抑えることが容易となるのである。   As is clear from the explanation in FIG. 12, when the gradation data of the level value to which the variation is given is subjected to the gradation conversion, the probability that the position of the center of gravity is located in the middle of the pixel due to the variation is reduced, The probability of being located in a pixel having a large level value increases. For this reason, the pixels to be incorporated into the cell will vary appropriately according to the variation in level value. As a result, the probability that cells having the same shape are continuously generated is reduced, and it becomes easy to suppress the occurrence of the regular singular pattern described above.

また、前述したように、プレ階調変換ではレベル値にバラツキを与えるとき、レベル値の誤差データを隣接する画素に分散している。そのため、ポスト階調変換においても、特許文献1または2のように誤差データを隣接する画素またはセルに移す処理をおこなうと、入力画像の階調データに対する誤差データが更に大きくなり、その結果、階調変換処理による量子化ノイズを増幅させ特異パターン等の発生を容易にしてしまうことがあった。本実施形態のように、ポスト階調変換処理をCC法によって行うことによって、プレ階調調変換処理によって生じた誤差データを更に分散させることなく、バラツキが与えられた入力画像の階調データを階調変換できるため、規則的なパターンなどの発生を抑えつつ入力画像の階調データに忠実で快適な出力画像を得ることができる。   Further, as described above, in the pre-gradation conversion, when the level value varies, error data of the level value is distributed to adjacent pixels. Therefore, even in post-gradation conversion, if error data is transferred to adjacent pixels or cells as in Patent Document 1 or 2, the error data for the gradation data of the input image is further increased. In some cases, the quantization noise due to the tone conversion process is amplified to easily generate a singular pattern or the like. As in the present embodiment, by performing the post-gradation conversion process by the CC method, the gradation data of the input image to which the variation is given is scaled without further dispersing the error data generated by the pre-gradation conversion process. Since tone conversion is possible, it is possible to obtain a comfortable output image that is faithful to the gradation data of the input image while suppressing the occurrence of regular patterns.

次に、本実施形態を適用した画像出力装置20のハード構成において、ポスト階調変換における各ハードの具体的な処理内容を図9のフローチャートと図2の構成図を参照して説明する。なお誤差拡散法及び色補正、色変換処理に関しては、特許文献1などにより周知の処理技術として既知であるため、これらの処理内容については説明を省略する。   Next, in the hardware configuration of the image output apparatus 20 to which this embodiment is applied, the specific processing contents of each hardware in the post-gradation conversion will be described with reference to the flowchart of FIG. 9 and the configuration diagram of FIG. Note that the error diffusion method, color correction, and color conversion processing are known as well-known processing techniques according to Patent Document 1 and the like, and thus description of these processing contents is omitted.

まず、CPU22は、ハードディスク25またはROM26に格納されたプログラムを読み出して、入力画像の読み込み処理を開始する(ステップS401)。入力画像の読み込みは、ホストコンピュータ50から入力画像データを入力I/F21を介してRAM27に取り込むことで行う。このとき、Cc、Mc、Yc各色成分の入力画像データは、RAM27の所定領域である入力バッファ領域に格納される。この例を図13(a)に示す。   First, the CPU 22 reads a program stored in the hard disk 25 or the ROM 26, and starts an input image reading process (step S401). The input image is read by fetching the input image data from the host computer 50 into the RAM 27 via the input I / F 21. At this time, input image data of each color component of Cc, Mc, and Yc is stored in an input buffer area that is a predetermined area of the RAM 27. An example of this is shown in FIG.

RAM27は、図13(a)に示すように、入力バッファ領域271と、ワーキングメモリ領域272と、出力バッファ領域273とから構成される。この入力バッファ領域271は、2次元構造を有しており、例えば上述の入力画像の画素(以降、入力画素)について、(n,m)に位置する入力画素は、入力バッファ領域の(n,m)のアドレスに格納される。入力画素の位置に対応するように入力バッファ領域271が構成される。実際には、このアドレスには入力画像データのレベル値が格納されることになる。例えば、図10(a)に示すCc成分の入力画像の階調データが入力されると、図13(a)に示すように入力バッファ271に各画素のレベル値が格納される。ワーキングメモリ領域272は、重心位置の演算結果とレベル値の演算結果が格納され、出力バッファ領域273は入力バッファ271と同様に各入力画素に対応するように構成される。詳細は後述する。   As shown in FIG. 13A, the RAM 27 includes an input buffer area 271, a working memory area 272, and an output buffer area 273. The input buffer area 271 has a two-dimensional structure. For example, for the pixel of the input image (hereinafter, input pixel), the input pixel located at (n, m) is (n, m) of the input buffer area. m). An input buffer area 271 is configured to correspond to the position of the input pixel. Actually, the level value of the input image data is stored at this address. For example, when the gradation data of the Cc component input image shown in FIG. 10A is input, the level value of each pixel is stored in the input buffer 271 as shown in FIG. The working memory area 272 stores the calculation result of the center of gravity position and the calculation result of the level value, and the output buffer area 273 is configured to correspond to each input pixel similarly to the input buffer 271. Details will be described later.

次いで、CPU22は、セル生成の最初の未処理画素となる初期画素を探索決定して(ステップS402)、決定した初期画素のレベル値が閾値より小さいか否かを判断する(ステップS404)。具体的には、ROM26に格納した閾値を読出し、RAM27の入力バッファ271から読み出した初期画素の階調値と比較し、閾値よりも小さい場合はステップS405に移行し、閾値と同じか大きいときはステップS406に移行する。   Next, the CPU 22 searches for and determines an initial pixel that is the first unprocessed pixel for cell generation (step S402), and determines whether or not the level value of the determined initial pixel is smaller than a threshold value (step S404). Specifically, the threshold value stored in the ROM 26 is read and compared with the gradation value of the initial pixel read from the input buffer 271 of the RAM 27. If the threshold value is smaller than the threshold value, the process proceeds to step S405. The process proceeds to step S406.

初期画素の決定は、RAM27の入力バッファ271に格納された入力画像データのうち、入力画素の位置で最も上の左側に位置する画素をCPU22が選択する。すなわち、図13(a)に示す例では、(n,m)に対応する位置に位置する画素を初期画素としてCPU22は判断する。以下、説明を簡単にするため、(n,m)=(0,0)として説明する。   The initial pixel is determined by the CPU 22 selecting the pixel located on the upper left side in the input pixel position from the input image data stored in the input buffer 271 of the RAM 27. That is, in the example shown in FIG. 13A, the CPU 22 determines that the pixel located at the position corresponding to (n, m) is the initial pixel. Hereinafter, in order to simplify the description, (n, m) = (0, 0) will be described.

ステップS404で閾値より小さいと判断された場合(YES)、CPU22は、未処理画素の選択を行いセルを拡大する処理を行う(ステップS405)。ここで未処理画素の選択は、セルの重心を利用して行う。重心を利用して画素の選択を行うことによって、最終的に生成されるセルの形状は、円状となり、その重心にドットを形成させることで、ドット間距離が均一となり、視覚的に快適な印刷出力を得ることができるのである。   If it is determined in step S404 that the value is smaller than the threshold value (YES), the CPU 22 selects an unprocessed pixel and performs a process of enlarging the cell (step S405). Here, selection of unprocessed pixels is performed using the center of gravity of the cell. By selecting pixels using the center of gravity, the final cell shape is circular, and by forming dots at the center of gravity, the inter-dot distance is uniform and visually comfortable. A printed output can be obtained.

CPU22は初期画素の位置する画素のレベル値と、そのアドレス位置とを読み出し、重心を演算する。CPU22は、具体的に以下の演算式を用いて演算し重心を求める。   The CPU 22 reads the level value of the pixel where the initial pixel is located and its address position, and calculates the center of gravity. Specifically, the CPU 22 calculates the center of gravity by using the following arithmetic expression.

(式1)
重心={{(セルの重心のx座標)×(セル内の画素のレベル値合計)}+{(選択した未処理画素のx座標)×(選択した未処理画素のレベル値)}}/{(セル内の画素のレベル値合計)+(選択した未処理画素のレベル値)}
重心={{(セルの重心のy座標)×(セル内の画素のレベル値合計)}+{(選択した未処理画素のy座標)×(選択した未処理画素のレベル値)}}/{(セル内の画素のレベル値合計)+(選択した未処理画素のレベル値)}
(x重心、y重心は重心位置の座標)
この演算式はROM26に格納され、ステップS405にてCPU22が読み出して演算を行うことになる。もとより、初期画素の場合は、セルの重心のx、y座標は0として演算される。なお、CPU22は、演算した重心位置と、初期画素のレベル値50とを、上述したワーキングメモリ領域272に格納する(図13(b)参照)。その後の演算処理をスムーズに行うためである。
(Formula 1)
x centroid = {{(x coordinate of centroid of cell) × (total level value of pixels in cell)} + {(x coordinate of selected unprocessed pixel) × (level value of selected unprocessed pixel)}} / {(Total level value of pixels in cell) + (level value of selected unprocessed pixel)}
y centroid = {{(y coordinate of cell centroid) × (total level value of pixels in cell)} + {(y coordinate of selected unprocessed pixel) × (level value of selected unprocessed pixel)}} / {(Total level value of pixels in cell) + (level value of selected unprocessed pixel)}
(X center of gravity , y center of gravity are coordinates of the center of gravity)
This arithmetic expression is stored in the ROM 26, and the CPU 22 reads and performs the arithmetic operation in step S405. Of course, in the case of the initial pixel, the x and y coordinates of the center of gravity of the cell are calculated as 0. The CPU 22 stores the calculated barycentric position and the level value 50 of the initial pixel in the above-described working memory area 272 (see FIG. 13B). This is because the subsequent arithmetic processing is performed smoothly.

また、CPU22は、ステップS404で初期画素のレベル値が閾値より小さいと判断された場合は、初期画素に対応する出力バッファ273に“0”を格納し、ステップS404で初期画素のレベル値が閾値以上と判断された場合は、その時点で初期画素に対応する出力バッファ273に“255”を格納する。この画素にドットを打つ処理を行うためである。ここでは、図13(b)に示すように、選択した画素に対応するRAM27の出力バッファ273に“0”がCPU22によって格納されることになる。   If it is determined in step S404 that the level value of the initial pixel is smaller than the threshold value, the CPU 22 stores “0” in the output buffer 273 corresponding to the initial pixel, and the level value of the initial pixel is set to the threshold value in step S404. If it is determined as described above, “255” is stored in the output buffer 273 corresponding to the initial pixel at that time. This is because a process of placing dots on this pixel is performed. Here, as shown in FIG. 13B, “0” is stored by the CPU 22 in the output buffer 273 of the RAM 27 corresponding to the selected pixel.

未処理画素の選択処理は、ステップS405で演算した重心から最も近い距離にある画素を選択することによって行う。このとき、RAM27の入力バッファの所定位置に格納されている入力画像データから、アドレス(1,0)にある画像データか、アドレス(0,1)にある画像データが選択される。2つの画素ともアドレス(0,0)から等距離にあるからである。ここで、いずれかの画素を選択する必要があるが、本実施形態では走査方向に従ってCPU22が0行1列のアドレス(1,0)にある画素データを選択する。こうしてセルを拡大する処理が行われるのである。   The unprocessed pixel selection process is performed by selecting a pixel that is closest to the center of gravity calculated in step S405. At this time, the image data at the address (1, 0) or the image data at the address (0, 1) is selected from the input image data stored at a predetermined position in the input buffer of the RAM 27. This is because the two pixels are equidistant from the address (0, 0). Here, one of the pixels needs to be selected, but in this embodiment, the CPU 22 selects the pixel data at the address (1, 0) in the 0th row and the first column in accordance with the scanning direction. Thus, the process of enlarging the cell is performed.

次いで、CPU22は、再びセル内の画素のレベル値合計が閾値未満であるか否か判断する(ステップS404)。すなわち、選択した未処理画素のレベル値を含めたセル内の画素のレベル値合計が閾値“255”未満であるか否かを判断する。具体的には、CPU22は、RAM27のワーキングメモリ272に書き込んだ画素のレベル値と、ステップS405で選択した画素の入力バッファ271に格納されたレベル値とを読出し、その合計を演算して、ROM26に格納された閾値(ここでは“255”の値)とを比較する。例えば図13(c)の例では、アドレス(1,0)格納されているレベル値は“50”であるので、レベル値合計は“100”となる。よって合計値は閾値に達しないことになる。   Next, the CPU 22 determines again whether or not the total level value of the pixels in the cell is less than the threshold value (step S404). That is, it is determined whether or not the total level value of the pixels in the cell including the level value of the selected unprocessed pixel is less than the threshold value “255”. Specifically, the CPU 22 reads the level value of the pixel written in the working memory 272 of the RAM 27 and the level value stored in the input buffer 271 of the pixel selected in step S405, calculates the sum, and calculates the ROM 26 Is compared with the threshold value stored here (the value of “255” in this case). For example, in the example of FIG. 13C, since the level value stored at the address (1, 0) is “50”, the total level value is “100”. Therefore, the total value does not reach the threshold value.

レベル値の合計が閾値を超えない場合(ステップS404:YES)、CPU22は、再び選択した未処理画素を含めた重心の演算を行う(ステップS405)。具体的なCPU22の演算は、上述した(式1)の演算式を用いて行うことになる。これまで求めた重心のx、y座標は、(0,0)で重心のレベル値は“50”、未処理画素のx、y座標は(1,0)で、その階調値は“50”とすると、演算される重心位置は(0.5,0)となる。このステップS405で演算した重心位置は、CPU22の制御によってRAM27のワーキングメモリ272にセルのレベル値合計とともに格納される。ステップS405での前回の処理で、ワーキングメモリ272には初期画素の重心位置および初期画素のレベル値が格納されていたが、ここではその位置に上書きして格納する。その格納後の例を図13(c)に示す。   When the sum of the level values does not exceed the threshold value (step S404: YES), the CPU 22 calculates the center of gravity including the unprocessed pixel selected again (step S405). The specific calculation of the CPU 22 is performed using the above-described calculation formula (Formula 1). The x and y coordinates of the center of gravity obtained so far are (0, 0), the level value of the center of gravity is “50”, the x and y coordinates of the unprocessed pixels are (1, 0), and the gradation value is “50”. ", The calculated center-of-gravity position is (0.5, 0). The barycentric position calculated in step S405 is stored in the working memory 272 of the RAM 27 together with the sum of the cell level values under the control of the CPU 22. In the previous processing in step S405, the centroid position of the initial pixel and the level value of the initial pixel were stored in the working memory 272, but here the position is overwritten and stored. An example after the storage is shown in FIG.

ここで、重心位置は上述の(式1)で示されているように必ずしも整数値になるとは限らない。重心に最も近い画素を選択する場合のほかに、重心が位置する画素に最も近い画素を選択する場合でもよい。このようにすることで、重心位置は整数値として演算でき、CPU22が処理する計算量の削減が期待できる。   Here, the position of the center of gravity is not necessarily an integer value as shown in the above (Equation 1). In addition to selecting the pixel closest to the center of gravity, the pixel closest to the pixel where the center of gravity is located may be selected. By doing so, the position of the center of gravity can be calculated as an integer value, and a reduction in the amount of calculation processed by the CPU 22 can be expected.

ここで、CPU22は、選択した初期画素に対応する入力バッファ271に“−1”を格納する。再度未処理画素の選択で、当該画素を選択されないようにするためである。以降、未処理画素の選択処理に際して、選択処理と同時もしくは選択処理以前に、既に選択された画素に対応する入力バッファ271に“−1”を格納する処理を行う。このような処理を行うのは、入力バッファ271に格納されたレベル値はその合計値としてワーキングメモリ272に格納され、以後の処理で必要とされないからである。   Here, the CPU 22 stores “−1” in the input buffer 271 corresponding to the selected initial pixel. This is because the pixel is not selected again by selecting the unprocessed pixel. Thereafter, in the unprocessed pixel selection process, a process of storing “−1” in the input buffer 271 corresponding to the already selected pixel is performed simultaneously with the selection process or before the selection process. The reason why such processing is performed is that the level value stored in the input buffer 271 is stored in the working memory 272 as the total value and is not required in the subsequent processing.

なお、CPU22は、入力バッファ271に“−1”を格納させているが、これに限ることはなく、他の負の値でもよい。さらに入力バッファ271と同様の構成のメモリ領域を用意して、選択した画素に対応する位置にフラグを立てて、選択画素が処理済みか否かを判別するようにしてもよい。   The CPU 22 stores “−1” in the input buffer 271. However, the present invention is not limited to this, and other negative values may be used. Further, a memory area having the same configuration as that of the input buffer 271 may be prepared, and a flag may be set at a position corresponding to the selected pixel to determine whether or not the selected pixel has been processed.

このように、ステップS404とS405の処理を繰り返すたびに、CPU22は、ステップS404で演算したセル内の画素のレベル値合計が、閾値と等しいか否か判断しながら閾値に達するまでセルを構成していくことができる。また、閾値に達していない場合、上述したようにCPU22は、セルに組み入れた入力画素の位置に対応した出力バッファ273の位置に“0”を格納する。   In this way, each time the processing of steps S404 and S405 is repeated, the CPU 22 configures the cell until the threshold value is reached while determining whether or not the total level value of the pixels in the cell calculated in step S404 is equal to the threshold value. Can continue. If the threshold value has not been reached, as described above, the CPU 22 stores “0” in the position of the output buffer 273 corresponding to the position of the input pixel incorporated in the cell.

図14(a)は、未処理画素(1,1)がセルに組み入れたときの状態を示したもので、セル内の画素のレベル値合計と、ROM26に格納された閾値とをCPU22が読み出して、両者を比較し、まだ閾値に達していないので、画素(1,1)をセルに組み込み、ワーキングメモリ272には重心位置とセルのレベル値合計が、また選択した未処理画素(1,1)に対応する出力バッファ273に“0”がそれぞれ格納されている。   FIG. 14A shows a state when the unprocessed pixel (1, 1) is incorporated in the cell, and the CPU 22 reads out the total level value of the pixel in the cell and the threshold value stored in the ROM 26. Then, since the threshold value has not been reached yet, the pixel (1, 1) is incorporated into the cell, and the working memory 272 stores the centroid position and the total level value of the cell as well as the selected unprocessed pixel (1, “0” is stored in the output buffer 273 corresponding to 1).

図14(b)は、図14(a)に引き続き行われる処理を示したもので、入力画素(1,2)が重心位置に最も近い画素として選択された状態を示している。このとき、セルのレベル値合計が“255”になった状態を示している。すなわち、これまでセルに組み込まれた画素のレベル値合計“205”が、RAM27のワーキングメモリ272に格納されるので、その値と画素(1,2)の値との合計値を、閾値と比較することで、CPU22は閾値と等しいと判断する。この場合、CPU22は、セルに組み入れた入力画素(1,2)の位置に対応した出力バッファ273の位置に“0”を格納する。   FIG. 14B shows a process performed subsequently to FIG. 14A, and shows a state where the input pixel (1, 2) is selected as the pixel closest to the center of gravity position. At this time, the state is shown in which the total level value of the cell is “255”. That is, since the total level value “205” of the pixels incorporated so far in the cell is stored in the working memory 272 of the RAM 27, the total value of the value and the value of the pixel (1, 2) is compared with the threshold value. Thus, the CPU 22 determines that it is equal to the threshold value. In this case, the CPU 22 stores “0” in the position of the output buffer 273 corresponding to the position of the input pixel (1, 2) incorporated in the cell.

そして、閾値と等しいとCPU22が判断した場合(ステップS406:YES)、処理はステップS407に移行し(式1)を用いて重心位置を演算し、演算した重心位置とセルのレベル値合計をワーキングメモリ272に格納する。そして、重心に位置する画素に所定の大きさのドットを形成するための処理を行う。具体的には、図14(b)に示したように、RAM27の出力バッファ273の入力画素の位置に対応するアドレス位置に“255”を書き込む。出力バッファの構造も入力バッファと同様に2次元構造で、入力画素の位置に対応するアドレス空間を有している。重心が位置するアドレスに“255”を書き込むことで、その後、実際にその位置に対応する位置にドットを打つことができる。   If the CPU 22 determines that the threshold value is equal to the threshold value (step S406: YES), the process proceeds to step S407, the center of gravity position is calculated using (Equation 1), and the calculated center of gravity position and the sum of the cell level values are calculated. Store in the memory 272. Then, a process for forming a dot of a predetermined size on a pixel located at the center of gravity is performed. Specifically, as shown in FIG. 14B, “255” is written at the address position corresponding to the position of the input pixel of the output buffer 273 of the RAM 27. The structure of the output buffer is also a two-dimensional structure like the input buffer, and has an address space corresponding to the position of the input pixel. By writing “255” at the address where the center of gravity is located, it is possible to subsequently hit a dot at a position corresponding to that position.

次いで、CPU22は、データ“255”の書き込み処理をトリガーにして新たにセルを生成する処理に移行し、再び未処理画素があるか否か判断する(ステップS402)。すなわち、上述した処理をRAM27の入力バッファ271に書き込まれたすべてのレベル値に対して行ったか否かで判断し、未処理画素があれば(YES)再び処理はステップS404に移行し、上述の処理を繰り返す。例えば、図14(c)に、引き続いて上述した走査方法に従って、未処理画素(2,0)が探索された状態を示した。すべての画素に対して処理が終了すれば(ステップS402:NO)、CPU22はステップS403に移行し、処理が終了することになる。   Next, the CPU 22 proceeds to a process of generating a new cell by using the writing process of the data “255” as a trigger, and determines again whether there is an unprocessed pixel (step S402). That is, it is determined whether or not the above-described processing has been performed for all level values written in the input buffer 271 of the RAM 27. If there is an unprocessed pixel (YES), the processing proceeds to step S404 again, and the above-described processing is performed. Repeat the process. For example, FIG. 14C shows a state in which the unprocessed pixel (2, 0) is searched for in accordance with the scanning method described above. If the processing is completed for all the pixels (step S402: NO), the CPU 22 proceeds to step S403 and the processing is terminated.

一方、ステップS406でセル内の画素のレベル値合計が閾値を超える場合(NO)、処理はステップS409に移行し、閾値超えた場合の重心演算処理を行う。   On the other hand, if the total level value of the pixels in the cell exceeds the threshold value in step S406 (NO), the process proceeds to step S409, and the center of gravity calculation process is performed when the threshold value is exceeded.

図15(a)は、図14にて説明した処理に引き続いて、CPU22の処理が行われた状態を示したもので、入力画素(3,1)がセルに組み入れられたときのRAM27を示している。次に、図15(b)に示したように、(3,2)に位置する画素が選択されると、セル内の画素のレベル値合計を演算するとすると“265”になり、閾値“255”を超えることになる。したがって、このような場合(ステップS406:NO)、ステップS409に移行することになる。   FIG. 15A shows a state in which the processing of the CPU 22 is performed following the processing described in FIG. 14, and shows the RAM 27 when the input pixel (3, 1) is incorporated in the cell. ing. Next, as shown in FIG. 15B, when the pixel located at (3, 2) is selected, the total level value of the pixels in the cell is calculated to be “265”, and the threshold value “255”. Will be exceeded. Therefore, in such a case (step S406: NO), the process proceeds to step S409.

ステップS409は、閾値を超えるレベル値分つまり誤差データを無視してセルの重心を算出する処理を行う。このためまず、CPU22は、閾値からセル内の画素のレベル値合計、すなわち閾値からこれまでステップS405で格納したワーキングメモリのレベル値を引く演算を行う。例えば図15に示す例では、閾値は“255”、ステップS405でこれまで格納したレベル値は図15(a)に示したように“205”であるので、CPU22がこれらを読み出して255−205=50の値を演算する。   In step S409, the center value of the cell is calculated by ignoring the level value exceeding the threshold, that is, the error data. Therefore, first, the CPU 22 performs an operation of subtracting the total level value of the pixels in the cell from the threshold value, that is, the level value of the working memory stored in step S405 so far from the threshold value. For example, in the example shown in FIG. 15, the threshold value is “255”, and the level value stored so far in step S405 is “205” as shown in FIG. 15A. = 50 values are calculated.

そして、CPU22が、この“50”の値を画素(3,2)の階調値として重心の演算を行うことによって誤差データが無視されることになる。重心の演算は具体的には、以下の演算式を用いる。   Then, the CPU 22 calculates the center of gravity using the value of “50” as the gradation value of the pixel (3, 2), so that the error data is ignored. Specifically, the following calculation formula is used for the calculation of the center of gravity.

(式2)
重心={{(セルの重心のx座標)×(セル内の画素のレベル値合計)}+{(選択した未処理画素のx座標)×(ステップS409の演算値)}}/{(セル内の画素のレベル値合計)+(ステップS409の演算値)}
重心={{(セルの重心のy座標)×(セル内の画素のレベル値合計)}+{(選択した未処理画素のy座標)×(ステップS409の演算値)}}/{(セル内の画素のレベル値合計)+(ステップS409の演算値)}
(x重心、y重心は重心位置の座標)
(式1)との違いは、選択した未処理画素のレベル値をそのまま用いるのではなく、セルの合計が閾値と同じになるようなレベル値を用いる点が異なる。
(Formula 2)
x centroid = {{(x coordinate of centroid of cell) × (total level value of pixels in cell)} + {(x coordinate of selected unprocessed pixel) × (calculated value of step S409)}} / {( Sum of level values of pixels in cell) + (calculated value of step S409)}
y- centroid = {{(y-coordinate of cell centroid) × (total level value of pixels in cell)} + {(y-coordinate of selected unprocessed pixel) × (calculated value in step S409)}} / {( Sum of level values of pixels in cell) + (calculated value of step S409)}
(X center of gravity , y center of gravity are coordinates of the center of gravity)
The difference from (Expression 1) is that the level value of the selected unprocessed pixel is not used as it is, but a level value that makes the total of the cells equal to the threshold value is used.

この演算式は、(式1)の場合と同様に予めROM26に格納されており、CPU22が本ステップを実行する際にROM26から読み出すことで実行される。ここでは、最終的にステップS405で選択した画素のレベル値は、これまで演算したレベル値の合計との和をとることで閾値と等しくなるように演算して、それをもとに重心位置を求めることになる。そしてCPU22は、演算した重心位置データを再びRAM27のワーキングメモリ272に書き込む(図15(b)のワーキングメモリ272参照)。   This arithmetic expression is stored in the ROM 26 in advance as in the case of (Expression 1), and is executed by the CPU 22 reading it from the ROM 26 when executing this step. Here, the level value of the pixel finally selected in step S405 is calculated to be equal to the threshold value by taking the sum of the level values calculated so far, and the center of gravity position is calculated based on this. Will be asked. Then, the CPU 22 writes the calculated gravity center position data again in the working memory 272 of the RAM 27 (see the working memory 272 in FIG. 15B).

また、CPU22は、最終的に選択した画素の元のレベル値からステップS409で演算した演算結果を引いた値(誤差データ)を演算して、その値を再びその選択した画素の入力バッファに書き込む(ステップS410)。これにより、当該画素のレベル値が、戻しデータとして格納される。図15(c)に示す例では、ステップS409で演算した“50”を最終的に選択した(3,2)の画素のレベル値“60”から引いて“10”の値を求め、これをRAM27の入力バッファ271のアドレス(3,2)に再び書き込む(図15(c)の入力バッファ271参照)。   Further, the CPU 22 calculates a value (error data) obtained by subtracting the calculation result calculated in step S409 from the original level value of the finally selected pixel, and writes the value in the input buffer of the selected pixel again. (Step S410). Thereby, the level value of the pixel is stored as return data. In the example shown in FIG. 15C, the value “10” is obtained by subtracting “50” calculated in step S409 from the level value “60” of the finally selected pixel (3, 2). The data is again written to the address (3, 2) of the input buffer 271 of the RAM 27 (see the input buffer 271 in FIG. 15C).

そして、この画素はセルに組み込まれず、初期走査においてセルに組み入れられる未処理画素とする処理を行う(ステップS411)。上述したように、戻しデータをセル以外の画素に戻すのではなく、戻しデータが発生した画素に再び格納させることで、入力階調値に忠実なドット分布を形成することができる。   Then, this pixel is not incorporated into the cell, but is processed as an unprocessed pixel incorporated into the cell in the initial scan (step S411). As described above, instead of returning the return data to the pixels other than the cells, the dot distribution faithful to the input gradation value can be formed by storing the return data again in the pixel where the return data is generated.

その後処理はステップS408に移行し、上述した処理が繰り返されることになる。ちなみに、CPU22は、重心位置の存在する画素に対応する出力バッファ273に“255”を格納させる。これによりCPU22は、その後の処理で重心位置の存在する画素にドットを打つことができる。   Thereafter, the process proceeds to step S408, and the above-described process is repeated. Incidentally, the CPU 22 stores “255” in the output buffer 273 corresponding to the pixel where the center of gravity exists. Thereby, CPU22 can hit a dot to the pixel in which a gravity center position exists by subsequent processing.

以上説明したように、本実施形態によれば、入力画像に対して誤差拡散法によるプレ階調変換処理によって各色成分の階調データにバラツキを与えたのち、CC法によるポスト階調変換処理によって、所定のレベル値を閾値とする2値化処理を行う。こうすることで、入力画像には存在しない周期的あるいは規則的なパターンや、ドットの偏りに起因した特異パターンなどの発生を抑えた、視覚的に快適な出力画像を得ることができる。また、CC法によるポスト階調変換処理によれば、プレ階調変換処理で生じ得る量子化誤差データの増幅を抑えることができるため、特異パターンの発生を抑えた入力画像に忠実な出力画像を得ることができるのである。   As described above, according to the present embodiment, after the gradation data of each color component is given to the input image by the pre-gradation conversion process by the error diffusion method, the post-gradation conversion process by the CC method is performed. Then, binarization processing is performed using a predetermined level value as a threshold value. By doing so, it is possible to obtain a visually comfortable output image in which generation of a periodic or regular pattern that does not exist in the input image or a peculiar pattern due to the bias of dots is suppressed. Further, according to the post-gradation conversion processing by the CC method, amplification of quantization error data that can occur in the pre-gradation conversion processing can be suppressed, so that an output image faithful to an input image in which generation of a unique pattern is suppressed can be obtained. You can get it.

図16に、一例として、入力画像の階調データのレベル値が“46”の均一な濃度の入力画像に本実施形態を適用した場合を示した。図16(a)は入力画像を、(b)はプレ階調変換処理を行わないでCC法によるポスト階調変換処理を行った場合の出力画像を示し、図16(c)はプレ階調変換処理後の入力画像を、(d)はプレ階調変換処理後にCC法によるポスト階調変換処理を行った場合の出力画像を示した。図16(b)には画面左上部に規則的な繰り返しパターンの発生が見られるが、図16(d)にはこれといった特異パターンは存在していない。図16(b)と(d)との比較から明らかなように、本実施形態であるプレ階調変換処理とポスト階調変換処理との組み合わせ処理によって、特異パターンの発生が抑えられ、視覚的に快適な出力画像を得ている。   FIG. 16 shows, as an example, a case where the present embodiment is applied to an input image having a uniform density whose level value of gradation data of the input image is “46”. FIG. 16A shows the input image, FIG. 16B shows the output image when the post-gradation conversion process by the CC method is performed without performing the pre-gradation conversion process, and FIG. 16C shows the pre-gradation. The input image after the conversion processing is shown, and (d) shows the output image when the post-tone conversion processing by the CC method is performed after the pre-tone conversion processing. In FIG. 16B, the occurrence of a regular repetitive pattern is seen in the upper left part of the screen, but such a unique pattern does not exist in FIG. 16D. As apparent from the comparison between FIG. 16B and FIG. 16D, the combination processing of the pre-gradation conversion processing and the post-gradation conversion processing according to the present embodiment suppresses the occurrence of a singular pattern. A comfortable output image is obtained.

以上、本発明の一実施形態を説明したが、本発明はこうした実施の形態に何ら限定されるものではなく、本発明の趣旨を逸脱しない範囲内において様々な形態で実施し得ることは勿論である。以下、変形例を挙げて説明する。   As mentioned above, although one embodiment of the present invention has been described, the present invention is not limited to such an embodiment, and can of course be implemented in various forms without departing from the spirit of the present invention. is there. Hereinafter, a modification will be described.

「第1変形例」
次に本発明の第1変形例について説明する。前記実施形態では、画素選択の基準点を重心位置にして毎回画素選択時に更新するようにしていたが、第1変形例では、画素選択の基準点を、画素のレベル値には関係なく、画素の座標位置を利用した中心位置とする。これにより、毎回重心位置を計算することがなく、他の処理を含めた全体の処理速度を上げることができる。
"First modification"
Next, a first modification of the present invention will be described. In the above-described embodiment, the pixel selection reference point is set to the center of gravity position and updated at the time of pixel selection. However, in the first modification, the pixel selection reference point is not related to the level value of the pixel. The center position using the coordinate position of. This makes it possible to increase the overall processing speed including other processes without calculating the center of gravity position every time.

第1変形例を図17を用いて説明する。ここで、中心位置は、レベル値を利用した重心位置ではなく、その座標位置を利用した中心位置であって、その位置座標を(x、y)とすると以下の式により演算される(以下の式でNはセル内の画素数)。   A first modification will be described with reference to FIG. Here, the center position is not the position of the center of gravity using the level value but the center position using the coordinate position, and the position coordinate is (x, y) and is calculated by the following formula (the following Where N is the number of pixels in the cell).

(式3)
x = Σi x i / N
y = Σi y i / N
入力画像データとして、各画素、図17(a)に示す階調値が入力される場合で説明する。図17(a)は、説明を簡単にするために縦3画素、横4画素分の画像データが入力されている例であって、1フレーム分の画像データが入力される場合であってもよい。
(Formula 3)
x = Σ i x i / N
y = Σ i y i / N
A case will be described in which each pixel and the gradation value shown in FIG. 17A are input as input image data. FIG. 17A is an example in which image data for three vertical pixels and four horizontal pixels is input for the sake of simplicity, and even when image data for one frame is input. Good.

図17(a)の入力画像データが入力されると、まず初期画素を選択するが前記実施形態と同様に所定の走査方法として、未処理画素のうち最も上の最も左側にある画素を選択する。最終的に生成されるセルが1画像中斜め方向に傾いて配置される確率が高くなり、ドットが斜め方向に打たれ知覚されにくくするためでもある。図17(a)の例では、(n、m)の位置の画素を初期画素として選択する。   When the input image data shown in FIG. 17A is input, an initial pixel is first selected, but the uppermost leftmost pixel among unprocessed pixels is selected as a predetermined scanning method as in the above embodiment. . This is also because the probability that the finally generated cells are arranged obliquely in one image is increased, and the dots are hit in an oblique direction and are difficult to perceive. In the example of FIG. 17A, the pixel at the position (n, m) is selected as the initial pixel.

そして、初期画素をセルCLに組み入れ、その中心位置を(式3)を用いて演算すると図17(b)に示す位置に中心位置SCが位置することになる。次に、その中心位置SCから最も近い位置に位置する未処理画素を選択することになるが、かかる画素が複数ある場合には、前記実施形態等と同様に所定の走査方法により選択する。図17(b)に示す例では、中心位置SCに最も近い位置は(n+1、m)と(n、m+1)の2つ存在するが、ここでは(n+1、m)を選択することになる。   Then, when the initial pixel is incorporated into the cell CL and the center position is calculated using (Equation 3), the center position SC is located at the position shown in FIG. Next, an unprocessed pixel located closest to the center position SC is selected. When there are a plurality of such pixels, they are selected by a predetermined scanning method as in the above-described embodiment. In the example shown in FIG. 17B, there are two positions (n + 1, m) and (n, m + 1) closest to the center position SC. Here, (n + 1, m) is selected.

次に、図17(c)に示すように選択した未処理画素MGをセルCLに組み入れ、セルの拡大処理を行う際、未処理画素を選択するための基準点すなわち中心位置を演算すると、図17(c)に示したように、SCの位置となる。セルのレベル値合計は、この時点で“100”であるのでさらに未処理画素を選択することになる。本変形例でも前記実施形態と同様に閾値を“255”と設定し、この値になるまで未処理画素を選択することにする。   Next, as shown in FIG. 17C, when the selected unprocessed pixel MG is incorporated into the cell CL and the cell enlargement process is performed, a reference point, that is, a center position for selecting the unprocessed pixel is calculated. As shown in FIG. 17 (c), the position is SC. Since the total level value of the cell is “100” at this time, an unprocessed pixel is further selected. Also in this modification, the threshold value is set to “255” as in the above embodiment, and unprocessed pixels are selected until this value is reached.

この基準点(中心位置)SCから最も近い画素を選択することになるが、図17(c)に示す例では、2つの画素(n、m+1)、(n+1、m+1)が存在することになる。この場合、走査方法に従って選択し、(n、m+1)の画素を未処理画素として選択することになる。   The pixel closest to the reference point (center position) SC is selected. In the example shown in FIG. 17C, however, there are two pixels (n, m + 1) and (n + 1, m + 1). . In this case, the selection is made according to the scanning method, and the (n, m + 1) pixel is selected as an unprocessed pixel.

そして、図17(d)に示すように選択した未処理画素をセルに組み入れ、その中心位置を(式3)を用いて演算すると、位置SCに位置することになる。この時点でのセルのレベル値合計は“165”となり、閾値に達しないのでさらに未処理画素を選択することになる。中心位置SCから最も近い距離にある画素は、(n+1、m+1)に位置する画素であるので、この画素を未処理画素として選択する。   Then, as shown in FIG. 17D, when the selected unprocessed pixel is incorporated into the cell and the center position is calculated using (Equation 3), it is located at the position SC. The total level value of the cell at this point is “165”, and the threshold value is not reached, so that an unprocessed pixel is selected. Since the pixel closest to the center position SC is the pixel located at (n + 1, m + 1), this pixel is selected as an unprocessed pixel.

次いで、選択した未処理画素MGをセルに組み入れ、その中心位置SCを(式3)を用いて演算すると、図17(e)に示す位置にすることになる。この時点でのセルのレベル値の合計は“215”で、閾値に達しない。よって、未処理画素を選択する。中心位置SCから最も近い位置にある未処理画素は、(n、m+2)、(n+1、m+2)、(n+2、m)、(n+2、m+1)の4つの画素があるが、所定の走査方法に従って(n+2,m)に位置する画素を選択することになる。   Next, when the selected unprocessed pixel MG is incorporated into the cell and the center position SC is calculated using (Equation 3), the position shown in FIG. The sum of the cell level values at this point is “215”, which does not reach the threshold value. Therefore, an unprocessed pixel is selected. The unprocessed pixel closest to the center position SC has four pixels (n, m + 2), (n + 1, m + 2), (n + 2, m), and (n + 2, m + 1), but according to a predetermined scanning method. The pixel located at (n + 2, m) is selected.

そして、選択した未処理画素をセルに組み入れることになるが、未処理画素を組み入れたとき生成されるセルのレベル値の合計は“265”となり、閾値を超えてしまう。この場合も前記実施形態と同様に、閾値に達する分のレベル値分をセルに組み入れ、この未処理画素に残りのレベル値分(誤差データ)を戻して以後当該画素が未処理画素として選択されるようにする。前記実施形態と同様に、入力画像の階調データに忠実なドットを生成させるためである。ここでは、(n+2,m)に位置する画素に対して“10”を戻しデータとして与えることになる(図17(f)参照)。   The selected unprocessed pixel is incorporated into the cell, but the total level value of the cells generated when the unprocessed pixel is incorporated is “265”, which exceeds the threshold value. In this case as well, as in the previous embodiment, the level value corresponding to the threshold value is incorporated into the cell, the remaining level value (error data) is returned to the unprocessed pixel, and the pixel is then selected as the unprocessed pixel. So that This is to generate dots that are faithful to the gradation data of the input image, as in the above embodiment. Here, “10” is given as return data to the pixel located at (n + 2, m) (see FIG. 17F).

次いで、ここまで構成したセルは、セルのレベル値合計が閾値に達したので、セルの重心位置にドットを生成させるための処理を行う。重心位置の演算は、前記実施形態の(式1)と同様に演算することになり、図18(a)の重心位置GCを得る。   Next, since the total level value of the cells has reached the threshold value, the cell configured so far performs a process for generating dots at the center of gravity of the cell. The center-of-gravity position is calculated in the same manner as (Formula 1) of the above-described embodiment, and the center-of-gravity position GC in FIG. 18A is obtained.

そして、その後の処理により重心位置GCに位置する画素にドットを生成させると、図18(b)に示す位置に生成されることになる。前記実施形態と同様に、毎回重心位置を計算すると、(式1)や(式2)に示すよう処理演算が多くなるが、画素選択のための基準点を中心位置として演算し、最後に重心を演算することで、演算量を減らすことができるとともに、量子化済み画素群が円状に成長してドット間距離を保ち視覚的に快適なドット出力を得ることができる。   Then, when a dot is generated in the pixel located at the center of gravity position GC by the subsequent processing, the dot is generated at the position shown in FIG. As in the previous embodiment, if the center of gravity position is calculated each time, the processing calculation increases as shown in (Expression 1) and (Expression 2), but the reference point for pixel selection is calculated as the center position, and finally the center of gravity is calculated. , The amount of calculation can be reduced, and the quantized pixel group can grow in a circle to maintain a dot-to-dot distance and obtain a visually comfortable dot output.

「第2変形例」
また、第2変形例として、セルの重心位置を演算せずに、第1変形例にておいて、未処理画素の選択に用いたセルの中心位置にある画素にドットを生成させるようにしてもよい。こうすれば、重心の計算を行う必要がないので、演算量を減らすことができる。この場合、中心位置が複数の画素の間に位置することも考えられるが、かかる場合には、例えば走査方法と同じ優先順序に従ってセル内のいずれか1つの画素を選択するようにしてもよい。例えば図18(a)に示す例では、図18(c)に示したように、図18(b)とは異なる画素の位置にドットが生成されることになる。あるいは、ランダムに選択したり、所定のテーブルを用いて複数の画素からいずれか1つの画素を選択したりするようにしてもよい。
"Second modification"
Further, as a second modification, without calculating the center of gravity position of the cell, in the first modification, a dot is generated at the pixel at the center position of the cell used for selecting the unprocessed pixel. Also good. In this way, it is not necessary to calculate the center of gravity, so that the amount of calculation can be reduced. In this case, the central position may be located between a plurality of pixels. In such a case, for example, any one pixel in the cell may be selected according to the same priority order as the scanning method. For example, in the example shown in FIG. 18A, as shown in FIG. 18C, dots are generated at pixel positions different from those in FIG. Or you may make it select at random or select any one pixel from several pixels using a predetermined | prescribed table.

「第3変形例」
さらに、第3変形例として、画素選択のための基準点を毎回更新するのではなく、1回おきに更新したり、2回おきに更新したり、予め回数を決めてその回数のときに更新するようにしてもよい。1回おきに更新する例を、図19を用いて説明する。
“Third Modification”
Furthermore, as a third modification, instead of updating the reference point for pixel selection every time, it is updated every other time, updated every second time, or the number of times is determined in advance and updated at that time. You may make it do. An example of updating every other time will be described with reference to FIG.

図16のときと同様に入力画像データが図19(a)のように入力された場合で説明することにする。図17(b)と同様に、初期画素を選択してその中心位置SCを演算すると図19(b)に示す位置となる。そして、未処理画素MGを基準点(中心位置SC)から最も近い画素を選択すると(n+1、m)に位置する画素となる。   As in the case of FIG. 16, the case where the input image data is input as shown in FIG. 19A will be described. Similarly to FIG. 17B, when the initial pixel is selected and its center position SC is calculated, the position shown in FIG. 19B is obtained. When a pixel closest to the unprocessed pixel MG from the reference point (center position SC) is selected, the pixel is located at (n + 1, m).

次いで、選択した未処理画素をセルに組み入れるが、次に選択する未処理画素は、セルから演算した中心位置SCに基づいて選択するのではなく、組み入れる前の中心位置SCに基づいて選択する。この時点で基準点を更新しないようにする。図19(c)に示すように中心位置SCから最も近い画素は(n、m+1)となりこの画素を未処理画素MGとして選択する。   Next, the selected unprocessed pixel is incorporated into the cell. The unprocessed pixel to be selected next is not selected based on the center position SC calculated from the cell, but is selected based on the center position SC before incorporation. Do not update the reference point at this point. As shown in FIG. 19C, the pixel closest to the center position SC is (n, m + 1), and this pixel is selected as the unprocessed pixel MG.

次いで、選択した未処理画素MGを組み入れたセルは図19(d)のようになる。そして、1回おきに基準点を更新するようにするので、この時点で構成したセルの中心位置SCを演算すると図19(d)に示す位置に中心位置SCが移動することになる。   Next, a cell incorporating the selected unprocessed pixel MG is as shown in FIG. Since the reference point is updated every other time, if the center position SC of the cell configured at this time is calculated, the center position SC moves to the position shown in FIG.

次いで、この更新した中心位置を基準にして、この位置から最も近い未処理画素MGを選択してその画素をセルCLに組み入れると図19(e)に示すようになる。そして、基準点を更新せず、1つ前に演算した中心位置SCから最も近い画素を未処理画素MGとして選択((n+2,m)の位置の画素を選択)して、セルを構成する。   Next, with reference to the updated center position, the unprocessed pixel MG closest to this position is selected and incorporated into the cell CL as shown in FIG. 19 (e). Then, without updating the reference point, the pixel closest to the center position SC calculated immediately before is selected as the unprocessed pixel MG (the pixel at the position (n + 2, m) is selected) to form a cell.

図17の例と同様に、この選択した画素を組み入れたセル内の画素のレベル値合計は閾値を超えるので、超える分を戻しデータとして、選択した画素に戻す。そして、ドット生成のための重心位置を演算すると図19(f)に示した位置GCになり、この位置にドットを生成させるようにする。そして、基準点を更新させると、図19(f)に示した位置に基準点SCが移動することになる。   As in the example of FIG. 17, since the total level value of the pixels in the cell incorporating the selected pixel exceeds the threshold, the excess is returned to the selected pixel as return data. When the center of gravity position for dot generation is calculated, a position GC shown in FIG. 19F is obtained, and a dot is generated at this position. When the reference point is updated, the reference point SC moves to the position shown in FIG.

このように毎回、画素選択の基準点を更新するのではなく、1回おきに更新することでさらに演算量を減らすことができ、他の処理を含めた画像処理装置全体の処理速度の向上を図ることができる。さらに、初期画素の選択から4回目の未処理画素選択のときに基準点を更新し、さらにそれから3回目、2回目、…と減算するように、当該回数のときに更新することとしてもよい。   In this way, instead of updating the reference point for pixel selection every time, the calculation amount can be further reduced by updating every other time, and the processing speed of the entire image processing apparatus including other processing can be improved. Can be planned. Furthermore, the reference point may be updated when the unprocessed pixel is selected for the fourth time from the selection of the initial pixel, and then updated at the number of times so as to be subtracted from the third time, the second time,.

「第4変形例」
前記実施形態では、プレ階調変換に誤差拡散法を用いて階調データのレベル値にバラツキを与えたが、第4変形例として、組織的ディザ法または平均誤差最小法を用いてもよい。これらの手法は、濃淡画像の階調を再現する2値化手法として一般に用いられるものである。また、前記実施形態では、誤差拡散法によるプレ階調変換後に色補正を行うものとして説明したが、特にこれに限るものではなく、色補正や色変換処理を行わず、単に階調データにバラツキを与えるための処理としてプレ階調変換処理を行うこととしても良い。
"Fourth modification"
In the above-described embodiment, the error diffusion method is used for pre-gradation conversion to vary the level value of the gradation data. However, as a fourth modification, a systematic dither method or an average error minimum method may be used. These methods are generally used as a binarization method for reproducing the gradation of a grayscale image. In the above-described embodiment, the color correction is performed after the pre-gradation conversion by the error diffusion method. However, the present invention is not limited to this, and the color correction or the color conversion processing is not performed. A pre-gradation conversion process may be performed as a process for providing the above.

組織的ディザ法は、各画素の階調データのレベル値に対して閾値マトリックスと呼ばれる変換テーブルを用いて、テーブル内に格納された閾値と比較する。そして、入力画素のレベル値がその画素に対応したテーブル内の閾値より大きいか小さいかによって、入力画素のレベル値を所定のレベル値に階調データ変換するのである。こうすることによって、前記実施形態と同様に、入力画素のレベル値にバラツキを与えることができる。   The systematic dither method uses a conversion table called a threshold matrix for the level value of the gradation data of each pixel, and compares the threshold value stored in the table. The level value of the input pixel is converted into gradation data to a predetermined level value depending on whether the level value of the input pixel is larger or smaller than the threshold value in the table corresponding to the pixel. By doing so, it is possible to give variation to the level value of the input pixel as in the above-described embodiment.

また、平均誤差最小法は、周辺の階調データ変換済みの画素に生じた誤差データの重み付き平均値で、次の未処理画素の階調データ値を修正するものである。一方、本実施形態でのポスト階調変換で用いた誤差拡散法は、ある画素の階調データ変換時に生じた誤差データを、周辺のまだ階調データ変換していない未処理画素に拡散して加えるものである。従って、平均誤差最小法と誤差拡散法は、画像端での取り扱いを除けば全く等価と考えてよく、前記実施形態と同様に、入力画素のレベル値にバラツキを与えることができる。   The minimum average error method is a method of correcting the gradation data value of the next unprocessed pixel with a weighted average value of error data generated in the peripheral gradation data converted pixels. On the other hand, the error diffusion method used in the post-gradation conversion in the present embodiment diffuses error data generated during gradation data conversion of a certain pixel to surrounding unprocessed pixels that have not yet been converted to gradation data. It is something to add. Accordingly, the minimum average error method and the error diffusion method can be considered to be completely equivalent except for the handling at the image end, and the level value of the input pixel can be varied as in the above embodiment.

また、前記実施形態および第4変形例におけるプレ階調変換において、上記の説明から明らかなように、レベル値の種類をより少なくすれば誤差データが大きくなるため、バラツキの幅はより大きくできる。従って、第4変形例の変形例として、プレ階調変換時において、入力画像の階調データのレベル値に合わせて、レベル値の種類を可変することとしても良い。例えば、入力画素のレベル値が127以下の比較的低濃度の画像の場合は、階調変換後のレベル値の種類を多くし、入力画素のレベル値が128以上の比較的高濃度の画像の場合は、階調変換後のレベル値の種類を少なくする。あるいはその逆に、低濃度の画像の場合はレベル値の種類を少なくし、高濃度の画像の場合は、レベル値の種類を多くすることとしてもよい。こうすれば、入力画像の濃淡にあわせて誤差データの大きさを制御でき、ポスト階調変換時に入力画像の濃淡領域に合わせて生成するセルの形状が変化する確率が増え、規則的なパターンの抑制に寄与することができる。   Further, in the pre-gradation conversion in the embodiment and the fourth modification example, as is clear from the above description, the error data increases as the number of level values decreases, so that the variation width can be increased. Therefore, as a modification of the fourth modification, the type of level value may be varied in accordance with the level value of the gradation data of the input image at the time of pre-gradation conversion. For example, in the case of an image with a relatively low density where the level value of the input pixel is 127 or less, the number of types of level values after gradation conversion is increased, and an image with a relatively high density where the level value of the input pixel is 128 or more. In this case, the number of types of level values after gradation conversion is reduced. Or, conversely, the type of level value may be reduced in the case of an image with a low density, and the type of level value may be increased in the case of an image with a high density. In this way, the size of the error data can be controlled in accordance with the density of the input image, and the probability that the shape of the cell to be generated will change in accordance with the density area of the input image during post-gradation conversion increases. It can contribute to suppression.

「第5変形例」
前記実施形態では、ポスト階調変換によって、“0”と“255”の2種類のレベル値に階調変換した2値化データを出力バッファ273に格納した。これは、以降のドットを形成する処理において、レベル値“255”に対応した大きさのドットを打つことを想定したためである。第5変形例では、複数種類の大きさのドットを打つこととし、その複数種類の大きさのドットに対応した複数の種類のレベル値にポスト階調変換するものとしても良い。
“Fifth Modification”
In the above embodiment, the binarized data obtained by gradation conversion into two kinds of level values “0” and “255” by post gradation conversion is stored in the output buffer 273. This is because it is assumed that dots having a size corresponding to the level value “255” are hit in the subsequent dot forming process. In the fifth modified example, dots of a plurality of types of sizes may be hit, and post-gradation conversion may be performed to a plurality of types of level values corresponding to the plurality of types of sizes of dots.

例えば、パルス幅変調部35は、ポスト階調変換処理によって2値化されたレベル値に対応して、レーザを駆動するための駆動パルスのパルス幅を変更して駆動データを生成する。そして、この駆動データを印刷エンジン40に出力し、レーザドライバ41を介してレーザーダイオード42を駆動する。この結果、レーザーダイオード42の駆動時間(オン時間)によってドットの大きさを制御することができるため、2値化されたレベル値に応じた大きさのドットが印刷用紙等の記録媒体に印刷されることになる。この場合、ポスト階調変換後に2値化データとして出力されるレベル値の種類は、2値化に際して用いる閾値の種類数だけ存在することになる。従って、この2値化されたレベル値の種類数は、ポスト階調変換前の階調データのレベル値の種類に対して通常少ない場合が多いが、上述したパルス幅を細かく設定して駆動データを生成するようなときは多くなる場合もある。   For example, the pulse width modulation unit 35 generates drive data by changing the pulse width of the drive pulse for driving the laser corresponding to the level value binarized by the post-gradation conversion process. Then, this drive data is output to the print engine 40, and the laser diode 42 is driven via the laser driver 41. As a result, since the dot size can be controlled by the driving time (on time) of the laser diode 42, dots having a size corresponding to the binarized level value are printed on a recording medium such as printing paper. Will be. In this case, there are as many types of level values output as binarized data after post-gradation conversion as the number of threshold types used for binarization. Therefore, the number of kinds of binarized level values is usually small compared to the kind of level values of gradation data before post-gradation conversion. However, the drive data is set by finely setting the pulse width described above. There are times when it will increase when generating.

実際に、ポスト階調変換処理に際しては、入力画像の階調データを、対象となる大きさの複数のドットに対応して入力画像の階調データを分版する処理を行い、複数のドットを形成するための2値化処理を行うことも可能である。この処理については、本発明の本質ではないので、ここでは説明を省略する。   Actually, in the post-gradation conversion process, the gradation data of the input image is divided into the gradation data of the input image corresponding to a plurality of dots of a target size, and the plurality of dots are converted. It is also possible to perform binarization processing for forming. Since this processing is not the essence of the present invention, the description is omitted here.

「第6変形例」
また、第6変形例として、前記実施形態における画像処理装置は、レーザープリンタにて構成するようにしたが、本発明はこれに限定されるものでなく、インクジェットプリンタなどインクを印刷媒体に付着させて印刷する方式のプリンタやサーマルプリンタなど種々のプリンタや電子写真あるいはディスプレーなどにて構成するようにしてもよい。あるいは、このようなプリンタなどの機能が組み込まれたコピー機やコンピュータ、ワープロ、ファックスなど種々の機器において本発明の画像処理装置を構成するようにしてもよい。
“Sixth Modification”
As a sixth modification, the image processing apparatus in the above embodiment is configured by a laser printer. However, the present invention is not limited to this, and ink such as an ink jet printer is attached to a print medium. The printer may be configured by various printers such as a printer or a thermal printer, an electronic photograph or a display. Alternatively, the image processing apparatus of the present invention may be configured in various apparatuses such as a copier, a computer, a word processor, and a fax machine in which such a function as a printer is incorporated.

本発明が適用される一実施形態におけるシステム全体を示す構成図。The block diagram which shows the whole system in one Embodiment with which this invention is applied. 本実施形態での画像処理装置のハード構成を説明する模式図。1 is a schematic diagram illustrating a hardware configuration of an image processing apparatus according to an embodiment. 階調データ変換処理において階調変換の様子を説明する説明図。Explanatory drawing explaining the mode of gradation conversion in gradation data conversion processing. 本実施形態での画像処理装置が行う処理を説明するためのフローチャート。6 is a flowchart for explaining processing performed by the image processing apparatus according to the present embodiment. 入力画像データの階調変換処理における走査方法を示すめの説明図。Explanatory drawing which shows the scanning method in the gradation conversion process of input image data. 誤差拡散法における誤差データの重み付け分散方法を説明する説明図。Explanatory drawing explaining the weighting dispersion | distribution method of the error data in an error diffusion method. プレ階調変換処理における誤差拡散処理を説明するフローチャート。6 is a flowchart for explaining error diffusion processing in pre-gradation conversion processing. 誤差拡散法における階調データの分散処理を説明する説明図。Explanatory drawing explaining the dispersion | distribution process of the gradation data in an error diffusion method. CC法によるポスト階調変換処理を説明するフローチャート。The flowchart explaining the post gradation conversion process by CC method. CC法における階調変換処理の過程を説明するための説明図。Explanatory drawing for demonstrating the process of the gradation conversion process in CC method. CC法における階調変換処理の過程を説明するための説明図。Explanatory drawing for demonstrating the process of the gradation conversion process in CC method. プレ階調変換処理の有無によるポスト階調変換の違いを説明する説明図。Explanatory drawing explaining the difference of the post gradation conversion by the presence or absence of a pre gradation conversion process. RAMの構成と格納されるデータの例を説明する説明図。Explanatory drawing explaining the structure of RAM and the example of the data stored. RAMの構成と格納されるデータの例を説明する説明図。Explanatory drawing explaining the structure of RAM and the example of the data stored. RAMの構成と格納されるデータの例を説明する説明図。Explanatory drawing explaining the structure of RAM and the example of the data stored. 本実施形態の階調変換処理によって得る出力画像の一例を示した模式図。The schematic diagram which showed an example of the output image obtained by the gradation conversion process of this embodiment. 画素選択の基準点をセルの中心位置とする場合のCC法での処理説明図。Process explanatory drawing by CC method in case the reference point of pixel selection is made into the center position of a cell. 画素選択の基準点をセルの中心位置とする場合のCC法での処理説明図。Process explanatory drawing by CC method in case the reference point of pixel selection is made into the center position of a cell. 画素選択の基準点をセルの中心位置とする場合のCC法での処理説明図。Process explanatory drawing by CC method in case the reference point of pixel selection is made into the center position of a cell.

符号の説明Explanation of symbols

10…ホストコンピュータ、11…アプリケーション部、12…ラスタライズ部、20…画像出力装置、21…入力I/F、22…CPU、24…計、25…ハードディスク、26…ROM、27…RAM、30…画像処理部、31…プレ階調変換部、32…色変換部、33…色補正表、34…ポスト階調変換部、35…パルス幅変調部、40…印刷エンジン、41…レーザドライバ、42…レーザーダイオード、271…入力バッファ、272…ワーキングメモリ、273…出力バッファ、CL…セル、CL1、CL2、CL3…セル、GC…セルの重心位置、GC2、GC3…セルの重心位置、SC…セルの中心位置、MG…未処理画素。
DESCRIPTION OF SYMBOLS 10 ... Host computer, 11 ... Application part, 12 ... Rasterization part, 20 ... Image output device, 21 ... Input I / F, 22 ... CPU, 24 ... Total, 25 ... Hard disk, 26 ... ROM, 27 ... RAM, 30 ... Image processing unit 31 ... Pre-gradation conversion unit 32 32 Color conversion unit 33 Color correction table 34 Post-gradation conversion unit 35 Pulse width modulation unit 40 Print engine 41 Laser driver 42 ... Laser diode, 271 ... Input buffer, 272 ... Working memory, 273 ... Output buffer, CL ... Cell, CL1, CL2, CL3 ... Cell, GC ... Center of gravity of cell, GC2, GC3 ... Center of gravity of cell, SC ... Cell Center position, MG ... unprocessed pixel.

Claims (15)

画素ごとに、少なくとも、P(Pは2以上の整数)種類のレベル値を有する階調データからQ(Q<P、Pは2以上の整数)種類のレベル値を有する階調データに変換する第1の階調データ変換と、N(Nは2以上の整数)種類のレベル値を有する階調データからM(Mは2以上の整数)種類のレベル値を有する階調データに変換する第2の階調データ変換と、を実施する画像処理装置であって、
前記第2の階調データ変換の実施に際し、
画素ごとのレベル値の総和が閾値以上となるまで前記N種類のレベル値を有する画素を選択して画素群を生成する画素群生成部と、
生成した前記画素群の所定画素に対して前記M種類のレベル値を付与するデータ付与部と、
を備えた画像処理装置。
For each pixel, gradation data having at least P (P is an integer of 2 or more) type level values is converted into gradation data having Q (Q <P, P is an integer of 2 or more) kinds of level values. The first gradation data conversion is performed to convert gradation data having N (N is an integer of 2 or more) types of gradation values into gradation data having M (M is an integer of 2 or more) types of level values. An image processing apparatus that performs gradation data conversion of 2;
In performing the second gradation data conversion,
A pixel group generation unit that generates a pixel group by selecting pixels having the N types of level values until the sum of level values for each pixel is equal to or greater than a threshold;
A data providing unit that provides the M kinds of level values to the predetermined pixels of the generated pixel group;
An image processing apparatus.
請求項1に記載の画像処理装置であって、
前記第2の階調データ変換の実施に際し、
さらに、前記画素群生成部で生成した画素群の重心位置を決定する画素群重心決定部を備え、
前記画素群生成部は、前記画素群重心決定部で決定した重心から最も近い画素を、画素ごとのレベル値の総和が閾値以上となるまで選択し続けることにより前記画素群を生成し、前記データ付与部は、前記画素群重心決定部で決定した重心に位置する画素に前記M種類のレベル値を付与することを特徴とする画像処理装置。
The image processing apparatus according to claim 1,
In performing the second gradation data conversion,
Furthermore, a pixel group centroid determining unit that determines the centroid position of the pixel group generated by the pixel group generating unit,
The pixel group generation unit generates the pixel group by continuing to select the pixel closest to the center of gravity determined by the pixel group center of gravity determination unit until the sum of level values for each pixel is equal to or greater than a threshold, and the data The assigning unit assigns the M kinds of level values to pixels located at the center of gravity determined by the pixel group center of gravity determination unit.
請求項2に記載の画像処理装置であって、
前記画素群生成部は、前記画素群重心決定部で決定した重心から最も近い画素を、画素ごとのレベル値の総和が閾値以上となるまで選択し続け、選択した前記画素群におけるレベル値の総和が前記閾値を超えたとき、超えた分の前記レベル値を前記画素群生成部で最後に選択した前記画素に戻すことを特徴とする画像処理装置。
The image processing apparatus according to claim 2,
The pixel group generation unit continues to select the pixel closest to the centroid determined by the pixel group centroid determination unit until the sum of the level values for each pixel is equal to or greater than a threshold, and the sum of the level values in the selected pixel group When the threshold value exceeds the threshold, the level value exceeding the threshold value is returned to the last pixel selected by the pixel group generation unit.
請求項1ないし3のいずれか一項に記載の画像処理装置であって、
前記第1の階調データ変換の実施に際し、階調データ変換の手法として、組織的ディザ法または誤差拡散法または平均誤差最小法を用いることを特徴とする画像処理装置。
The image processing apparatus according to any one of claims 1 to 3,
An image processing apparatus using a systematic dither method, an error diffusion method, or an average error minimum method as a method of gradation data conversion when performing the first gradation data conversion.
画素ごとに、少なくとも、P(Pは2以上の整数)種類のレベル値を有する階調データからQ(Q<P、Pは2以上の整数)種類のレベル値を有する階調データに変換する第1の階調データ変換と、N(Nは2以上の整数)種類のレベル値を有する階調データからM(Mは2以上の整数)種類のレベル値を有する階調データに変換する第2の階調データ変換とを行う画像処理方法であって、
前記第2の階調データ変換の実施に際し、
画素ごとのレベル値の総和が閾値以上となるまで前記N種類のレベル値を有する画素を選択して画素群を生成する画素群生成工程と、
前記画素群生成工程で生成した画素群の重心位置を決定する画素群重心決定工程と、
前記画素群重心決定工程で決定した重心に位置する画素に前記M種類のレベル値を付与するデータ付与工程とを備え、
前記画素群生成工程は、前記画素群重心決定工程で決定した重心から最も近い画素を、画素ごとのレベル値の総和が閾値以上となるまで選択し続けることにより前記画素群を生成することを特徴とする画像処理方法。
For each pixel, gradation data having at least P (P is an integer of 2 or more) type level values is converted into gradation data having Q (Q <P, P is an integer of 2 or more) kinds of level values. The first gradation data conversion is performed to convert gradation data having N (N is an integer of 2 or more) types of gradation values into gradation data having M (M is an integer of 2 or more) types of level values. 2 is an image processing method for performing gradation data conversion of 2;
In performing the second gradation data conversion,
A pixel group generation step of generating a pixel group by selecting pixels having the N types of level values until the sum of level values for each pixel is equal to or greater than a threshold;
A pixel group centroid determination step for determining a centroid position of the pixel group generated in the pixel group generation step;
A data providing step of assigning the M kinds of level values to pixels located at the center of gravity determined in the pixel group center of gravity determination step;
The pixel group generation step generates the pixel group by continuing to select a pixel closest to the center of gravity determined in the pixel group center of gravity determination step until a sum of level values for each pixel is equal to or greater than a threshold value. An image processing method.
画素ごとに、少なくとも、P(Pは2以上の整数)種類のレベル値を有する階調データからQ(Q<P、Pは2以上の整数)種類のレベル値を有する階調データに変換する第1の階調データ変換と、N(Nは2以上の整数)種類のレベル値を有する階調データからM(Mは2以上の整数)種類のレベル値を有する階調データに変換する第2の階調データ変換とを行う画像処理プログラムであって、
前記第2の階調データ変換の実施に際し、
画素ごとのレベル値の総和が閾値以上となるまで前記N種類のレベル値を有する画素を選択して画素群を生成する画素群生成処理と、
前記画素群生成処理で生成した画素群の重心位置を決定する画素群重心決定処理と、
前記画素群重心決定処理で決定した重心に位置する画素に前記M種類のレベル値を付与するデータ付与処理とをコンピュータに実行させ、
前記画素群生成処理は、前記画素群重心決定処理で決定した重心から最も近い画素を、画素ごとのレベル値の総和が閾値以上となるまで選択し続けることにより前記画素群を生成することを特徴とするプログラム。
For each pixel, gradation data having at least P (P is an integer of 2 or more) type level values is converted into gradation data having Q (Q <P, P is an integer of 2 or more) kinds of level values. The first gradation data conversion is performed to convert gradation data having N (N is an integer of 2 or more) types of gradation values into gradation data having M (M is an integer of 2 or more) types of level values. 2 is an image processing program for performing gradation data conversion of 2;
In performing the second gradation data conversion,
A pixel group generation process for generating a pixel group by selecting pixels having the N types of level values until the sum of level values for each pixel is equal to or greater than a threshold;
A pixel group centroid determination process for determining a centroid position of the pixel group generated by the pixel group generation process;
Causing the computer to execute a data addition process for assigning the M kinds of level values to the pixels located at the center of gravity determined in the pixel group center of gravity determination process;
In the pixel group generation process, the pixel group is generated by continuously selecting a pixel closest to the center of gravity determined in the pixel group center of gravity determination process until a sum of level values for each pixel becomes equal to or greater than a threshold value. Program.
請求項6に記載の画像処理プログラムを記録したコンピュータ読み取り可能な記録媒体。   A computer-readable recording medium on which the image processing program according to claim 6 is recorded. 画素ごとに、少なくとも、P(Pは2以上の整数)種類のレベル値を有する階調データからQ(Q<P、Pは2以上の整数)種類のレベル値を有する階調データに変換する第1の階調データ変換と、N(Nは2以上の整数)種類のレベル値を有する階調データからM(Mは2以上の整数)種類のレベル値を有する階調データに変換する第2の階調データ変換とを行う画像処理装置であって、
前記第2の階調データ変換の実施に際し、
画素選択のための第1の基準点に基づいて、画素ごとのレベル値の総和が閾値以上となるまで前記N種類のレベル値を有する画素を選択して画素群を生成する画素群生成部と、
前記画素群生成部で生成した画素群の第2の基準点を決定する画素群基準点決定部と、
前記画素群基準点決定部で決定した前記第2の基準点に位置する画素に前記M種類のレベル値を付与するデータ付与部とを備え、
前記画素群生成部は、前記第1の基準点を更新させて当該第1の基準点に基づいて画素を選択するようにしたことを特徴とする画像処理装置。
For each pixel, gradation data having at least P (P is an integer of 2 or more) type level values is converted into gradation data having Q (Q <P, P is an integer of 2 or more) kinds of level values. The first gradation data conversion is performed to convert gradation data having N (N is an integer of 2 or more) types of gradation values into gradation data having M (M is an integer of 2 or more) types of level values. An image processing apparatus for performing gradation data conversion of 2;
In performing the second gradation data conversion,
A pixel group generation unit that generates a pixel group by selecting pixels having the N types of level values until a sum of level values for each pixel is equal to or greater than a threshold value based on a first reference point for pixel selection; ,
A pixel group reference point determination unit for determining a second reference point of the pixel group generated by the pixel group generation unit;
A data providing unit that provides the M kinds of level values to the pixels located at the second reference point determined by the pixel group reference point determining unit;
The image processing apparatus, wherein the pixel group generation unit updates the first reference point and selects a pixel based on the first reference point.
請求項8に記載の画像処理装置において、
前記画像群生成部は、前記第1の基準点を、前記画素を所定の回数選択するごとに更新
させることを特徴とする画像処理装置。
The image processing apparatus according to claim 8.
The image group generation unit updates the first reference point every time the pixel is selected a predetermined number of times.
請求項8に記載の画像処理装置において、
前記第1の基準点は、前記選択した画素の位置から演算した中心位置であり、前記第2の基準点は、前記画素群の画素の位置と階調画素データ値とから演算した重心位置であることを特徴とする画像処理装置。
The image processing apparatus according to claim 8.
The first reference point is a center position calculated from the position of the selected pixel, and the second reference point is a center of gravity position calculated from the pixel position of the pixel group and the gradation pixel data value. An image processing apparatus comprising:
請求項8に記載の画像処理装置において、
前記第1の基準点は、前記選択した画素の位置から演算した中心位置であり、前記第2の基準点は、前記画素群の画素の位置から演算した中心位置であることを特徴とする画像処理装置。
The image processing apparatus according to claim 8.
The first reference point is a center position calculated from the position of the selected pixel, and the second reference point is a center position calculated from the pixel position of the pixel group. Processing equipment.
請求項8ないし11のいずれか一項に記載の画像処理装置であって、
前記第1の階調データ変換の実施に際し、階調データ変換の手法として、組織的ディザ法または誤差拡散法または平均誤差最小法を用いることを特徴とする画像処理装置。
The image processing apparatus according to any one of claims 8 to 11,
An image processing apparatus using a systematic dither method, an error diffusion method, or an average error minimum method as a method of gradation data conversion when performing the first gradation data conversion.
画素ごとに、少なくとも、P(Pは2以上の整数)種類のレベル値を有する階調データからQ(Q<P、Pは2以上の整数)種類のレベル値を有する階調データに変換する第1の階調データ変換と、N(Nは2以上の整数)種類のレベル値を有する階調データからM(Mは2以上の整数)種類のレベル値を有する階調データに変換する第2の階調データ変換とを行う画像処理方法であって、
前記第2の階調データ変換の実施に際し、
画素選択のための第1の基準点に基づいて、画素ごとのレベル値の総和が閾値以上となるまで前記N種類のレベル値を有する画素を選択して画素群を生成する画素群生成工程と、
前記画素群生成工程で生成した画素群の第2の基準点を決定する画素群基準点決定工程と、
前記画素群基準点決定工程で決定した前記第2の基準点に位置する画素に前記M種類のレベル値を付与するデータ付与工程とを備え、
前記画素群生成工程は、前記第1の基準点を更新させて当該第1の基準点に基づいて画素を選択するようにしたことを特徴とする画像処理方法。
For each pixel, gradation data having at least P (P is an integer of 2 or more) type level values is converted into gradation data having Q (Q <P, P is an integer of 2 or more) kinds of level values. The first gradation data conversion is performed to convert gradation data having N (N is an integer of 2 or more) types of gradation values into gradation data having M (M is an integer of 2 or more) types of level values. 2 is an image processing method for performing gradation data conversion of 2;
In performing the second gradation data conversion,
A pixel group generation step of generating a pixel group by selecting pixels having the N types of level values until the sum of the level values for each pixel becomes equal to or greater than a threshold value based on a first reference point for pixel selection; ,
A pixel group reference point determining step for determining a second reference point of the pixel group generated in the pixel group generating step;
A data providing step of assigning the M kinds of level values to the pixels located at the second reference point determined in the pixel group reference point determining step,
In the pixel group generation step, the first reference point is updated and a pixel is selected based on the first reference point.
画素ごとに、少なくとも、P(Pは2以上の整数)種類のレベル値を有する階調データからQ(Q<P、Pは2以上の整数)種類のレベル値を有する階調データに変換する第1の階調データ変換と、N(Nは2以上の整数)種類のレベル値を有する階調データからM(Mは2以上の整数)種類のレベル値を有する階調データに変換する第2の階調データ変換とを行う画像処理プログラムであって、
前記第2の階調データ変換の実施に際し、
画素選択のための第1の基準点に基づいて、画素ごとのレベル値の総和が閾値以上となるまで前記N種類のレベル値を有する画素を選択して画素群を生成する画素群生成処理と、
前記画素群生成処理で生成した画素群の第2の基準点を決定する画素群基準点決定処理と、
前記画素群基準点決定処理で決定した前記第2の基準点に位置する画素に前記M種類のレベル値を付与するデータ付与処理とをコンピュータに実行させ、
前記画素群生成処理は、前記第1の基準点を更新させて当該第1の基準点に基づいて画素を選択するようにしたことを特徴とするプログラム。
For each pixel, gradation data having at least P (P is an integer of 2 or more) kinds of level values is converted to gradation data having Q (Q <P, P is an integer of 2 or more) kinds of level values. First gradation data conversion is performed to convert gradation data having N (N is an integer of 2 or more) types of gradation values into gradation data having M (M is an integer of 2 or more) types of level values. 2 is an image processing program that performs gradation data conversion of 2;
In performing the second gradation data conversion,
A pixel group generation process for generating a pixel group by selecting pixels having the N kinds of level values until the sum of the level values for each pixel is equal to or greater than a threshold value based on the first reference point for pixel selection; ,
A pixel group reference point determination process for determining a second reference point of the pixel group generated by the pixel group generation process;
Causing the computer to execute a data adding process for adding the M kinds of level values to the pixels located at the second reference point determined in the pixel group reference point determining process;
The pixel group generation process updates the first reference point and selects a pixel based on the first reference point.
請求項14に記載の画像処理プログラムを記録したコンピュータ読み取り可能な記録媒体。

A computer-readable recording medium on which the image processing program according to claim 14 is recorded.

JP2004121477A 2004-04-16 2004-04-16 Apparatus, method and program for image processing and recording medium recording this program Withdrawn JP2005311414A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004121477A JP2005311414A (en) 2004-04-16 2004-04-16 Apparatus, method and program for image processing and recording medium recording this program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004121477A JP2005311414A (en) 2004-04-16 2004-04-16 Apparatus, method and program for image processing and recording medium recording this program

Publications (1)

Publication Number Publication Date
JP2005311414A true JP2005311414A (en) 2005-11-04

Family

ID=35439729

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004121477A Withdrawn JP2005311414A (en) 2004-04-16 2004-04-16 Apparatus, method and program for image processing and recording medium recording this program

Country Status (1)

Country Link
JP (1) JP2005311414A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017135569A (en) * 2016-01-28 2017-08-03 コニカミノルタ株式会社 Image processing device, image forming apparatus and threshold matrix shaping method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017135569A (en) * 2016-01-28 2017-08-03 コニカミノルタ株式会社 Image processing device, image forming apparatus and threshold matrix shaping method

Similar Documents

Publication Publication Date Title
JP4165570B2 (en) Image processing apparatus, image processing method, and image processing program
JP7005314B2 (en) Image processing equipment, image processing methods, and programs
JP2007109231A (en) Processor-readable storage medium
JP4479663B2 (en) Image processing apparatus, image processing method, and image processing program for halftone processing using fixed cells
JPWO2005109851A1 (en) Image processing apparatus, image processing method, and program
JP2005311414A (en) Apparatus, method and program for image processing and recording medium recording this program
US10404892B2 (en) Image forming apparatus for outputting a halftone image and image forming method
US7570820B2 (en) Image processing apparatus, image processing method, image processing program and recording medium for recording program
JP2005318402A (en) Image processing device, method and program, and recording medium recorded with program
JP2005341142A (en) Image processor, processing method and program, and recording medium with the program stored
JP3951953B2 (en) Printing apparatus, image processing apparatus, printing method, image processing method, and program
JP2005117642A (en) Halftoning method, image processor, image processing method, and program
JP4337670B2 (en) Image processing apparatus, image processing method, and program
JP2007194688A (en) Image processor, image processing method, image processing program and recording medium with the program recorded thereon
JP2006025220A (en) Image processing apparatus, image processing method, image processing program, and recording medium recorded with the program
JP2006005634A (en) Device, method, and program for image processing, and recording medium where the program is recorded
JP4492723B2 (en) Image processing apparatus, image processing method, and image processing program
JP2005341351A (en) Image processor, processing method and program
JP3896982B2 (en) Image processing apparatus, method, program, and recording medium recording the program
US20070058200A1 (en) System and method for generating multi-bit halftones using horizontal buildup
JP2005354129A (en) Execution of halftoning dependent on image
JP3928576B2 (en) Image processing apparatus, method, program, and recording medium recording the program
JPH07250246A (en) Image forming device
JP2005136975A (en) Image processing apparatus, image processing method, and program
JP2019110512A (en) Image forming apparatus, image forming method, and program

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20070703