JP4577366B2 - Image processing apparatus for processing a plurality of rasters in parallel - Google Patents

Image processing apparatus for processing a plurality of rasters in parallel Download PDF

Info

Publication number
JP4577366B2
JP4577366B2 JP2008015729A JP2008015729A JP4577366B2 JP 4577366 B2 JP4577366 B2 JP 4577366B2 JP 2008015729 A JP2008015729 A JP 2008015729A JP 2008015729 A JP2008015729 A JP 2008015729A JP 4577366 B2 JP4577366 B2 JP 4577366B2
Authority
JP
Japan
Prior art keywords
pixel
raster
pixels
image data
data
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.)
Expired - Fee Related
Application number
JP2008015729A
Other languages
Japanese (ja)
Other versions
JP2008167468A (en
Inventor
繁明 角谷
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 JP2008015729A priority Critical patent/JP4577366B2/en
Publication of JP2008167468A publication Critical patent/JP2008167468A/en
Application granted granted Critical
Publication of JP4577366B2 publication Critical patent/JP4577366B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Description

この発明は、二次元的に配列された複数の画素の各々に階調値を対応付けた画像データを変換する技術に関し、詳しくは、各画素についてドット形成の有無を判断しながら画素の列たるラスタをドット列に変換することによって、該画像データをドットの形成有無による表現形式の画像データに変換する技術に関する。   The present invention relates to a technique for converting image data in which a gradation value is associated with each of a plurality of pixels arranged two-dimensionally, and more specifically, a pixel array while judging the presence or absence of dot formation for each pixel. The present invention relates to a technique for converting image data into image data in an expression format depending on whether or not dots are formed by converting a raster into a dot row.

印刷媒体や液晶画面といった表示媒体上にドットを形成することで画像を表現する画像表示装置は、各種画像機器の出力装置として広く使用されている。かかる画像表示装置は、局所的にはドットを形成するか否かのいずれかの状態しか表現し得ないが、画像の階調値に応じてドットの形成密度を適切に制御することによって、階調が連続的に変化する画像を表現することが可能となっている。   An image display device that expresses an image by forming dots on a display medium such as a print medium or a liquid crystal screen is widely used as an output device of various image devices. Such an image display device can express only the state of whether or not to form dots locally, but by appropriately controlling the dot formation density according to the gradation value of the image, It is possible to express an image whose tone changes continuously.

これら画像表示装置において、画像の階調値に応じて適切な密度でドットが形成されるように、各画素についてドット形成の有無を判断する方法としては、各種の方法が提案されており、代表的な手法としては、いわゆるディザ法と呼ばれる手法と、誤差拡散法と呼ばれる手法とがある。   In these image display devices, various methods have been proposed as methods for determining the presence or absence of dot formation for each pixel so that dots are formed at an appropriate density according to the gradation value of the image. As a typical method, there are a method called a dither method and a method called an error diffusion method.

誤差拡散法は、画素にドットを形成したこと、あるいは形成しなかったことにより発生する階調表現の誤差を算出し、周辺の画素で発生した誤差を考慮しながらドット形成の有無を判断する手法である。誤差拡散法を採用すれば、周辺の画素で発生した誤差が解消されるようにドット形成の有無を判断することで、画像データを精度良く表示することが可能である。これに対してディザ法では、階調表現の誤差を算出する処理が不要であり、また、周辺の画素で発生した誤差を考慮することなくドット形成の有無を判断することができるので、誤差拡散法よりも高速な処理が可能である。このことから、画像の表示速度と表示画質とのかね合いから、表示速度を優先させる場合にはディザ法を適用することで迅速に表示することが可能となり、表示画質を優先させたい場合は誤差拡散法を適用することで良好な画質の画像を表示することができる。   The error diffusion method is a method of calculating the error of gradation expression that occurs when dots are formed or not formed on a pixel, and judging the presence or absence of dot formation while taking into account the error generated in surrounding pixels. It is. If the error diffusion method is employed, it is possible to display image data with high accuracy by determining the presence or absence of dot formation so as to eliminate errors generated in surrounding pixels. On the other hand, the dither method does not require processing for calculating an error in gradation expression, and can determine whether or not dots are formed without considering the error generated in the surrounding pixels. High-speed processing is possible. From this, it is possible to display quickly by applying the dither method when priority is given to display speed based on the balance between image display speed and display image quality. By applying the diffusion method, an image with good image quality can be displayed.

しかし近年では、画像データを構成する画素数は次第に増加する傾向にあり、これに伴って画像データの変換に要する時間も増加することから、ディザ法を適用した場合でも、画像を迅速に表示することが困難な場合が生じている。従って、画素数の大きな画像データであっても迅速な表示を可能とするために、より迅速な画像処理方法の開発が要請されている。   However, in recent years, the number of pixels constituting image data tends to increase gradually, and the time required for image data conversion also increases accordingly. Therefore, even when the dither method is applied, the image is displayed quickly. There are cases where this is difficult. Therefore, in order to enable quick display even for image data having a large number of pixels, development of a more rapid image processing method is required.

この発明は、従来技術における上述の課題を解決するためになされたものであり、画質の悪化を招くことなく、ドット形成有無の判断に要する時間を短縮化することによって、高画質の画像を迅速に表示可能な技術を提供することを目的とする。   The present invention has been made in order to solve the above-described problems in the prior art. By reducing the time required for determining whether or not dots are formed without deteriorating the image quality, a high-quality image can be quickly obtained. The purpose is to provide technology that can be displayed on the screen.

上述の課題の少なくとも一部を解決するため、本発明の第1の画像処理装置は、次の構成を採用した。すなわち、
二次元的に配列された複数の画素の各々に階調値を対応付けた画像データを受け取り、各画素の階調値と所定の閾値とを比較してドットの形成有無を判断しながら該画素の列たるラスタをドット列に変換することによって、該画像データをドットの形成有無による表現形式のデータに変換する画像処理装置であって、
複数の前記閾値が二次元的に配列された閾値マトリックスを記憶しておく閾値マトリックス記憶手段と、
ドットの形成有無の判断を行う対象画素を選択する対象画素選択手段と、
前記対象画素に対応する閾値を前記閾値マトリックスの中から読み出して、該対象画素に対応付けられた前記階調値と比較することにより、該対象画素についてのドット形成有無を判断するドット形成判断手段と
を備え、
前記対象画素選択手段は、互いに隣接する所定のN本(Nは2以上の整数)の前記ラスタをラスタ群としてまとめ、該ラスタ群に含まれる各画素を所定の順番に従って順次選択することにより、該N本の各ラスタから並行して前記対象画素を選択する手段であることを要旨とする。
In order to solve at least a part of the above-described problems, the first image processing apparatus of the present invention employs the following configuration. That is,
Receiving image data in which a gradation value is associated with each of a plurality of pixels arranged two-dimensionally, comparing the gradation value of each pixel with a predetermined threshold value and determining whether or not a dot is formed An image processing apparatus that converts the image data into data in an expression format depending on whether or not dots are formed by converting a raster as a row of dots into a dot row,
Threshold matrix storage means for storing a threshold matrix in which a plurality of the thresholds are two-dimensionally arranged;
Target pixel selection means for selecting a target pixel for determining whether or not to form a dot;
A dot formation determination unit that reads out a threshold value corresponding to the target pixel from the threshold value matrix and compares the threshold value with the gradation value corresponding to the target pixel, thereby determining whether or not the target pixel is formed. And
The target pixel selection means collects a predetermined N number of adjacent rasters (N is an integer of 2 or more) as a raster group, and sequentially selects each pixel included in the raster group according to a predetermined order, The gist is that the target pixel is selected from the N rasters in parallel.

また、上記の第1の画像処理装置に対応する本発明の第1の画像処理方法は、
二次元的に配列された複数の画素の各々に階調値を対応付けた画像データを受け取り、各画素の階調値と所定の閾値とを比較してドットの形成有無を判断しながら該画素の列たるラスタをドット列に変換することによって、該画像データをドットの形成有無による表現形式のデータに変換する画像処理方法であって、
複数の前記閾値が二次元的に配列された閾値マトリックスを予め記憶しておく第1の工程と、
ドットの形成有無の判断を行う対象画素を選択する第2の工程と、
前記対象画素に対応する閾値を前記閾値マトリックスの中から読み出して、該対象画素に対応付けられた前記階調値と比較することにより、該対象画素についてのドット形成有無を判断する第3の工程と
を備え、
前記第2の工程は、互いに隣接する所定のN本(Nは2以上の整数)の前記ラスタをラスタ群としてまとめ、該ラスタ群に含まれる各画素を所定の順番に従って順次選択することにより、該N本の各ラスタから並行して前記対象画素を選択する工程であることを要旨とする。
Further, the first image processing method of the present invention corresponding to the first image processing apparatus is as follows.
Receiving image data in which a gradation value is associated with each of a plurality of pixels arranged two-dimensionally, comparing the gradation value of each pixel with a predetermined threshold value and determining whether or not a dot is formed An image processing method for converting the image data into data in an expression format depending on whether or not dots are formed by converting a raster as a row of dots into a dot row,
A first step of preliminarily storing a threshold value matrix in which a plurality of the threshold values are two-dimensionally arranged;
A second step of selecting a target pixel for determining whether or not to form a dot;
A third step of determining the presence or absence of dot formation for the target pixel by reading out the threshold corresponding to the target pixel from the threshold matrix and comparing it with the gradation value associated with the target pixel And
In the second step, predetermined N (N is an integer of 2 or more) adjacent rasters are grouped as a raster group, and each pixel included in the raster group is sequentially selected according to a predetermined order, The gist is that the target pixel is selected from the N rasters in parallel.

かかる第1の画像処理装置および画像処理方法においては、順次選択した対象画素についてドット形成の有無を判断することにより、ラスタをドット列に変換していく。対象画素の選択に際しては、互いに隣接する所定のN本(Nは2以上の整数)のラスタをラスタ群としてまとめ、該ラスタ群に含まれる各画素を所定の順番に従って順次選択することにより、該N本のラスタを並行させながら各ラスタから対象画素を選択する。その結果、ラスタをN本ずつ並行してドット列に変換しながら、画像データをドットの形成有無による表現形式のデータに変換する。こうしてN本のラスタを並行してドット列に変換することとすれば、次の様な理由から迅速に変換することが可能となる。   In the first image processing apparatus and image processing method, the raster is converted into a dot row by determining the presence or absence of dot formation for sequentially selected target pixels. When selecting the target pixel, the predetermined N adjacent (N is an integer of 2 or more) rasters are grouped into a raster group, and each pixel included in the raster group is sequentially selected according to a predetermined order. The target pixel is selected from each raster while N rasters are arranged in parallel. As a result, the image data is converted into data in an expression format depending on whether or not dots are formed, while converting the rasters N by dot into parallel. If N rasters are converted into dot rows in parallel in this way, the conversion can be performed quickly for the following reason.

一般に画像データは、近傍の画素間では、近似した階調値が対応付けられる傾向がある。また、隣接する複数の画素には同じ階調値が対応付けられていることも少なくない。従って、画像処理装置を用いてこのような画像データを変換する場合、画像処理装置に内蔵されたCPUのキャッシュメモリを利用することで、迅速に変換することが可能である。ここでキャッシュメモリとは、CPUの直ぐ下の記憶階層に設けられた高速に読み書き可能なメモリである。CPUは内部で実行コードを次々に生成しながら処理を進めるとともに、生成した実行コードをキャッシュメモリに一時的に蓄えている。連続して処理する画素の階調値が近似していれば、先の画素の処理に使用されてキャッシュメモリ内に残っている実行コードをそのまま使用可能な場合が多くなる。キャッシュメモリ内の実行コードを使用すれば新たに実行コードを生成する必要がないので、その分だけ処理を迅速に行うことが可能である。   In general, image data tends to be associated with approximate gradation values between neighboring pixels. Further, the same gradation value is often associated with a plurality of adjacent pixels. Therefore, when converting such image data using an image processing apparatus, it is possible to convert the image data quickly by using a cache memory of a CPU built in the image processing apparatus. Here, the cache memory is a high-speed readable / writable memory provided in a storage hierarchy immediately below the CPU. The CPU advances the process while generating the execution code one after another inside, and temporarily stores the generated execution code in the cache memory. If the gradation values of pixels to be continuously processed are approximate, there are many cases where the execution code used in the processing of the previous pixel and remaining in the cache memory can be used as it is. If the execution code in the cache memory is used, there is no need to newly generate an execution code, so that it is possible to perform the processing as quickly as that.

ここで、画素は二次元的に配列されているから、いずれの方向に近接する画素にも、同じように近似した階調値が対応付けられると考えられる。すなわち、ある画素に着目した場合、その画素の左右方向に近接する画素だけでなく、上下方向、あるいは斜め方向に近接する画素にも、近似した階調値が対応付けられていると考えられる。従って、ラスタを1本ずつ処理するのではなく、複数のラスタを並行して処理すれば、左右方向だけでなく縦方向あるいは斜め方向に存在する階調値の近似した画素についても連続して処理することができる。その結果、キャッシュメモリ内に残っている実行コードを効率よく使用することができるので、それだけ処理を迅速に行うことが可能となるのである。   Here, since the pixels are two-dimensionally arranged, it is considered that the gradation values that are similarly approximated are associated with pixels that are adjacent in any direction. That is, when attention is paid to a certain pixel, it is considered that the approximate gradation value is associated not only with the pixel adjacent to the pixel in the horizontal direction but also with the pixel adjacent in the vertical direction or diagonal direction. Therefore, if a plurality of rasters are processed in parallel, rather than processing rasters one by one, continuous processing is performed not only in the left-right direction but also in pixels with approximate gradation values that exist in the vertical or diagonal direction. can do. As a result, the execution code remaining in the cache memory can be used efficiently, so that it is possible to perform the processing more quickly.

また、近年では、内部でパイプライン処理を行う種々のCPUが開発され多数使用されている。また、パイプライン処理を更に効率よく行うために分岐予測を行うCPUも種々開発されて多数使用されている。パイプライン処理とは次のような処理である。CPUは、プログラムに記述された個々の命令を実行するに際して、次のようにいくつかの手順に分けて実行する。先ず、(1)命令を読み込んで、(2)読み込んだ命令を解釈し、(3)解釈した内容を実行して、(4)得られた結果を返すというように、1つの命令を最低でも4つの手順に分けて実行する。パイプライン処理とは、CPU内にこれらの手順に対応した専用のユニットを設けることで、1つの命令を流れ作業的に実行する処理である。例えば、読み込んだ命令を解釈している間に次の命令を読み込んでおき、解釈した命令を実行している間に次の命令を解釈しておく。もちろん、次の命令を解釈している間にその次の命令を読み込んでおけばよい。こうして流れ作業的に処理を進めていけば、極めて迅速に命令を実行することができる。   In recent years, various CPUs that internally perform pipeline processing have been developed and used. Various CPUs that perform branch prediction have been developed and used in order to perform pipeline processing more efficiently. Pipeline processing is the following processing. When the CPU executes individual instructions described in the program, the CPU executes it in several steps as follows. First, at least one instruction is read, such as (1) reading an instruction, (2) interpreting the read instruction, (3) executing the interpreted content, and (4) returning the obtained result. The process is divided into four steps. Pipeline processing is processing in which a dedicated unit corresponding to these procedures is provided in the CPU, so that one instruction flows and is executed in a work manner. For example, the next instruction is read while the read instruction is being interpreted, and the next instruction is interpreted while the interpreted instruction is being executed. Of course, the next command may be read while the next command is being interpreted. In this way, if the processing is carried out in a flow manner, the command can be executed very quickly.

パイプライン処理では、分岐命令を実行した場合、次の命令を解釈したことやその次の命令を読み込んだことが無駄になってしまうので、処理速度が低下してしまう。しかし、連続して処理する画素の階調値が近似していれば、それら画素については同様の処理が繰り返し実行され、従って、処理を切り替えるための分岐が発生する可能性が少なくなる。このため、画像処理を迅速に行うことが可能となる。   In the pipeline processing, when a branch instruction is executed, it is useless to interpret the next instruction or read the next instruction, so that the processing speed decreases. However, if the gradation values of pixels to be continuously processed are approximated, the same processing is repeatedly executed for those pixels, and therefore, the possibility that a branch for switching the processing will occur is reduced. For this reason, it is possible to perform image processing quickly.

更に、例え、ある画素の処理中に分岐命令が発生したとしても、連続して処理する画素の階調値が近似していれば、続く画素の処理中でも同様に分岐命令が発生すると考えられるので、分岐命令は一定のパターンに従って発生することになる。この様な場合は、分岐命令の発生を高い的中率で予測することができるので、続いて行う命令を読み出して解釈する作業が無駄になることを回避して、より一層の高速処理が可能となる。   Furthermore, even if a branch instruction is generated during the processing of a certain pixel, it is considered that a branch instruction is generated during the processing of subsequent pixels as long as the gradation values of pixels to be continuously processed are approximate. The branch instruction is generated according to a certain pattern. In such a case, it is possible to predict the occurrence of a branch instruction at a high hit rate, so that the work of reading and interpreting the subsequent instruction is avoided and higher speed processing is possible. It becomes.

このことから、複数のラスタを並行して処理することとすれば、二次元的に隣接した階調値の近似する画素を連続して処理することができるので、ラスタ1本ずつ処理した場合よりもパイプライン処理の効率を向上させ、更に分岐予測の的中率を向上させることができる。その結果、画像データをドットの形成有無により表現されたデータに迅速に変換することが可能となる。   For this reason, if a plurality of rasters are processed in parallel, pixels that are two-dimensionally adjacent and approximate to gradation values can be processed in succession. In addition, the efficiency of pipeline processing can be improved, and the accuracy of branch prediction can be further improved. As a result, it is possible to quickly convert the image data into data expressed by the presence or absence of dot formation.

こうした画像処理装置においては、M行(Mは前記Nの正の倍数)×L列(Lは2以上の整数)のマトリックス状に前記複数の閾値を記憶しておくこととしても良い。   In such an image processing apparatus, the plurality of threshold values may be stored in a matrix of M rows (M is a positive multiple of N) × L columns (L is an integer of 2 or more).

閾値マトリックスをこの様なサイズにしておけば、画像データを前記N本ずつのラスタからなるラスタ群に区分したときに、1つのラスタ群に含まれるラスタは、常に同じ閾値マトリックスに対応付けることができる。換言すれば、画像データに閾値マトリックスを対応付けたときに、ラスタ群を構成するラスタ間に、閾値マトリックスの境界が来ることがない。このため、対象画素に対応する閾値を閾値マトリックスの中から読み出す処理が複雑となることを回避して、画像処理の高速化を図ることが可能となる。   If the threshold value matrix is set to such a size, when the image data is divided into raster groups each including the N rasters, rasters included in one raster group can always be associated with the same threshold matrix. . In other words, when the threshold matrix is associated with the image data, there is no threshold matrix boundary between the rasters constituting the raster group. For this reason, it is possible to increase the speed of image processing while avoiding complicated processing for reading out the threshold value corresponding to the target pixel from the threshold value matrix.

上述したこれら画像処理装置あるいは画像処理方法においては、次のようにして閾値マトリックスの各閾値を記憶することとしても良い。先ず、マトリックス状に配列された複数の閾値を、前記N行ずつ複数のグループにまとめる。そして、各グループ内では、前記対象画素選択手段が前記対象画素を選択する前記所定の順番に従って、該複数の閾値を記憶する。   In these image processing apparatuses or image processing methods described above, the threshold values of the threshold matrix may be stored as follows. First, a plurality of threshold values arranged in a matrix are grouped into a plurality of groups by the N rows. In each group, the target pixel selection unit stores the plurality of threshold values in the predetermined order in which the target pixel is selected.

こうすれば、ラスタ群を構成するN本のラスタから対象画素を選択する順序に合わせて、閾値マトリックスの各閾値を記憶することができる。その結果、対象画素についての画像データの階調値と、該対象画素に対応する閾値とを読み出してドット形成の有無を判断する際に、閾値に関しては記憶されている順番に従って読み出せばよい。従って、処理が簡素なものとなり、処理速度の向上を図ることが可能となる。尚、ここに言う「対象画素選択手段が対象画素を選択する所定の順番に従って、複数の閾値を記憶する」とは、対象画素が選択される順序と複数の閾値を記憶する順序とが完全に一致するものに限らず、順序が多少食い違っているようなものも含まれる。すなわち、対象画素が選択される順序と閾値が記憶される順序とが多少ずれている程度であれば、対象画素に対応する閾値を閾値マトリックスから容易に見つけ出すことができ、従って、閾値を読み出す処理を簡素なものとすることができるからである。また、閾値マトリックスの各閾値を、このように対象画素を選択する順序に従って記憶しておけば、例え画像処理を行うCPUがキャッシュを内蔵していない場合や、パイプライン処理を行っていない場合であっても、処理速度を向上させることが可能となる。   In this way, each threshold value of the threshold value matrix can be stored in accordance with the order of selecting the target pixel from the N rasters constituting the raster group. As a result, when the gradation value of the image data for the target pixel and the threshold value corresponding to the target pixel are read to determine the presence / absence of dot formation, the threshold values may be read according to the stored order. Accordingly, the processing becomes simple and the processing speed can be improved. Note that “the target pixel selection means stores a plurality of thresholds according to a predetermined order in which the target pixels are selected” means that the order in which the target pixels are selected and the order in which the plurality of thresholds are stored are completely Not only those that match, but also those that are somewhat out of order. That is, as long as the order in which the target pixel is selected and the order in which the threshold value is stored are slightly different from each other, the threshold value corresponding to the target pixel can be easily found from the threshold value matrix. It is because it can be made simple. Further, if each threshold value of the threshold value matrix is stored in accordance with the order of selecting the target pixels in this way, for example, when the CPU that performs image processing does not have a built-in cache or when pipeline processing is not performed. Even if it exists, it becomes possible to improve a processing speed.

かかる画像処理装置においては、次のようにして前記対象画素を選択することとしても良い。前記ラスタ群に含まれる複数の画素を、縦横それぞれ所定画素数ずつの複数のブロックにまとめ、該ブロック内の各画素から前記対象画素を順次選択する。   In such an image processing apparatus, the target pixel may be selected as follows. A plurality of pixels included in the raster group are grouped into a plurality of blocks each having a predetermined number of pixels in the vertical and horizontal directions, and the target pixel is sequentially selected from each pixel in the block.

こうすれば、ブロック内の各画素から対象画素を選択する処理を繰り返し行うことで、ラスタ群を構成する画素から対象画素を順次選択することができる。その結果、処理を単純なものとすることができ、延いては画像処理の速度を向上させることができる。   By doing this, it is possible to sequentially select the target pixels from the pixels constituting the raster group by repeatedly performing the process of selecting the target pixels from each pixel in the block. As a result, the processing can be simplified, and the image processing speed can be improved.

また、かかるブロックは、特に縦横N画素ずつの複数の画素をまとめたブロックとすることもできる。この場合、ブロックをラスタの方向に順次移動させるだけで、ラスタ群を構成する画素から対象画素を順次選択することができるので、処理を更に単純なものとすることができる。   In addition, such a block may be a block in which a plurality of pixels each having N pixels in length and width are combined. In this case, the target pixel can be sequentially selected from the pixels constituting the raster group simply by moving the block sequentially in the raster direction, so that the processing can be further simplified.

こうしたブロックは、特に縦横2画素ずつ合計4画素をまとめたブロックとすることができる。縦横2画素ずつのブロックは画素数が小さいので、処理が複雑とならず、画像処理速度を効果的に向上させることができるので好適である。   Such a block can be a block in which a total of 4 pixels, particularly 2 pixels vertically and horizontally, are combined. Since each block of 2 pixels in the vertical and horizontal directions has a small number of pixels, the processing is not complicated, and the image processing speed can be effectively improved, which is preferable.

あるいは、縦横8画素ずつ合計64画素をまとめてブロックとすることもできる。例えば、JPEG形式で圧縮された画像データを解凍すると、8画素×8画素をひとまとまりとして、各画素の階調値のデータに展開される。従って、縦横8画素ずつのブロックを構成し、かかるブロックの中から対象画素を選択すれば、展開された階調値を並べ換えることなく、そのままの順序で、画像処理を行うことができるので、処理を高速化することができる。   Alternatively, a total of 64 pixels of 8 pixels in the vertical and horizontal directions can be combined into a block. For example, when image data compressed in the JPEG format is decompressed, 8 pixels × 8 pixels are grouped and developed into gradation value data of each pixel. Therefore, by configuring a block of 8 pixels in length and width and selecting a target pixel from such a block, image processing can be performed in the same order without rearranging the developed gradation values. Processing can be speeded up.

上述した画像処理装置あるいは画像処理方法においては、次のようにして、対象画素についてのドット形成有無を判断することとしても良い。先ず、画像データの二次元的な画素の配列よりも小さなサイズの配列を、前記閾値マトリックスとして記憶しておく。そして、該閾値マトリックスを、前記画像データに対して縦横の方眼状に配置した状態から、前記ラスタの方向と交差する方向にK画素(Kは前記Nの正の倍数)ずつずらしながら配置した状態で対応付け、画像データ上に対応付けられた該閾値マトリックスから、対象画素に対応する位置に記憶されている閾値を読み出す。こうして読み出した閾値と、対象画素の階調値とを比較することにより、ドット形成有無を判断することとしてもよい。   In the above-described image processing apparatus or image processing method, the presence / absence of dot formation for the target pixel may be determined as follows. First, an array having a size smaller than the two-dimensional pixel array of the image data is stored as the threshold value matrix. Then, the threshold value matrix is arranged by shifting K pixels (K is a positive multiple of N) in a direction intersecting the raster direction from a state in which the threshold value matrix is arranged in a vertical and horizontal grid shape with respect to the image data. And the threshold value stored in the position corresponding to the target pixel is read out from the threshold value matrix associated with the image data. The presence / absence of dot formation may be determined by comparing the threshold value thus read out with the gradation value of the target pixel.

こうして、閾値マトリックスを少しずつずらしながら画像データに対応付けてやれば、ラスタ方向に同じ閾値が繰り返し使用されて、ドットの形成され方が一定のパターンで繰り返されることを回避することができる。また、閾値マトリックスのずらし量を、ラスタの方向と交差する方向にK画素(Kは前記Nの正の倍数)としておけば、画像データに閾値マトリックスを対応付けたときに、ラスタ群を構成するラスタ間に、閾値マトリックスの境界が来ることがない。このため、対象画素に対応する閾値を閾値マトリックスの中から読み出す処理が複雑となることを回避して、画像処理の高速化を図ることが可能となる。   In this way, if the threshold value matrix is associated with the image data while being shifted little by little, it is possible to avoid the same threshold value being repeatedly used in the raster direction and repeating the formation of dots in a certain pattern. Further, if the shift amount of the threshold matrix is set to K pixels (K is a positive multiple of N) in a direction crossing the raster direction, a raster group is formed when the threshold matrix is associated with image data. There is no threshold matrix boundary between rasters. For this reason, it is possible to increase the speed of image processing while avoiding complicated processing for reading out the threshold value corresponding to the target pixel from the threshold value matrix.

このように閾値マトリックスをずらしながら画像データに対応付ける場合には、ずらし量を特に、ラスタ群を構成するラスタ本数と同じ値としてもよい。詳細には後述するが、こうすれば、閾値マトリックスの各閾値を読み出す処理を簡素なものとすることが可能となるので好ましい。   When the threshold value matrix is thus shifted and associated with the image data, the shift amount may be set to the same value as the number of rasters constituting the raster group. As will be described in detail later, this is preferable because the process of reading out each threshold value of the threshold value matrix can be simplified.

また、前述した課題の少なくとも一部を解決するため、本発明の第2の画像処理装置は、次の構成を採用した。すなわち、
二次元的に配列された複数の画素の各々に所定の複数色の階調値を対応付けたカラー画像データを受け取り、各画素についてのドット形成の有無を各色成分毎に判断しながら、画素の列たるラスタをドット列に変換することによって、該カラー画像データをドットの形成有無による表現形式の各色のデータに変換する画像処理装置であって、
互いに隣接する所定のN本(Nは2以上の整数)のラスタをまとめてラスタ群を生成するラスタ群生成手段と、
前記各色成分の中から予め選択された第1の色成分の画像データについては、各画素の前記階調値と各画素に対応付けられた所定の閾値とを比較しながら、前記ラスタ群を構成する前記N本のラスタを並行してドット列に変換することにより、ドットの形成有無による表現形式のデータに変換する第1のデータ変換手段と、
前記各色成分から前記第1の色成分を除いた第2の色成分の画像データについては、ドット形成の有無を判断したことで判断した画素で生じた階調誤差を周辺の未判断画素に拡散するとともに、周辺の判断済みの画素から拡散されてきた階調誤差を解消するようにドット形成の有無を判断しながら、前記ラスタ群を構成する前記N本のラスタを並行してドット列に変換することにより、ドットの形成有無による表現形式のデータに変換する第2のデータ変換手段と
を備えることを要旨とする。
In order to solve at least a part of the problems described above, the second image processing apparatus of the present invention employs the following configuration. That is,
Receiving color image data in which gradation values of a plurality of predetermined colors are associated with each of a plurality of pixels arranged two-dimensionally, and determining the presence or absence of dot formation for each pixel for each color component, An image processing apparatus that converts color image data into data of each color in an expression format depending on whether or not dots are formed by converting a raster line to a dot line,
Raster group generating means for generating a raster group by combining predetermined N (N is an integer of 2 or more) adjacent rasters;
For the image data of the first color component selected in advance from the color components, the raster group is configured by comparing the gradation value of each pixel with a predetermined threshold value associated with each pixel. First data conversion means for converting the N rasters to dot rows in parallel, thereby converting the data into an expression format depending on whether or not dots are formed;
For the image data of the second color component obtained by removing the first color component from each color component, the gradation error caused by the pixel determined by determining the presence / absence of dot formation is diffused to surrounding undetermined pixels. At the same time, the N rasters constituting the raster group are converted into dot rows in parallel while judging the presence / absence of dot formation so as to eliminate the gradation error diffused from the surrounding judged pixels. And a second data conversion means for converting the data into an expression format data based on the presence or absence of dot formation.

かかる第2の画像処理装置に対応する本発明の第2の画像処理方法は、
二次元的に配列された複数の画素の各々に所定の複数色の階調値を対応付けたカラー画像データを受け取り、各画素についてのドット形成の有無を各色成分毎に判断しながら、画素の列たるラスタをドット列に変換することによって、該カラー画像データをドットの形成有無による表現形式の各色のデータに変換する画像処理方法であって、
前記受け取ったカラー画像データを、前記各色成分の中から予め選択された第1の色成分の画像データと、該第1の色成分を除いた第2の色成分の画像データとに分離する工程と、
前記第1の色成分の画像データについては、各画素の前記階調値と各画素に対応付けられた所定の閾値とを比較しながら、隣接する前記ラスタを所定のN本(Nは2以上の整数)ずつ並行してドット列に変換することにより、ドットの形成有無による表現形式のデータに変換する工程と、
前記第2の色成分の画像データについては、ドット形成の有無を判断したことで判断した画素で生じた階調誤差を周辺の未判断画素に拡散するとともに、周辺の判断済みの画素から拡散されてきた階調誤差を解消するようにドット形成の有無を判断しながら、隣接するラスタを前記N本ずつ並行してドット列に変換することにより、ドットの形成有無による表現形式のデータに変換する工程と
を備えることを要旨とする。
The second image processing method of the present invention corresponding to the second image processing apparatus is as follows.
Receiving color image data in which gradation values of a plurality of predetermined colors are associated with each of a plurality of pixels arranged two-dimensionally, and determining the presence or absence of dot formation for each pixel for each color component, An image processing method for converting color image data into data of each color in an expression format depending on the presence or absence of dot formation by converting a raster that is a row into a dot row,
Separating the received color image data into image data of a first color component preselected from the color components and image data of a second color component excluding the first color component; When,
For the image data of the first color component, a predetermined number of adjacent rasters (N is 2 or more) are compared while comparing the gradation value of each pixel with a predetermined threshold value associated with each pixel. A step of converting the data into an expression format according to the presence or absence of dot formation,
As for the image data of the second color component, the gradation error generated in the pixel determined by determining the presence / absence of dot formation is diffused to the surrounding undetermined pixels and diffused from the surrounding determined pixels. By converting the adjacent rasters into dot rows in parallel while determining the presence / absence of dot formation so as to eliminate the tone error, the data is converted into data in an expression format according to the presence / absence of dot formation. The gist is to provide a process.

かかる第2の画像処理装置および画像処理方法においては、カラー画像データに含まれる所定の複数色の画像データの中、第1の色成分の画像データについては、各画素の階調値と各画素に対応付けられた所定の閾値とを比較しながら、N本のラスタを並行してドット列に変換する。また、第2の色成分の画像データについては、ドット形成の有無を判断したことにより生じた階調誤差を周辺の未判断画素に拡散しながら、N本のラスタを並行してドット列に変換していく。   In the second image processing apparatus and the image processing method, the gradation value of each pixel and each pixel of the image data of the first color component among the predetermined multiple color image data included in the color image data. N rasters are converted into dot rows in parallel while comparing with a predetermined threshold value associated with. For the image data of the second color component, N rasters are converted into dot rows in parallel while diffusing gradation errors caused by determining the presence or absence of dot formation to surrounding undetermined pixels. I will do it.

前述したように、画像データは、近傍の画素には近似した階調値が対応付けられていることが多いので、こうして、N本のラスタを並行してドット列に変換していけば、キャッシュのヒット率や、パイプライン処理の効率、分岐予測の的中率が向上し、その結果、画像データを迅速に変換することができる。また、第1の色成分の画像データも、第2の色成分の画像データも、ともにラスタN本ずつ並行して処理することとすれば、これらの色成分の画像データを並行してドット列に変換することができるので、処理を不必要に複雑化させることがないので好ましい。   As described above, image data often has an approximate gradation value associated with a neighboring pixel. Therefore, if N rasters are converted into dot rows in parallel in this way, cache data is cached. The hit rate, the efficiency of pipeline processing, and the hit prediction accuracy are improved. As a result, image data can be converted quickly. If both the image data of the first color component and the image data of the second color component are processed in parallel for each of N rasters, the image data of these color components is converted into a dot row in parallel. It is preferable that the processing is not unnecessarily complicated.

カラー画像データを扱うこうした第2の画像処理装置においては、第1の色成分の画像データを次のようにして変換することとしても良い。複数の閾値を二次元的に配列された閾値マトリックスに予め記憶しておく。そして、画像データを構成する複数のラスタの中から、互いに隣接するN本のラスタをラスタ群としてまとめ、該ラスタ群に含まれる各画素を所定の順番に従って順次選択することにより、該N本のラスタから並行して対象画素を選択する。こうして選択した対象画素に対応付けられた階調値と該画素に対応する閾値とを閾値マトリックスの中から読み出して、これらを比較することにより、対象画素についてのドット形成有無を判断する。   In such a second image processing apparatus that handles color image data, the image data of the first color component may be converted as follows. A plurality of threshold values are stored in advance in a two-dimensionally arranged threshold value matrix. Then, N rasters adjacent to each other from a plurality of rasters constituting the image data are collected as a raster group, and each pixel included in the raster group is sequentially selected in a predetermined order, whereby the N rasters are selected. The target pixel is selected in parallel from the raster. The gradation value associated with the selected target pixel and the threshold value corresponding to the pixel are read out from the threshold matrix and compared with each other to determine whether or not dots are formed for the target pixel.

こうすれば、N本のラスタを並行してドット列に変換しながら、第1の色成分の画像データをドット形成有無により表現されたデータに、迅速に変換することができる。   In this way, it is possible to quickly convert the image data of the first color component into data expressed by the presence or absence of dot formation while converting N rasters into dot rows in parallel.

かかる画像処理装置においては、前記閾値マトリックスの閾値を、N行ずつの複数のグループにまとめて、該グループ内では、対象画素を選択する所定の順番に従って記憶しておくこととしてもよい。   In such an image processing apparatus, the threshold values of the threshold matrix may be grouped into a plurality of groups of N rows and stored in a predetermined order in which the target pixels are selected in the group.

この様に閾値マトリックスの閾値を記憶しておけば、対象画素についての画像データの階調値と、該対象画素に対応する閾値とを読み出してドット形成の有無を判断する際に、閾値に関しては記憶されている順番通りに読み出せばよい。従って、処理を簡素なものとすることができるので好ましい。また、閾値マトリックスの各閾値を、こうして対象画素を選択する順番に従って記憶しておけば、画像処理を行うCPUがキャッシュを内蔵しておらず、あるいはパイプライン処理を行っていない場合であっても、処理を高速化することが可能になるという利点も得られる。   If threshold values in the threshold matrix are stored in this way, when the tone value of the image data for the target pixel and the threshold value corresponding to the target pixel are read to determine the presence or absence of dot formation, It may be read out in the order stored. Therefore, it is preferable because the processing can be simplified. Further, if each threshold value in the threshold value matrix is stored in accordance with the order in which the target pixels are selected in this way, even if the CPU that performs image processing does not have a built-in cache or does not perform pipeline processing. The advantage that the processing can be speeded up is also obtained.

また、対象画素は次のようにして選択してもよい。すなわち、ラスタ群に含まれる複数の画素を、縦横それぞれ所定画素数ずつの複数のブロックにまとめて、該ブロック内の各画素から対象画素を順次選択することとしてもよい。   The target pixel may be selected as follows. That is, a plurality of pixels included in a raster group may be combined into a plurality of blocks each having a predetermined number of pixels in the vertical and horizontal directions, and target pixels may be sequentially selected from the respective pixels in the block.

こうすれば、ブロック内の各画素から対象画素を選択する処理を繰り返し行うことで、ラスタ群を構成する画素から対象画素を順次選択することができる。その結果、処理を単純なものとすることができるので好ましい。   By doing this, it is possible to sequentially select the target pixels from the pixels constituting the raster group by repeatedly performing the process of selecting the target pixels from each pixel in the block. As a result, the processing can be simplified, which is preferable.

上述した第2の画像処理装置においては、第2の色成分の画像データを次のようにして変換してもよい。先ず、互いに隣接した前記N本のラスタをまとめてラスタ群を生成する。そして、該ラスタ群の最後尾にある最後尾ラスタをドット列に変換し、各画素で生じた階調誤差を周辺の未判断画素に拡散する。また、最後尾ラスタに隣接したラスタ群の先頭にある先頭ラスタをドット列に変換し、各画素で生じた階調誤差を周辺の未判断画素に拡散する。更に、ラスタ群から先頭ラスタを除いた残余ラスタについては、該残余ラスタと同じラスタ群に属し且つドット形成有無を判断済みの画素から拡散された前記階調誤差を考慮しながら該残余ラスタの各画素のドット形成有無を判断することにより、該先頭ラスタを前記ドット列に変換する処理に並行して該残余ラスタをドット列に変換する。そして、これら階調誤差の拡散に際しては、ドット形成の有無を判断した画素と同じラスタ群の画素に拡散する誤差と、異なるラスタ群の画素に拡散する誤差とを、異なる誤差記憶部に記憶する。こうして拡散した誤差を用いて、各ラスタをドット列に変換する。   In the above-described second image processing apparatus, the image data of the second color component may be converted as follows. First, a raster group is generated by collecting the N rasters adjacent to each other. Then, the last raster at the last of the raster group is converted into a dot row, and the gradation error generated in each pixel is diffused to surrounding undecided pixels. Further, the head raster at the head of the raster group adjacent to the last raster is converted into a dot row, and the gradation error generated in each pixel is diffused to surrounding undecided pixels. Further, with respect to the remaining raster obtained by removing the head raster from the raster group, each residual raster is considered in consideration of the gradation error diffused from pixels that belong to the same raster group as the remaining raster and for which dot formation has been determined. By determining the presence or absence of dot formation of the pixel, the remaining raster is converted into a dot row in parallel with the process of converting the leading raster into the dot row. When these gradation errors are diffused, the error diffused to the pixels of the same raster group as the pixel for which the presence / absence of dot formation is determined and the error diffused to the pixels of the different raster group are stored in different error storage units. . Each raster is converted into a dot row using the error thus diffused.

こうすれば、第1の色成分の画像データについてはディザ法を適用し、第2の色成分の画像データについては誤差拡散法を適用しながら、ラスタ群を構成する複数のラスタを並行してドット列に変換することができる。その結果、カラー画像データをドット形成の有無による表現形式の各色毎のデータに迅速に変換することが可能となる。   By doing so, the dither method is applied to the image data of the first color component, and the error diffusion method is applied to the image data of the second color component, and a plurality of rasters constituting the raster group are applied in parallel. Can be converted to a dot row. As a result, color image data can be quickly converted into data for each color in an expression format depending on whether or not dots are formed.

こうした第2の画像処理装置においては、第2の色成分の画像データを次のようにして変換しても良い。先ず、第2の色成分の画像データを、縦横それぞれ所定画素数ずつのブロックにまとめて、ラスタ群から複数のブロックを生成する。そして、ドットの形成有無の判断を該ブロック単位で行うことにより、ラスタ群を構成するN本のラスタを並行してドット列に変換することとしてもよい。   In such a second image processing apparatus, the image data of the second color component may be converted as follows. First, the image data of the second color component is collected into blocks each having a predetermined number of pixels in the vertical and horizontal directions, and a plurality of blocks are generated from the raster group. Then, it is also possible to convert the N rasters constituting the raster group into dot rows in parallel by determining whether or not dots are formed in units of blocks.

詳細には後述するが、こうしてブロック単位で処理すれば、第2の色成分の画像データについてもドット形成有無の判断を迅速に行うことができ、延いては画像データを迅速に変換することが可能となる。   As will be described in detail later, if processing is performed in units of blocks in this way, it is possible to quickly determine the presence or absence of dot formation for the image data of the second color component, and thus to quickly convert the image data. It becomes possible.

上述した第2の画像処理装置が扱うカラー画像データが、少なくともシアン色、マゼンタ色、イエロ色を含んだ複数色の画像データから構成されたデータである場合は、少なくともイエロ色の画像データは前記第1の色成分の画像データとして変換しても良い。   When the color image data handled by the second image processing apparatus described above is data composed of image data of a plurality of colors including at least cyan, magenta, and yellow, at least the image data of yellow is You may convert as image data of a 1st color component.

イエロ色の画像データは、データの変換精度が多少悪化しても、画質に対する影響が比較的少ないので、イエロ色の画像データを前記第1の色成分の画像データとして変換すれば、画質を悪化させることなくカラー画像データを迅速に変換することが可能となる。   The yellow color image data has a relatively small influence on the image quality even if the data conversion accuracy is somewhat deteriorated. Therefore, if the yellow color image data is converted as the image data of the first color component, the image quality is deteriorated. It is possible to quickly convert the color image data without causing it.

また、カラー画像データを扱うこうした第2の画像処理装置においては、少なくともシアン色あるいはマゼンタ色の画像データについては、前記第2の色成分の画像データとして変換することとしても良い。   In such a second image processing apparatus that handles color image data, at least cyan or magenta image data may be converted as image data of the second color component.

シアン色あるいはマゼンタ色の画像データは、データの変換精度の悪化が、画質に比較的影響を与えやすい傾向にあるので、これらの画像データを前記第2の色成分の画像データとして変換すれば、画質を悪化させることなくカラー画像データを変換することができる。   Since cyan or magenta color image data tends to have a relatively easy influence on image quality due to deterioration in data conversion accuracy, if these image data are converted as image data of the second color component, Color image data can be converted without deteriorating the image quality.

また、カラー画像データにブラック色の画像データが含まれている場合には、ブラック色の画像データを前記第2の色成分の画像データとして変換することとしても良い。   Further, when the color image data includes black image data, the black image data may be converted as the image data of the second color component.

ブラック色の画像データも、シアン色あるいはマゼンタ色の画像データと同様に、変換精度の悪化が、画質に比較的影響を与え易い。従って、ブラック色の画像データを前記第2の色成分の画像データとして変換すれば、画質を悪化させることなくカラー画像データを変換することができる。   In black image data, as in the case of cyan or magenta image data, deterioration in conversion accuracy is relatively likely to affect the image quality. Therefore, if the black image data is converted as the image data of the second color component, the color image data can be converted without deteriorating the image quality.

更には、カラー画像データに、色相が略同一で濃度が異なる濃淡一組の色の画像データが含まれている場合には、これら一組の色の一方の画像データについては、前記第1の色成分の画像データとして変換し、一組の色の他方の画像データについては、前記第2の色成分の画像データとして変換することとしてもよい。例えば、カラー画像データ中に、シアン色と濃度の薄いシアン色たる淡シアン色とからなる一組の色についての画像データが含まれている場合は、次のようにして変換する。すなわち、シアン色の画像データを第1の色成分として変換した場合は、淡シアン色の画像データは第2の色成分として変換し、逆に、シアン色の画像データを第2の色成分として変換した場合は、淡シアン色の画像データは第1の色成分として変換する。またカラー画像データ中に、マゼンタ色と濃度の薄いマゼンタ色たる淡マゼンタ色の一組の色についての画像データが含まれている場合についても同様に、一方を第1の色成分の画像データとして変換した場合は、他方を第2の色成分の画像データとして変換する。   Further, when the color image data includes image data of a set of shades having substantially the same hue and different densities, the first image data of the set of colors is the first image data. The image data of the color component may be converted, and the other image data of the set of colors may be converted as the image data of the second color component. For example, when the color image data includes image data for a set of colors consisting of a cyan color and a light cyan color, which is a light cyan color, the conversion is performed as follows. That is, when cyan image data is converted as the first color component, light cyan image data is converted as the second color component, and conversely, cyan image data is converted as the second color component. When converted, the light cyan image data is converted as the first color component. Similarly, when the color image data includes image data for a set of light magenta colors, which are magenta and light magenta, the other is used as image data of the first color component. If converted, the other is converted as image data of the second color component.

一般に、カラー画像データ中に色相が略同一で濃度の異なる一組の色の画像データが含まれている場合、これら濃淡の画像データが画質に与える影響の大きさは互いに異なっており、一方が画質への影響が大きい場合には他方は画質への影響が少ない関係にある。経験上、これら一組の色の濃淡差が大きい場合には、濃い色の画像データが画質に与える影響が大きく、逆に一組の色の濃度差が小さい場合には、淡い色の画像データが画質に与える影響が大きくなることが知られている。従って、これら濃淡一組の色の画像データの中、画質に与える影響の少ない方の画像データを第1の色成分の画像データとして変換し、画質に与える影響の大きい方の画像データを第2の画像データとして変換すれば、画質を悪化させることなくカラー画像データを迅速に変換することができる。   In general, when color image data includes a set of color image data having substantially the same hue and different densities, the magnitudes of the effects of these shaded image data on the image quality are different from each other. When the influence on the image quality is large, the other is in a relation that the influence on the image quality is small. Experience shows that when the density difference between these sets of colors is large, the image data of dark colors has a large effect on image quality. Conversely, when the density differences between sets of colors are small, the image data of pale colors It is known that the influence on the image quality increases. Accordingly, image data having a smaller influence on image quality is converted as image data of the first color component, and image data having a larger influence on image quality is converted into the second image data. If the image data is converted, the color image data can be quickly converted without deteriorating the image quality.

また、上述した第1の画像処理装置および第2の画像処理装置はいずれも、印刷媒体上にドットを形成して画像を表現する印刷装置に、好適に適用することができる。   In addition, both the first image processing apparatus and the second image processing apparatus described above can be suitably applied to a printing apparatus that forms an image by forming dots on a print medium.

すなわち、上述した第1の画像処理装置あるいは第2の画像処理装置においては、二次元的に配列された複数の画素の各々に階調値が対応付けられた画像データを受け取り、該画像データに所定の画像処理を施すことによって、ドット形成の有無による表現形式にデータに変換する。そして変換に際しては、複数のラスタを並行してドット列に変換することで、画像データを迅速に変換することができる。従って、これら第1の画像処理装置、あるいは第2の画像処理装置を適用して画像データに画像処理を施せば、画像データをドット形成の有無による表現形式のデータに迅速に変換することができ、延いては画像を迅速に印刷することが可能となる。   That is, in the first image processing apparatus or the second image processing apparatus described above, image data in which a gradation value is associated with each of a plurality of pixels arranged two-dimensionally is received, and the image data is included in the image data. By performing predetermined image processing, data is converted into an expression format depending on the presence or absence of dot formation. In conversion, the image data can be quickly converted by converting a plurality of rasters into dot rows in parallel. Therefore, if image processing is performed on the image data by applying the first image processing apparatus or the second image processing apparatus, the image data can be quickly converted into data in an expression format based on the presence or absence of dot formation. As a result, the image can be printed quickly.

また、本発明は、上述した第1の画像処理方法、あるいは第2の画像処理方法を実現するプログラムをコンピュータに読み込ませ、コンピュータを用いて実現することも可能である。従って、本発明は次のようなコンピュータプログラムとしての態様も含んでいる。すなわち、上述の第1の画像処理方法に対応するプログラムは、
二次元的に配列された複数の画素の各々に階調値を対応付けた画像データを受け取り、各画素の階調値と所定の閾値とを比較してドットの形成有無を判断しながら該画素の列たるラスタをドット列に変換することによって、該画像データをドットの形成有無による表現形式のデータに変換する方法をコンピュータを用いて実現するためのプログラムであって、
複数の前記閾値が二次元的に配列された閾値マトリックスを予め記憶しておく第1の機能と、
ドットの形成有無の判断を行う対象画素を選択する第2の機能と、
前記対象画素に対応する閾値を前記閾値マトリックスの中から読み出して、該対象画素に対応付けられた前記階調値と比較することにより、該対象画素についてのドット形成有無を判断する第3の機能と
を備え、
前記第2の機能は、互いに隣接する所定のN本(Nは2以上の整数)の前記ラスタをラスタ群としてまとめ、該ラスタ群に含まれる各画素を所定の順番に従って順次選択することにより、該N本の各ラスタから並行して前記対象画素を選択する機能であることを要旨とする。
The present invention can also be realized using a computer by causing a computer to read a program that realizes the first image processing method or the second image processing method described above. Therefore, the present invention includes the following aspects as a computer program. That is, the program corresponding to the first image processing method described above is
Receiving image data in which a gradation value is associated with each of a plurality of pixels arranged two-dimensionally, comparing the gradation value of each pixel with a predetermined threshold value and determining whether or not a dot is formed A program for realizing, using a computer, a method for converting the image data into data of an expression format depending on whether or not dots are formed by converting a raster as a row of dots into a dot row,
A first function for storing in advance a threshold matrix in which a plurality of the thresholds are two-dimensionally arranged;
A second function of selecting a target pixel for determining whether or not to form a dot;
A third function for reading out a threshold value corresponding to the target pixel from the threshold value matrix and comparing it with the gradation value corresponding to the target pixel, thereby determining whether or not dots are formed for the target pixel. And
The second function is to combine predetermined N adjacent rasters (N is an integer of 2 or more) as a raster group, and sequentially select each pixel included in the raster group according to a predetermined order, The gist of the present invention is to select the target pixel in parallel from the N rasters.

また、上述の第2の画像処理方法に対応するプログラムは、
二次元的に配列された複数の画素の各々に所定の複数色の階調値を対応付けたカラー画像データを受け取り、各画素についてのドット形成の有無を各色成分毎に判断しながら、画素の列たるラスタをドット列に変換することによって、該カラー画像データをドットの形成有無による表現形式の各色のデータに変換する方法をコンピュータを用いて実現するためのプログラムであって、
前記受け取ったカラー画像データを、前記各色成分の中から予め選択された第1の色成分の画像データと、該第1の色成分を除いた第2の色成分の画像データとに分離する機能と、
前記第1の色成分の画像データについては、各画素の前記階調値と各画素に対応付けられた所定の閾値とを比較しながら、隣接する前記ラスタを所定のN本(Nは2以上の整数)ずつ並行してドット列に変換することにより、ドットの形成有無による表現形式のデータに変換する機能と、
前記第2の色成分の画像データについては、ドット形成の有無を判断したことで判断した画素で生じた階調誤差を周辺の未判断画素に拡散するとともに、周辺の判断済みの画素から拡散されてきた階調誤差を解消するようにドット形成の有無を判断しながら、隣接するラスタを前記N本ずつ並行してドット列に変換することにより、ドットの形成有無による表現形式のデータに変換する機能と
を備えることを要旨とする。
A program corresponding to the second image processing method described above is
Receiving color image data in which gradation values of a plurality of predetermined colors are associated with each of a plurality of pixels arranged two-dimensionally, and determining the presence or absence of dot formation for each pixel for each color component, A program for realizing, by using a computer, a method for converting color image data into data of each color in an expression format depending on the presence or absence of dot formation by converting a raster that is a row into a dot row,
A function of separating the received color image data into image data of a first color component preselected from the color components and image data of a second color component excluding the first color component When,
For the image data of the first color component, a predetermined number of adjacent rasters (N is 2 or more) are compared while comparing the gradation value of each pixel with a predetermined threshold value associated with each pixel. A function that converts the data into an expression format based on the presence or absence of dot formation,
As for the image data of the second color component, the gradation error generated in the pixel determined by determining the presence / absence of dot formation is diffused to the surrounding undetermined pixels and diffused from the surrounding determined pixels. By converting the adjacent rasters into dot rows in parallel while determining the presence / absence of dot formation so as to eliminate the tone error, the data is converted into data in an expression format according to the presence / absence of dot formation. The gist is to provide a function.

これらのプログラムをコンピュータに読み込ませ、該コンピュータを用いて上述の各種機能を実現すれば、二次元的に配列された複数の画素に階調値を対応付けた画像データを、ドット形成の有無による表現形式のデータに迅速に変換することが可能となる。   If these programs are read by a computer and the various functions described above are realized by using the computer, image data in which gradation values are associated with a plurality of pixels arranged two-dimensionally is determined depending on whether or not dots are formed. It becomes possible to quickly convert the data into an expression format.

更には、これらのプログラムをコンピュータで読み取り可能に記録媒体上に記録しておき、これら記録媒体上のプログラムを読み込ませることで、コンピュータを用いて実現することも可能である。従って、本発明は上述したプログラムを、コンピュータで読み取り可能に記録した記録媒体としての態様を取ることも可能である。   Furthermore, these programs can be recorded on a recording medium so as to be readable by a computer, and the programs on the recording medium can be read to be realized using a computer. Therefore, the present invention can take the form of a recording medium in which the above-described program is recorded so as to be readable by a computer.

[発明の他の態様]
本発明は、次のような態様として把握することも可能である。すなわち、
二次元的に配列された複数の画素の各々に階調値を対応付けた画像データを受け取り、各画素の階調値と所定の閾値とを比較してドットの形成有無を判断しながら該画素の列たるラスタをドット列に変換することによって、該画像データをドットの形成有無による表現形式のデータに変換する画像処理装置であって、
複数の前記閾値が二次元的に配列された閾値マトリックスを記憶しておく閾値マトリックス記憶手段と、
ドットの形成有無の判断を行う対象画素を選択する対象画素選択手段と、
前記対象画素に対応する閾値を前記閾値マトリックスの中から読み出して、該対象画素に対応付けられた前記階調値と比較することにより、該対象画素についてのドット形成有無を判断するドット形成判断手段と
を備え、
前記対象画素選択手段は、互いに隣接する所定のN本(Nは2以上の整数)の前記ラスタをラスタ群としてまとめ、該ラスタ群に含まれる各画素を所定の順番に従って順次選択することにより、該N本の各ラスタから並行して前記対象画素を選択する手段であり、
前記ドット形成判断手段は、パイプライン処理を行いながら前記対象画素についてのドット形成有無を判断する手段である画像処理装置として把握することができる。
[Other aspects of the invention]
The present invention can also be understood as the following aspects. That is,
Receiving image data in which a gradation value is associated with each of a plurality of pixels arranged two-dimensionally, comparing the gradation value of each pixel with a predetermined threshold value and determining whether or not a dot is formed An image processing apparatus that converts the image data into data in an expression format depending on whether or not dots are formed by converting a raster as a row of dots into a dot row,
Threshold matrix storage means for storing a threshold matrix in which a plurality of the thresholds are two-dimensionally arranged;
Target pixel selection means for selecting a target pixel for determining whether or not to form a dot;
A dot formation determination unit that reads out a threshold value corresponding to the target pixel from the threshold value matrix and compares the threshold value with the gradation value corresponding to the target pixel, thereby determining whether or not the target pixel is formed. And
The target pixel selection means collects a predetermined N number of adjacent rasters (N is an integer of 2 or more) as a raster group, and sequentially selects each pixel included in the raster group according to a predetermined order, Means for selecting the target pixel in parallel from each of the N rasters;
The dot formation determination means can be grasped as an image processing apparatus that is a means for determining the presence or absence of dot formation for the target pixel while performing pipeline processing.

あるいは、本発明を次のような態様として把握することも可能である。すなわち、
二次元的に配列された複数の画素の各々に階調値を対応付けた画像データを受け取り、各画素の階調値と所定の閾値とを比較してドットの形成有無を判断しながら該画素の列たるラスタをドット列に変換することによって、該画像データをドットの形成有無による表現形式のデータに変換する画像処理装置であって、
複数の前記閾値が二次元的に配列された閾値マトリックスを記憶しておく閾値マトリックス記憶手段と、
ドットの形成有無の判断を行う対象画素を選択する対象画素選択手段と、
前記対象画素に対応する閾値を前記閾値マトリックスの中から読み出して、該対象画素に対応付けられた前記階調値と比較することにより、該対象画素についてのドット形成有無を判断するドット形成判断手段と
を備え、
前記対象画素選択手段は、互いに隣接する所定のN本(Nは2以上の整数)の前記ラスタをラスタ群としてまとめ、該ラスタ群に含まれる各画素を所定の順番に従って順次選択することにより、該N本の各ラスタから並行して前記対象画素を選択する手段であり、
前記ドット形成判断手段は、前記対象画素についてのドット形成有無を判断するに際して発生する中間的な情報を、該判断のための命令が記憶されるメインメモリよりも高速に読み書き可能なキャッシュメモリに一時的に蓄えながら、前記ドット形成有無を判断する手段である画像処理装置として把握することができる。
Or it is also possible to grasp | ascertain this invention as the following aspects. That is,
Receiving image data in which a gradation value is associated with each of a plurality of pixels arranged two-dimensionally, comparing the gradation value of each pixel with a predetermined threshold value and determining whether or not a dot is formed An image processing apparatus that converts the image data into data in an expression format depending on whether or not dots are formed by converting a raster as a row of dots into a dot row,
Threshold matrix storage means for storing a threshold matrix in which a plurality of the thresholds are two-dimensionally arranged;
Target pixel selection means for selecting a target pixel for determining whether or not to form a dot;
A dot formation determination unit that reads out a threshold value corresponding to the target pixel from the threshold value matrix and compares the threshold value with the gradation value corresponding to the target pixel, thereby determining whether or not the target pixel is formed. And
The target pixel selection means collects a predetermined N number of adjacent rasters (N is an integer of 2 or more) as a raster group, and sequentially selects each pixel included in the raster group according to a predetermined order, Means for selecting the target pixel in parallel from each of the N rasters;
The dot formation determination means temporarily stores intermediate information generated when determining the presence or absence of dot formation for the target pixel in a cache memory that can be read and written at a higher speed than the main memory in which an instruction for the determination is stored. It can be grasped as an image processing apparatus which is a means for judging the presence or absence of the dot formation while accumulating it.

本発明の作用・効果をより明確に説明するために、本発明の実施の形態を、次のような順序に従って以下に説明する。
A.発明の概要:
B.第1実施例:
B−1.装置構成:
B−2.画像データ変換処理の概要:
B−3.第1実施例の階調数変換処理:
B−4.変形例:
C.第2実施例:
C−1.第2実施例の階調数変換処理における閾値の格納方法:
C−2.第2実施例の階調数変換処理:
C−3.変形例:
D.第3実施例:
D−1.第3実施例の階調数変換処理:
D−2.変形例:
In order to more clearly describe the operation and effect of the present invention, embodiments of the present invention will be described below in the following order.
A. Summary of the invention:
B. First embodiment:
B-1. Device configuration:
B-2. Overview of image data conversion process:
B-3. Tone number conversion processing of the first embodiment:
B-4. Variations:
C. Second embodiment:
C-1. Storage method of threshold in gradation number conversion process of the second embodiment:
C-2. Tone number conversion processing of the second embodiment:
C-3. Variations:
D. Third embodiment:
D-1. Tone number conversion processing of the third embodiment:
D-2. Variations:

A.発明の概要:
図1を参照しながら、本発明の概要について説明する。図1は、印刷システムを例にとって、本発明の概要を概念的に示した説明図である。本印刷システムは、本発明の画像処理装置10と、プリンタ20とから構成されている。画像処理装置10は、画像データを受け取って所定の画像処理を施した後、ドットの形成有無による表現形式の印刷データに変換して、プリンタ20に出力する。図中には、画像処理装置10が画像データに画像処理を施してデータを変換する処理の概要が、フローチャートの形式で示されている。画像処理装置10に供給される画像データは、二次元的に配列された複数の画素の各々に階調値が対応づけられた形式で表現されている。こうした画像データは、デジタルカメラやカラースキャナなどの画像機器で撮影した画像や、各種のアプリケーションプログラムを用いてコンピュータ上で作成した画像に所定の変換を施すことによって、生成することができる。
A. Summary of the invention:
The outline of the present invention will be described with reference to FIG. FIG. 1 is an explanatory diagram conceptually showing an outline of the present invention, taking a printing system as an example. The printing system includes an image processing apparatus 10 according to the present invention and a printer 20. The image processing apparatus 10 receives the image data, performs predetermined image processing, converts it into print data in an expression format depending on whether dots are formed, and outputs the print data to the printer 20. In the drawing, an outline of processing in which the image processing apparatus 10 performs image processing on image data and converts the data is shown in the form of a flowchart. The image data supplied to the image processing apparatus 10 is expressed in a format in which a gradation value is associated with each of a plurality of pixels arranged two-dimensionally. Such image data can be generated by performing predetermined conversion on an image taken by an image device such as a digital camera or a color scanner, or an image created on a computer using various application programs.

画像処理装置10はこうした画像データを受け取ると、大まかには次のような流れで画像処理を施していく。先ず、画像データの中からドット形成の有無を判断しようとする画素(対称画素)を選択し(ステップS10)、対称画素に対応づけられた階調値と、該対象画素に所定の方法で対応付けられた閾値とを読み出す(ステップS20)。閾値の値は、マトリックス状に複数の閾値が予め記憶されている。本明細書では、閾値を記憶しているこうしたマトリックスを閾値マトリックスと呼ぶ。図1には、一例として縦横6個ずつの合計36個の閾値が記憶された閾値マトリックスが表示されているが、もちろん閾値マトリックスには、より多数の閾値を記憶しておくことが可能である。ステップS20では、画像データ上に閾値マトリックスを重ねたときに、対称画素に相当する位置に記憶されている閾値を、その対象画素に対応付けられた閾値として読み出す。   When receiving such image data, the image processing apparatus 10 performs image processing roughly in the following flow. First, a pixel (symmetric pixel) to be used to determine whether or not dots are formed is selected from the image data (step S10), and the gradation value associated with the symmetric pixel is associated with the target pixel by a predetermined method. The attached threshold value is read (step S20). As the threshold value, a plurality of threshold values are stored in advance in a matrix. In this specification, such a matrix storing threshold values is called a threshold matrix. In FIG. 1, a threshold value matrix in which a total of 36 threshold values, each of 6 in the vertical and horizontal directions are stored as an example, is displayed. Of course, a larger number of threshold values can be stored in the threshold value matrix. . In step S20, when the threshold value matrix is superimposed on the image data, the threshold value stored at the position corresponding to the symmetric pixel is read as the threshold value associated with the target pixel.

図1の中で「対称画素選択」と表示した枠内には、画像データ上に閾値マトリックスを重ねている様子を概念的に示している。表示中の細い破線は、二次元的に配列された複数の画素を示しており、太い破線は閾値マトリックスを示している。通常、閾値マトリックスの大きさは、画像データの大きさよりも小さいので、閾値マトリックスは位置を移動させながら繰り返して使用される。こうして閾値を読み出したら、対象画素の階調値と比較することにより、対象画素についてのドット形成の有無を判断する(ステップS30)。次いで、画像データを構成する全ての画素についてドット形成有無の判断を行ったか否かを判断し(ステップS40)、全ての画素について判断を完了するまで、上述した一連の処理を繰り返し行う。   In FIG. 1, a frame labeled “Symmetric pixel selection” conceptually shows a state where a threshold matrix is superimposed on image data. A thin broken line in the display indicates a plurality of pixels arranged two-dimensionally, and a thick broken line indicates a threshold matrix. Usually, since the size of the threshold matrix is smaller than the size of the image data, the threshold matrix is repeatedly used while moving the position. When the threshold value is read out in this manner, the presence / absence of dot formation for the target pixel is determined by comparing with the gradation value of the target pixel (step S30). Next, it is determined whether or not dot formation has been determined for all the pixels constituting the image data (step S40), and the above-described series of processing is repeated until the determination is completed for all the pixels.

ここで、本発明の画像処理装置10では、画像データを迅速に変換するために、対象画素を所定の方法で順次選択していく。図中の「対象画素選択」と表示した枠内には、対象画素を選択する様子が例示されている。説明の都合上、二次元的に配列された複数の画素の中の画素列をラスタと呼び、画像データは複数本のラスタが集まって構成されているものと考える。また、これらラスタには符番が付されており、「ラスタ1」,「ラスタ2」・・・と、それぞれのラスタを識別するものとする。   Here, in the image processing apparatus 10 of the present invention, target pixels are sequentially selected by a predetermined method in order to quickly convert image data. In the figure, “target pixel selection” is displayed in a frame indicating the selection of the target pixel. For convenience of explanation, a pixel row in a plurality of pixels arranged two-dimensionally is called a raster, and image data is considered to be composed of a plurality of rasters. These rasters are numbered, and “raster 1”, “raster 2”,..., And their respective rasters are identified.

対象画素の選択に際しては、先ず初めに、所定本数の隣接するラスタをまとめてラスタ群を形成する。図中の例示では、ラスタ1とラスタ2、ラスタ3とラスタ4、あるいはラスタ5とラスタ6、というように2本ずつのラスタをまとめてラスタ群を形成している。すなわち、図示した例では、1つのラスタ群には、ラスタ2本分に相当する複数の画素が含まれていることになる。次いで、ラスタ群を構成するこれら複数の画素の中から、所定の順番に従って順次、対象画素を選択していく。図中の例示に従って説明すると、先ず初めに、ラスタ1の左端の画素を対象画素として選択し、次いでラスタ2の左端の画素を選択する。その次は、ラスタ1の左から2番目の画素を選択し、続いてラスタ2の左から2番目の画素を選択する。こうして、ラスタ1とラスタ2とから、交互に対象画素を選択していく。図中で、ラスタ1およびラスタ2の上を左端から右方向に向かってジグザグ状に進む実線は、これら2つのラスタから交互に対象画素が選択される様子を模式的に表したものである。このように、2つのラスタから交互に対象画素を選択しながらドット形成の有無を判断することで、ラスタ1およびラスタ2が並行してドット列に変換されることになる。   When selecting a target pixel, first, a predetermined number of adjacent rasters are gathered to form a raster group. In the example shown in the figure, a raster group is formed by combining two rasters such as raster 1 and raster 2, raster 3 and raster 4, or raster 5 and raster 6. That is, in the illustrated example, one raster group includes a plurality of pixels corresponding to two rasters. Next, the target pixels are sequentially selected from the plurality of pixels constituting the raster group in a predetermined order. To explain according to the example in the figure, first, the leftmost pixel of the raster 1 is selected as the target pixel, and then the leftmost pixel of the raster 2 is selected. Next, the second pixel from the left of raster 1 is selected, and then the second pixel from the left of raster 2 is selected. Thus, the target pixel is alternately selected from the raster 1 and the raster 2. In the drawing, a solid line that proceeds in a zigzag shape from the left end toward the right direction on the raster 1 and the raster 2 schematically shows how the target pixel is alternately selected from these two rasters. In this way, by determining the presence or absence of dot formation while alternately selecting target pixels from the two rasters, raster 1 and raster 2 are converted into dot rows in parallel.

以上のようにしてラスタ1およびラスタ2の全画素について、ドット形成の有無を判断したら、今度はラスタ3およびラスタ4の画素から対象画素を選択する。すなわち、ラスタ3の左端の画素を対象画素として選択し、次いでラスタ4の左端の画素、ラスタ3の左から2番目の画素、ラスタ4の左から2番目の画素というように、ラスタ3およびラスタ4の画素を交互に対象画素として選択していく。図中でラスタ2の直ぐ下に、右側からラスタ3の左端の画素に向かう太い破線の矢印は、ラスタ1およびラスタ2の処理が終了して、ラスタ3およびラスタ4の処理に移ったことを模式的に示している。そして、ラスタ3およびラスタ4の画素を交互に選択しながら、全て画素についてドット形成の有無を判断したら、今度はラスタ5およびラスタ6の画素から対象画素を選択する。ラスタ5およびラスタ6の処理を終了したら、その次はラスタ7およびラスタ8、というようにラスタ群毎に複数のラスタを並行してドット列に変換していく。   When the presence or absence of dot formation is determined for all the pixels of raster 1 and raster 2 as described above, the target pixel is selected from the pixels of raster 3 and raster 4 this time. That is, the leftmost pixel of raster 3 is selected as the target pixel, then the leftmost pixel of raster 4, the second pixel from the left of raster 3, the second pixel from the left of raster 4, and so on. Four pixels are alternately selected as target pixels. In the figure, a thick dashed arrow heading from the right side to the leftmost pixel of the raster 3 just below the raster 2 indicates that the processing of the raster 1 and the raster 2 has been completed and the processing has shifted to the processing of the raster 3 and the raster 4. This is shown schematically. Then, if the presence or absence of dot formation is determined for all the pixels while alternately selecting the raster 3 and raster 4 pixels, the target pixel is selected from the raster 5 and raster 6 pixels. When the processing of the raster 5 and the raster 6 is completed, a plurality of rasters are converted into dot rows in parallel for each raster group, such as the raster 7 and the raster 8.

尚、以上の説明では、それぞれのラスタ群は2本のラスタから構成されているものとして説明したが、より多数のラスタから構成することも可能である。また、ラスタ群を構成する各画素を順次、対象画素として選択する順序は、以上に説明したものに限られず、ラスタ群を構成するラスタが並行してドット列に変換されるような順序であれば、種々の順序とすることができる。   In the above description, each raster group has been described as being composed of two rasters. However, it is also possible to construct a larger number of rasters. Further, the order in which each pixel constituting the raster group is sequentially selected as the target pixel is not limited to that described above, and may be an order in which the rasters constituting the raster group are converted into dot rows in parallel. For example, various orders can be used.

このようにラスタ群を構成する複数のラスタを並行してドット列に変換することとすれば、次のような種々の理由から迅速に変換することが可能である。   As described above, if a plurality of rasters constituting a raster group are converted into dot rows in parallel, they can be quickly converted for various reasons as follows.

一般に画像データは、近傍の画素間には近似した階調値が対応付けられる傾向がある。複数の画素について連続してドット形成の有無を判断する場合、これらの画素が互いに近似した階調値を有していれば、判断を行うためにCPUが内部で生成する実行コードがキャッシュメモリに残っている可能性が高くなる。実行コードが残っていれば、CPUはキャッシュメモリから実行コードを読み出して処理を進めることができるので、実行コードを生成する必要が無くなり、その分だけ処理を迅速化することが可能となる。尚、このように必要な実行コードあるいはデータなどがキャッシュメモリに残っている確率は、キャッシュのヒット率と呼ばれることがある。ここで、画素は二次元的に配列されているから、縦横斜めのいずれの方向に近接する画素にも同様に近似した階調値が対応付けられている可能性が高い。例えば、図1に示されたラスタ1の左端の画素を例にとって説明すれば、この画素の周辺の画素、すなわちラスタ1の左端から2番目の画素、ラスタ2の左端あるいは左端から2番目の画素はいずれも、ラスタ1の左端にある画素と近似した階調値が対応付けられている可能性が高い。従って、ラスタ1およびラスタ2の画素から交互に対象画素を選択してドット形成有無を判断して行けば、二次元的に広がる画素の中から階調値の近似した画素を連続して処理することができるので、その分だけキャッシュのヒット率を向上させて、処理を迅速化することが可能となる。   In general, image data tends to be associated with approximate gradation values between neighboring pixels. When determining the presence or absence of dot formation continuously for a plurality of pixels, if these pixels have gradation values that are close to each other, the execution code generated internally by the CPU to make the determination is stored in the cache memory. The possibility of remaining is high. If the execution code remains, the CPU can read the execution code from the cache memory and proceed with the process, so that it is not necessary to generate the execution code, and the process can be speeded up accordingly. The probability that necessary execution code or data or the like remains in the cache memory may be referred to as a cache hit rate. Here, since the pixels are two-dimensionally arranged, there is a high possibility that similar approximate gradation values are associated with pixels that are adjacent in either the vertical or horizontal diagonal directions. For example, the pixel at the left end of the raster 1 shown in FIG. 1 will be described as an example. Pixels around this pixel, that is, the second pixel from the left end of the raster 1, the second pixel from the left end or the left end of the raster 2 In any case, there is a high possibility that a gradation value approximated to the pixel at the left end of the raster 1 is associated. Therefore, if the target pixel is alternately selected from the pixels of raster 1 and raster 2 to determine the presence or absence of dot formation, pixels having approximate gradation values are successively processed from the two-dimensionally spread pixels. Therefore, it is possible to improve the cache hit rate by that amount and speed up the processing.

また、画像処理を行うCPUがパイプライン処理、あるいはパイプライン処理の分岐予測を行っている場合は、次のような理由から、複数のラスタを並行して処理することでより一層の迅速化を実現することができる。階調値が近似した画素を連続して処理する場合、同様な処理が繰り返される可能性が高くなる。例えば、連続して処理する画素の階調値が充分に低い場合は、いずれの画素についてもドットを形成しないと判断される可能性が高くなる。すなわち、これらの画素を処理している間は、CPUの内部では同様な処理が連続して行われる可能性が高くなる。このため、パイプライン処理の効率や分岐予測の的中率が向上し、その結果、処理を高速化することができる。上述したように、複数のラスタを並行して処理してやれば、縦横斜め方向に近接した画素を連続して処理することができるので、ラスタ1本ずつドット列に変換する場合よりも、階調値が近似した画素を連続して処理することができる。その結果、パイプライン処理の効率や分岐予測の的中率を向上させることができ、その分だけ処理を迅速化することが可能となる。   In addition, when the CPU that performs image processing is performing pipeline processing or branch prediction of pipeline processing, it can be further accelerated by processing multiple rasters in parallel for the following reasons. Can be realized. When pixels with similar gradation values are processed continuously, there is a high possibility that similar processing is repeated. For example, when the gradation values of pixels that are continuously processed are sufficiently low, there is a high possibility that it is determined that no dot is formed for any pixel. That is, while these pixels are processed, there is a high possibility that similar processing is continuously performed inside the CPU. For this reason, the efficiency of pipeline processing and the hit rate of branch prediction are improved, and as a result, the processing can be speeded up. As described above, if a plurality of rasters are processed in parallel, pixels that are close to each other in the vertical and horizontal directions can be processed in succession. Can be processed in succession. As a result, the efficiency of pipeline processing and the hit rate of branch prediction can be improved, and the processing can be speeded up accordingly.

本発明の画像処理装置には、種々の態様が存在している。以下では、これら各種の態様について、実施例を用いて詳細に説明する。   Various aspects exist in the image processing apparatus of the present invention. Below, these various aspects are demonstrated in detail using an Example.

B.第1実施例:
B−1.装置構成:
図2は、第1実施例の画像処理装置としてのコンピュータ100の構成を示す説明図である。コンピュータ100は、CPU102を中心に、ROM104やRAM106などを、バス116で互いに接続して構成された周知のコンピュータである。また、CPU102にはキャッシュメモリが内蔵されており、ROM104やRAM106などから情報を読み出す際には、先ずキャッシュメモリにアクセスして、必要な情報が残っていればキャッシュメモリから読み出すことで、処理の高速化を図っている。更に、CPU102の内部では、いわゆるパイプライン処理と呼ばれる並列演算方式により処理の高速化が図られており、パイプライン処理を効果的に機能させるために分岐予測制御も行われている。
B. First embodiment:
B-1. Device configuration:
FIG. 2 is an explanatory diagram illustrating a configuration of the computer 100 as the image processing apparatus according to the first embodiment. The computer 100 is a well-known computer configured by connecting a ROM 104, a RAM 106, and the like with a bus 116 around a CPU 102. The CPU 102 has a built-in cache memory. When reading information from the ROM 104 or the RAM 106, the CPU 102 first accesses the cache memory, and if necessary information remains, reads it from the cache memory. We are trying to speed up. Further, in the CPU 102, the processing speed is increased by a parallel operation method called so-called pipeline processing, and branch prediction control is also performed in order to make the pipeline processing function effectively.

コンピュータ100には、フレキシブルディスク124やコンパクトディスク126のデータを読み込むためのディスクコントローラDDC109や、周辺機器とデータの授受を行うための周辺機器インターフェースP−I/F108、CRT114を駆動するためのビデオインターフェースV−I/F112等が接続されている。P−I/F108には、後述するカラープリンタ200や、ハードディスク118等が接続されている。また、デジタルカメラ120や、カラースキャナ122等をP−I/F108に接続すれば、デジタルカメラ120やカラースキャナ122で取り込んだ画像を印刷することも可能である。また、ネットワークインターフェースカードNIC110を装着すれば、コンピュータ100を通信回線300に接続して、通信回線に接続された記憶装置310に記憶されているデータを取得することもできる。   The computer 100 includes a disk controller DDC 109 for reading data on the flexible disk 124 and the compact disk 126, a peripheral device interface P-I / F 108 for exchanging data with peripheral devices, and a video interface for driving the CRT 114. A V-I / F 112 or the like is connected. A color printer 200 (to be described later), a hard disk 118, and the like are connected to the P-I / F 108. Further, if a digital camera 120, a color scanner 122, or the like is connected to the P-I / F 108, an image captured by the digital camera 120 or the color scanner 122 can be printed. If the network interface card NIC 110 is attached, the computer 100 can be connected to the communication line 300 to acquire data stored in the storage device 310 connected to the communication line.

図3は、第1実施例の画像処理装置に組み合わせて使用されるカラープリンタ200の概略構成を示す説明図である。カラープリンタ200はシアン,マゼンタ,イエロ,ブラックの4色インクのドットを形成可能なインクジェットプリンタである。もちろん、これら4色のインクに加えて、染料濃度の低いシアン(淡シアン)インクと染料濃度の低いマゼンタ(淡マゼンタ)インクとを含めた合計6色のインクドットを形成可能なインクジェットプリンタを用いることもできる。更には、明度の低い(暗い)イエロ(ダークイエロ)インクを加えた合計7色のインクドットを形成可能なインクジェットプリンタを用いても良い。尚、以下では場合によって、シアンインク,マゼンタインク,イエロインク,ブラックインク,淡シアンインク,淡マゼンタインク,ダークイエロインクのそれぞれを、Cインク,Mインク,Yインク,Kインク,LCインク,LMインク,DYインクと略称するものとする。   FIG. 3 is an explanatory diagram showing a schematic configuration of a color printer 200 used in combination with the image processing apparatus of the first embodiment. The color printer 200 is an ink jet printer capable of forming dots of four color inks of cyan, magenta, yellow, and black. Of course, in addition to these four color inks, an inkjet printer capable of forming a total of six ink dots including cyan (light cyan) ink with a low dye density and magenta (light magenta) ink with a low dye density is used. You can also. Furthermore, an ink jet printer that can form ink dots of a total of seven colors including low (light) yellow (dark yellow) ink may be used. In the following, cyan ink, magenta ink, yellow ink, black ink, light cyan ink, light magenta ink, and dark yellow ink are respectively changed to C ink, M ink, Y ink, K ink, LC ink, and LM. Ink and DY ink are abbreviated.

カラープリンタ200は、図示するように、キャリッジ240に搭載された印字ヘッド241を駆動してインクの吐出およびドット形成を行う機構と、このキャリッジ240をキャリッジモータ230によってプラテン236の軸方向に往復動させる機構と、紙送りモータ235によって印刷用紙Pを搬送する機構と、ドットの形成やキャリッジ240の移動および印刷用紙の搬送を制御する制御回路260とから構成されている。   As shown in the figure, the color printer 200 drives a print head 241 mounted on a carriage 240 to eject ink and form dots, and the carriage 240 is reciprocated in the axial direction of a platen 236 by a carriage motor 230. And a control circuit 260 that controls dot formation, carriage 240 movement, and printing sheet conveyance.

キャリッジ240には、Kインクを収納するインクカートリッジ242と、Cインク,Mインク,Yインクの各種インクを収納するインクカートリッジ243とが装着されている。キャリッジ240にインクカートリッジ242,243を装着すると、カートリッジ内の各インクは図示しない導入管を通じて、印字ヘッド241の底面に設けられた各色毎のインク吐出用ヘッド244ないし247に供給される。図4は、印字ヘッド241の底面に、複数のノズルNzが設けられている様子を示す説明図である。図示されてるように、印字ヘッド241の底面には各色のインク吐出用ヘッド毎に、複数のノズルNzが一定のノズルピッチkで千鳥状に2列に配列されている。   An ink cartridge 242 that stores K ink and an ink cartridge 243 that stores various inks of C ink, M ink, and Y ink are mounted on the carriage 240. When the ink cartridges 242 and 243 are mounted on the carriage 240, each ink in the cartridge is supplied to ink discharge heads 244 to 247 for each color provided on the bottom surface of the print head 241 through an introduction pipe (not shown). FIG. 4 is an explanatory diagram showing a state in which a plurality of nozzles Nz are provided on the bottom surface of the print head 241. As shown in the drawing, a plurality of nozzles Nz are arranged in two rows in a staggered pattern at a fixed nozzle pitch k for each color ink discharge head on the bottom surface of the print head 241.

図3に示した制御回路260は、CPU261とROM262とRAM263等から構成されており、キャリッジモータ230と紙送りモータ235の動作を制御することによってキャリッジ240の主走査と副走査とを制御するとともに、コンピュータ100から供給される印刷データに基づいて、各色毎のインク吐出用ヘッドを駆動し適切なタイミングでインク滴を吐出する。こうして、制御回路260の制御の下、印刷媒体上の適切な位置に各色のインクドットを形成することによって、カラープリンタ200はカラー画像を印刷することができる。   The control circuit 260 shown in FIG. 3 includes a CPU 261, a ROM 262, a RAM 263, and the like, and controls main scanning and sub-scanning of the carriage 240 by controlling operations of the carriage motor 230 and the paper feed motor 235. Based on the print data supplied from the computer 100, the ink ejection head for each color is driven to eject ink droplets at an appropriate timing. Thus, the color printer 200 can print a color image by forming ink dots of respective colors at appropriate positions on the print medium under the control of the control circuit 260.

尚、各色のインク吐出用ヘッドを駆動してインク滴を吐出する方法には、種々の方法を適用することができる。すなわち、ピエゾ素子を用いてインクを吐出する方式や、インク通路に配置したヒータでインク通路内に泡(バブル)を発生させてインク滴を吐出する方法などを用いることができる。また、インクを吐出する代わりに、熱転写などの現象を利用して印刷用紙上にインクドットを形成する方式や、静電気を利用して各色のトナー粉を印刷媒体上に付着させる方式のプリンタを使用することも可能である。   Various methods can be applied to the method of ejecting ink droplets by driving the ink ejection head of each color. That is, a method of ejecting ink using a piezoelectric element, a method of ejecting ink droplets by generating bubbles in the ink passage with a heater arranged in the ink passage, and the like can be used. Also, instead of ejecting ink, use a method that uses ink transfer to form ink dots on printing paper using a phenomenon such as thermal transfer, or a method that uses static electricity to attach toner powder of each color onto the print medium. It is also possible to do.

更には、インク吐出ヘッドから吐出するインク滴の大きさを制御したり、あるいは微細なインク滴を複数個吐出して、吐出するインク滴の数を制御するといった方法を用いて、印刷用紙上に形成されるインクドットの大きさを制御な可能なプリンタ、いわゆるバリアブルドットプリンタを用いることも可能である。   In addition, the size of the ink droplets ejected from the ink ejection head, or the method of controlling the number of ink droplets ejected by ejecting a plurality of fine ink droplets on the printing paper is used. It is also possible to use a printer capable of controlling the size of ink dots to be formed, a so-called variable dot printer.

B−2.画像データ変換処理の概要:
図5は、第1実施例の画像処理装置としてのコンピュータ100が、受け取った画像データに所定の画像処理を加えることにより、該画像データを印刷データに変換する処理の流れを示すフローチャートである。かかる処理は、コンピュータ100のオペレーティングシステムがプリンタドライバを起動することによって開始され、CPU102の機能を用いて実行される。以下、図5に従って、第1実施例の画像データ変換処理について簡単に説明する。
B-2. Overview of image data conversion process:
FIG. 5 is a flowchart showing a flow of processing in which the computer 100 as the image processing apparatus of the first embodiment converts the received image data into print data by applying predetermined image processing to the received image data. Such processing is started when the operating system of the computer 100 activates the printer driver, and is executed using the function of the CPU 102. The image data conversion process of the first embodiment will be briefly described below with reference to FIG.

プリンタドライバは、画像データ変換処理を開始すると、先ず初めに、カラー画像データの読み込みを開始する(ステップS100)。ここで読み込まれるカラー画像データは、二次元的に配列された複数の画素に、赤色(R),緑色(G),青色(B)の各色についての階調値が対応付けられたいわゆるRGB画像データである。   When starting the image data conversion process, the printer driver first starts reading color image data (step S100). The color image data read here is a so-called RGB image in which gradation values for each color of red (R), green (G), and blue (B) are associated with a plurality of pixels arranged two-dimensionally. It is data.

次いで、取り込んだ画像データの解像度を、カラープリンタ200が印刷するための解像度に変換する(ステップS102)。カラー画像データの解像度が印刷解像度よりも低い場合は、補間演算を行うことで隣接画像データ間に新たなデータを生成し、逆に印刷解像度よりも高い場合は、一定の割合でデータを間引くことによって画像データの解像度を印刷解像度に変換する。また簡便には、補間演算を行う代わりに、隣接する画素の間に、いずれかの画素と同じ階調値の画素を新たに生成することもできる。   Next, the resolution of the captured image data is converted to a resolution for printing by the color printer 200 (step S102). When the resolution of color image data is lower than the printing resolution, new data is generated between adjacent image data by performing an interpolation operation. Conversely, when the resolution is higher than the printing resolution, the data is thinned out at a certain rate. To convert the resolution of the image data to the printing resolution. Further, for convenience, instead of performing the interpolation calculation, a pixel having the same gradation value as any of the pixels can be newly generated between adjacent pixels.

こうして解像度を変換すると、カラー画像データの色変換処理を行う(ステップS104)。色変換処理とは、R,G,Bの階調値の組み合わせによって表現されているRGB画像データを、C,M,Y,Kなどのカラープリンタ200で使用する各色の階調値の組み合わせによって表現された画像データに変換する処理である。色変換処理は、色変換テーブル(LUT)と呼ばれる3次元の数表を参照することで迅速に行うことができる。   When the resolution is converted in this way, color conversion processing of color image data is performed (step S104). Color conversion processing refers to RGB image data expressed by a combination of R, G, and B gradation values, by a combination of gradation values of each color used in the color printer 200 such as C, M, Y, and K. This is a process of converting into expressed image data. The color conversion process can be quickly performed by referring to a three-dimensional numerical table called a color conversion table (LUT).

色変換処理を終了すると、次は階調数変換処理を開始する(ステップS106)。階調数変換処理とは次のような処理である。色変換処理によって得られた画像データは、C,M,Y,Kの各色毎に256階調の階調幅を持つデータとなっている。これに対し、第1実施例のカラープリンタ200では、「ドットを形成する」,「ドットを形成しない」のいずれかの状態しか採り得ない。すなわち、本実施例のカラープリンタ200は局所的には2階調しか表現し得ない。そこで、256階調を有する画像データを、カラープリンタ200が表現可能な2階調で表現された画像データに変換する必要がある。このような階調数の変換を行う処理が階調数変換処理である。   When the color conversion process is finished, the gradation number conversion process is started (step S106). The gradation number conversion process is the following process. The image data obtained by the color conversion process is data having a gradation width of 256 gradations for each color of C, M, Y, and K. On the other hand, the color printer 200 of the first embodiment can take only the state of “form dots” or “do not form dots”. That is, the color printer 200 of the present embodiment can only express two gradations locally. Therefore, it is necessary to convert image data having 256 gradations into image data expressed in 2 gradations that can be expressed by the color printer 200. A process for converting the number of gradations is a gradation number conversion process.

第1実施例の階調数変換処理では、いわゆるディザ法と呼ばれる手法を用いて処理を行う。ディザ法とは、画素の階調値と、その画素に対応付けられた閾値とを比較して、階調値の方が大きければその画素にドットを形成すると判断し、階調値の方が小さければドットを形成しないと判断することによって、画像データをドット形成の有無による表現形式のデータに変換する手法である。ディザ法では、画素に対応付けられる複数の閾値は、マトリックス状に配列した状態で記憶されており、ドット形成の有無を判断しようとする画素の画像データ中での位置に応じて、マトリックス中の適切な閾値が対応付けられている。本明細書では、こうした複数の閾値を記録したマトリックスを閾値マトリックスと呼ぶことにする。   In the gradation number conversion processing of the first embodiment, processing is performed using a so-called dither method. In the dither method, the gradation value of a pixel is compared with a threshold value associated with the pixel, and if the gradation value is larger, it is determined that a dot is formed in that pixel. This is a method of converting image data into data in an expression format based on the presence or absence of dot formation by determining that no dot is formed if it is small. In the dither method, a plurality of threshold values associated with pixels are stored in a matrix arrangement, and in accordance with the position in the image data of the pixel for which it is determined whether or not to form dots, Appropriate thresholds are associated. In this specification, such a matrix in which a plurality of threshold values are recorded is called a threshold value matrix.

図6(a)は、閾値マトリックスの一部を拡大して、複数の閾値が記憶されている様子を例示した説明図である。例示の閾値マトリックスには、縦横それぞれ64画素の正方形のマトリックスに合計4096画素分の閾値が記憶されている。もちろん、閾値マトリックスの大きさはこれに限らず、必要に応じて種々の大きさとすることができる。また、必ずしも正方形のマトリックスに限らず、例えば縦横の画素数の異なるマトリックスとすることも可能である。尚、図6(a)に示すような大きな閾値マトリックスを用いたのでは説明が煩雑になってしまうので、以下では、閾値マトリックスは図6(b)に示すような小さなマトリックスであるものとして説明する。   FIG. 6A is an explanatory diagram illustrating a state in which a part of the threshold matrix is enlarged and a plurality of threshold values are stored. In the example threshold matrix, thresholds corresponding to a total of 4096 pixels are stored in a square matrix of 64 pixels vertically and horizontally. Of course, the size of the threshold matrix is not limited to this, and may be various sizes as required. Further, the matrix is not necessarily limited to a square matrix, and may be a matrix having different numbers of vertical and horizontal pixels, for example. Note that the use of a large threshold matrix as shown in FIG. 6A makes the description complicated, and therefore the following description assumes that the threshold matrix is a small matrix as shown in FIG. 6B. To do.

図7は、画像データに閾値マトリックスを適用して、画素毎にドット形成の有無を判断している様子を概念的に示した説明図である。図7で細い破線で示された矩形は、1つ1つが画素を表している。画像データは、二次元的に配列された複数の画素の各々に階調値が対応付けられた形式で表現されている。説明を簡単にするために、ここでは全ての画素に、階調値64が対応付けられているものとする。図7(a)は、こうした画像データに閾値マトリックスを適用した様子を模式的に示している。図7(a)では、閾値マトリックスを太い実線で表している。前述したように閾値マトリックスのそれぞれのマス目には、予め閾値が記憶されている。図7(a)に示すように、画像データの上に閾値マトリックスを重ねることにより、画像データを構成する各画素と、閾値マトリックスの各マス目とを対応付けることができる。   FIG. 7 is an explanatory diagram conceptually showing a state in which a threshold value matrix is applied to image data to determine the presence or absence of dot formation for each pixel. Each rectangle indicated by a thin broken line in FIG. 7 represents a pixel. The image data is expressed in a format in which a gradation value is associated with each of a plurality of pixels arranged two-dimensionally. In order to simplify the description, it is assumed here that gradation values 64 are associated with all the pixels. FIG. 7A schematically shows how a threshold matrix is applied to such image data. In FIG. 7A, the threshold matrix is represented by a thick solid line. As described above, threshold values are stored in advance in each cell of the threshold value matrix. As shown in FIG. 7A, by superimposing the threshold value matrix on the image data, each pixel constituting the image data can be associated with each square of the threshold value matrix.

ディザ法では、こうして画像データの画素と閾値マトリックスのマス目とを対応付けた後、各画素の階調値と、各マス目に記憶されている閾値とを比較する。そして、画素の階調値の方が大きい画素にはドットを形成すると判断し、そうでない画素にはドットを形成しないと判断する。ここでは、全ての画素には階調値64が記憶されているものとしているから、閾値マトリックスに記憶された閾値が63以下の画素については「ドットを形成する」と判断され、閾値が64以上の画素については「ドットを形成しない」と判断されることになる。図7(a)では、ドットを形成すると判断された画素には、ハッチングを付して表示している。   In the dither method, after associating the pixels of the image data with the squares of the threshold matrix in this way, the gradation value of each pixel is compared with the threshold value stored in each square. Then, it is determined that a dot is formed in a pixel having a larger gradation value of the pixel, and a dot is not formed in a pixel that is not so. Here, since it is assumed that gradation values 64 are stored in all the pixels, it is determined that “dots are formed” for pixels having a threshold value of 63 or less stored in the threshold value matrix, and the threshold value is 64 or more. For these pixels, it is determined that “no dot is formed”. In FIG. 7A, the pixels determined to form dots are displayed with hatching.

画像データは非常に多くの画素から構成されているので、通常は閾値マトリックスよりも大きなサイズとなっている。従って、全ての画素についてのドット形成有無を判断するために、閾値マトリックスの位置を画像データに対して移動させながら、同じマトリックスを繰り返し使用する。図7(b)は、こうして全ての画素についてドット形成の有無を判断した結果を示している。以上のようにしてドット形成の有無を判断することにより、画像データの階調値に応じた適切な比率で、しかも各ドットを互いに分散させた状態で形成することができる。例えば、ここでは画像データの階調値は64であるとしており、これは、フルスケールの階調値256に対して約1/4に相当する。これに対応して図7(b)では、全画素の約1/4の画素にドットが形成されている。ドットが形成される密度は、画像データの階調値が大きくなれば高くなり、階調値が小さくなればそれに連れて低くなる。この様に、ディザ法では閾値マトリックスの適切な閾値を設定してやることにより、画像データの階調値に応じて適切な密度でドットを形成することができる。   Since the image data is composed of a large number of pixels, it is usually larger than the threshold matrix. Therefore, the same matrix is repeatedly used while moving the position of the threshold matrix with respect to the image data in order to determine the presence or absence of dot formation for all pixels. FIG. 7B shows the result of determining whether or not dots are formed for all the pixels. By determining whether or not dots are formed as described above, dots can be formed in an appropriate ratio according to the gradation value of the image data and in a state where the dots are dispersed from each other. For example, here, the gradation value of the image data is assumed to be 64, which corresponds to about ¼ of the full-scale gradation value 256. Correspondingly, in FIG. 7B, dots are formed in about 1/4 of all the pixels. The density at which dots are formed increases as the gradation value of the image data increases, and decreases as the gradation value decreases. Thus, in the dither method, by setting an appropriate threshold value in the threshold matrix, dots can be formed with an appropriate density according to the gradation value of the image data.

以上の説明では、あたかも閾値マトリックス内の全画素についてドット形成の有無を判断し、その後、閾値マトリックスの位置をずらしてマトリックスを新たな画素に対応付けて、これら画素についてのドット形成有無を判断するかのように説明した。しかし、これは説明の都合上の理由によるものであり、実際には、閾値マトリックス毎にドット形成有無を判断するのではなく、ラスタ単位でドット形成の有無を判断している。すなわち、1本のラスタ上を左端から右方向の進みながらドット形成の有無を判断し、ラスタ上の全画素について判断を終了したら、下のラスタの処理を開始する。このように、実際には、ラスタ1本ずつドット形成の有無を判断していた。これに対して、本実施例の階調数変換処理では、複数のラスタのドット形成の有無を並行して判断することにより、迅速な処理が可能となっている。複数ラスタのドット形成有無の判断を並行して行う方法については、後ほど詳述する。   In the above description, it is determined whether or not dots are formed for all the pixels in the threshold matrix, and then the position of the threshold matrix is shifted to associate the matrix with new pixels, and whether or not dots are formed for these pixels is determined. Explained as if. However, this is for the convenience of explanation. Actually, the presence / absence of dot formation is determined for each raster rather than for each threshold matrix. That is, the presence or absence of dot formation is determined while proceeding in the right direction from the left end on one raster, and when the determination is completed for all pixels on the raster, processing of the lower raster is started. In this way, in practice, the presence / absence of dot formation is determined for each raster. On the other hand, in the tone number conversion process of the present embodiment, it is possible to perform a quick process by determining in parallel whether or not a plurality of raster dots are formed. A method of determining whether or not dots are formed on a plurality of rasters in parallel will be described in detail later.

図5に示した画像データ変換処理では、以上のようにして階調数変換処理を終了した後、インターレース処理を開始する(図5のステップS108)。インターレース処理は、ドット形成の有無による表現形式に変換された画像データを、ドットの形成順序を考慮しながらカラープリンタ200に転送すべき順序に並び換える処理である。プリンタドライバは、インターレース処理を行って得られた画像データを、最終的に印刷データとしてカラープリンタ200に出力する(ステップS110)。カラープリンタ200は、こうして供給された印刷データに従って印刷媒体上に各色のインクドットを形成する。その結果、画像データに対応したカラー画像が印刷媒体上に印刷される。   In the image data conversion process shown in FIG. 5, after the gradation number conversion process is completed as described above, the interlace process is started (step S108 in FIG. 5). The interlace process is a process of rearranging the image data converted into the expression format depending on the presence or absence of dot formation into the order to be transferred to the color printer 200 in consideration of the dot formation order. The printer driver finally outputs the image data obtained by performing the interlace processing to the color printer 200 as print data (step S110). The color printer 200 forms ink dots of each color on the print medium according to the print data thus supplied. As a result, a color image corresponding to the image data is printed on the print medium.

以下では、第1実施例の階調数変換処理において、複数のラスタについて並行してドット形成の有無を判断することにより、画像データの階調数を迅速に変換する処理について説明する。   Hereinafter, in the tone number conversion process of the first embodiment, a process for quickly converting the tone number of image data by determining whether or not dots are formed in parallel for a plurality of rasters will be described.

B−3.第1実施例の階調数変換処理:
図8は、第1実施例の階調数変換処理の流れを示すフローチャートである。かかる処理は、コンピュータ100のプリンタドライバが、図5に示した画像データ変換処理の中で行う処理である。尚、図8に示した処理は、C,M,Y,Kの各色毎に行われるが、説明が煩雑なることを避けるために、以下では特に色を特定することなく説明する。また、図9は、プリンタドライバが第1実施例の階調数変換処理に従って、ドット形成の有無を判断している様子を概念的に示した説明図である。以下、図9を参照しながら、図8のフローチャートに従って説明する。
B-3. Tone number conversion processing of the first embodiment:
FIG. 8 is a flowchart showing the flow of the tone number conversion process of the first embodiment. This process is a process performed by the printer driver of the computer 100 in the image data conversion process shown in FIG. The processing shown in FIG. 8 is performed for each color of C, M, Y, and K. However, in order to avoid complicated description, the following description will be made without particularly specifying a color. FIG. 9 is an explanatory diagram conceptually showing how the printer driver determines the presence / absence of dot formation according to the tone number conversion process of the first embodiment. Hereinafter, a description will be given according to the flowchart of FIG. 8 with reference to FIG.

プリンタドライバは、階調数変換処理を開始すると先ず初めに、所定本数の隣接するラスタをまとめてラスタ群を形成する処理を行う(ステップS200)。ここでは、ラスタを2本ずつまとめてラスタ群を形成するものとする。もちろん、2本に限らず、より多数のラスタをラスタ群としてまとめることとしても良い。図9では、画像の一番上にある「ラスタ1」とその下にある「ラスタ2」とにハッチングを施すことによって、これらラスタをラスタ群としてまとめていることを表している。   When starting the tone number conversion process, the printer driver first performs a process of forming a raster group by combining a predetermined number of adjacent rasters (step S200). Here, it is assumed that a raster group is formed by collecting two rasters. Of course, the number of rasters is not limited to two, and a larger number of rasters may be collected as a raster group. In FIG. 9, “raster 1” at the top of the image and “raster 2” below it are hatched to indicate that these rasters are grouped as a raster group.

次いで、ラスタ群に含まれている複数の画素の中から、ドット形成の有無を判断しようとする対象画素を1つ選択する(ステップS202)。初めは、画像データの一番左上にある画素、すなわちラスタ1の左端の画素を対象画素として選択する。図9では、この画素は、[1]と符番して表示されている。   Next, one target pixel is selected from among a plurality of pixels included in the raster group to determine whether or not dots are formed (step S202). Initially, the pixel at the upper left of the image data, that is, the leftmost pixel of the raster 1 is selected as the target pixel. In FIG. 9, this pixel is indicated by a number [1].

その後、選択した対象画素の階調値Dtを読み込み(ステップS204)、次いで対象画素に対応する閾値thを閾値マトリックスから読み込む処理を行う(ステップS206)。ここで、対象画素に対応する閾値とは、図7(a)を用いて前述したように、画像データ上に閾値マトリックスを重ねたときに、対象画素に重なるような位置の、閾値マトリックスのマス目に記憶されている閾値である。図9中に太い破線で示した矩形は、画像データの上に閾値マトリックスが重ねられている様子を模式的に表したものである。   Thereafter, the gradation value Dt of the selected target pixel is read (step S204), and then the threshold value th corresponding to the target pixel is read from the threshold matrix (step S206). Here, as described above with reference to FIG. 7A, the threshold value corresponding to the target pixel is a matrix of the threshold matrix at a position that overlaps the target pixel when the threshold matrix is superimposed on the image data. The threshold value stored in the eye. A rectangle indicated by a thick broken line in FIG. 9 schematically shows a state in which a threshold matrix is superimposed on image data.

こうして対象画素の階調値Dtと、対応する閾値thとを読み出したら、これらの大小関係を比較する(ステップS208)。そして、階調値Dtの方が大きい場合は(ステップS208:yes)、対象画素にドットを形成すると判断して、ドット形成の有無の判断結果を示す変数Drに、ドットを形成することを意味する値「1」を書き込む(ステップS210)。逆に、閾値thの方が大きい場合は、判断結果を示す変数Drに、ドットを形成しないことを意味する値「0」を書き込む処理を行う(ステップS212)。   When the gradation value Dt of the target pixel and the corresponding threshold value th are read out in this way, the magnitude relationship between these is compared (step S208). If the gradation value Dt is larger (step S208: yes), it means that it is determined that a dot is to be formed on the target pixel, and that a dot is formed on the variable Dr indicating the determination result of the presence or absence of dot formation. The value “1” to be written is written (step S210). On the contrary, when the threshold th is larger, a process of writing a value “0” indicating that no dot is formed is performed in the variable Dr indicating the determination result (step S212).

以上のようにして、選択した対象画素についてのドット形成の有無を判断したら、ラスタ群に含まれる全ての画素を対象画素として選択したか否かを判断する(ステップS214)。ここでは、未だ、図9中で「1」と符番した画素しか処理しておらず、ラスタ群には未処理の画素が多数残っている。そこで、ステップS214の処理においては「no」と判断し、ステップS202に戻って、新たな対象画素を選択する。   When it is determined whether or not dots are formed for the selected target pixel as described above, it is determined whether or not all the pixels included in the raster group are selected as the target pixels (step S214). Here, only the pixel numbered “1” in FIG. 9 has been processed, and many unprocessed pixels remain in the raster group. Therefore, it is determined as “no” in the process of step S214, and the process returns to step S202 to select a new target pixel.

新たな対象画素は、ラスタ群に含まれる各ラスタから順次、対象画素が選択されるように、所定の規則に従って行われる。ここでは、次のような規則に従って対象画素を選択するものとする。
<<規則1>>: 対象画素が奇数番目のラスタ上にあるときは、対象画素の直ぐ下にある画素を新たな対象画素として選択する。すなわち、左右方向には画素位置を変更することなく、ラスタの番号を1つだけインクリメントさせる。
<<規則2>>: 対象画素が偶数番目のラスタ上にあるときは、対象画素の直ぐ右上にある画素を新たな対象画素として選択する。すなわち、ラスタ番号を1つだけデクリメントするとともに、画素位置を示す番号は1つだけインクリメントさせる。
The new target pixel is performed according to a predetermined rule so that the target pixel is selected sequentially from each raster included in the raster group. Here, it is assumed that the target pixel is selected according to the following rule.
<< Rule 1 >>: When the target pixel is on an odd-numbered raster, a pixel immediately below the target pixel is selected as a new target pixel. That is, the raster number is incremented by one in the left-right direction without changing the pixel position.
<< Rule 2 >>: When the target pixel is on the even-numbered raster, the pixel immediately above the target pixel is selected as a new target pixel. That is, the raster number is decremented by one and the number indicating the pixel position is incremented by one.

この様な規則に従って新たな対象画素を選択する結果、図9で[1]と符番した画素の次には、図中で[2]と符番した画素が新たな対象画素として選択されることになる。こうして選択した符番[2]の画素について、上述した様にステップS204ないしステップS214の処理を行った後、再びステップS202に戻って、次の対象画素を選択する。上述した規則に従えば、符番[2]の画素の次には、符番[3]の画素が新たな対象画素として選択される。以下、同様にして、符番[4]の画素、符番[5]の画素、符番[6]の画素と順次、対象画素が選択されて、それぞれの画素についてドット形成の有無が判断されていく。   As a result of selecting a new target pixel according to such a rule, a pixel numbered [2] in the figure is selected as a new target pixel next to the pixel numbered [1] in FIG. It will be. The pixel of the number [2] selected in this way is subjected to the processing from step S204 to step S214 as described above, and then returns to step S202 again to select the next target pixel. According to the rule described above, the pixel with the number [3] is selected as a new target pixel after the pixel with the number [2]. In the same manner, the target pixel is sequentially selected in the order of the pixel with the number [4], the pixel with the number [5], and the pixel with the number [6], and whether or not dots are formed is determined for each pixel. To go.

また、図9に示すように、符番[12]の画素について判断した時点で、閾値マトリックスの右端に達してしまうので、符番[13]の画素についてドット形成の有無を判断する際には、閾値マトリックスを右方向に移動させればよい。図9に示した矢印は、閾値マトリックスを移動させる様子を模式的に表現したものである。   Further, as shown in FIG. 9, when the determination is made for the pixel of the number [12], the right end of the threshold matrix is reached. The threshold matrix may be moved in the right direction. The arrows shown in FIG. 9 schematically represent how the threshold matrix is moved.

以上のようにして、ラスタ群に含まれる複数の画素から、所定の順序に従って、対象画素を順次選択しながらドット形成の有無を判断していく。こうすれば、ラスタ1およびラスタ2を並行させながら、ドット形成の有無を判断することができる。   As described above, whether or not dots are formed is determined while sequentially selecting target pixels from a plurality of pixels included in the raster group in a predetermined order. In this way, it is possible to determine whether or not dots are formed while the raster 1 and the raster 2 are parallel.

こうしてラスタ1およびラスタ2に含まれる全ての画素についてドット形成の有無を判断したら、すなわち図8のステップS214において「yes」と判断されたら、今度は、画像データに含まれる全てのラスタの処理を終了したか否かを判断する(ステップS216)。ここでは、ラスタ1およびラスタ2の2つのラスタしか処理しておらず、未だ多数のラスタが未処理のまま残っているので、ステップS216では「no」と判断され、ステップS200に戻って、ラスタ3およびラスタ4を新たなラスタ群を生成する処理を行う。こうして生成した新たなラスタ群についても、同様にして対象画素を選択することにより、ラスタ3およびラスタ4を並行しながらドット形成の有無を判断していく。そして、ラスタ3およびラスタ4について全ての画素について判断を終了したら、今度はラスタ5およびラスタ6を新たなラスタ群として生成し、これらラスタについてドット形成の有無を判断する。画像データに含まれるラスタを全て処理してしまう迄、以上のような一連の処理を繰り返す。そして、全ラスタの処理を終了したら(図8のステップS216:yes)、図8に示した第1実施例の階調数変換処理を抜けた後、図5の画像データ変換処理に復帰する。   When it is determined whether or not dots are formed for all the pixels included in the raster 1 and the raster 2, that is, when “yes” is determined in step S214 in FIG. 8, processing of all the rasters included in the image data is performed. It is determined whether or not the processing has been completed (step S216). Here, only two rasters, raster 1 and raster 2, are processed, and a large number of rasters still remain unprocessed. Therefore, it is determined as “no” in step S216, and the process returns to step S200. 3 and raster 4 are processed to generate a new raster group. For the new raster group generated in this way, by selecting the target pixel in the same manner, it is determined whether or not dots are formed while the raster 3 and the raster 4 are parallel. When the determination for all the pixels for the raster 3 and the raster 4 is completed, the raster 5 and the raster 6 are generated as a new raster group, and the presence or absence of dot formation is determined for these rasters. A series of processes as described above are repeated until all the rasters included in the image data have been processed. When the processing of all rasters is completed (step S216 in FIG. 8: yes), the process returns to the image data conversion process in FIG. 5 after exiting the tone number conversion process in the first embodiment shown in FIG.

以上に説明したように、第1実施例の階調数変換処理によれば、ラスタ群としてまとめられた2本のラスタについて、並行してドット形成の有無を判断することができる。前述したように、画像データ中の近接した画素には、互いに近似した階調値が対応付けられる傾向にあるから、こうして複数のラスタを並行して処理すれば、キャッシュのヒット率、パイプライン処理の効率、あるいは分岐予測の的中率が向上するので、階調数変換処理を迅速に行うことができる。その結果、画像データをドット形成有無による表現形式のデータに迅速に変換することができるので、画像を速やかに印刷することが可能となる。   As described above, according to the tone number conversion process of the first embodiment, the presence or absence of dot formation can be determined in parallel for two rasters collected as a raster group. As described above, adjacent pixels in the image data tend to be associated with tone values that are close to each other. Thus, if multiple rasters are processed in parallel, the cache hit rate, pipeline processing, etc. As a result, the accuracy of branching or the accuracy of branch prediction is improved, so that the gradation number conversion process can be performed quickly. As a result, the image data can be promptly converted into data in an expression format depending on whether or not dots are formed, so that the image can be printed quickly.

B−4.変形例:
以上に説明した第1実施例では、ラスタを2本ずつ、ラスタ群としてまとめるものとして説明したが、2本ではなくより多数のラスタをラスタ群としてまとめることとしても良い。
B-4. Variations:
In the first embodiment described above, two rasters are grouped together as a raster group, but a larger number of rasters may be grouped as a raster group instead of two.

図10(a)は、一例として、ラスタ3本ずつをラスタ群としてまとめている様子を示している。図中で、太い破線で示した矩形は、3本のラスタをラスタ群としてまとめた様子を模式的に示したものである。このように3本のラスタをラスタ群としてまとめた場合も、所定の規則に従って、これらのラスタから対象画素を順次選択してやればよい。こうすれば、これら複数のラスタを並行させてドット形成の有無を判断することができる。例えば、対象画素の番号を3で割ったときの余りに着目して、次のような規則に基づいて対象画素を選択することができる。
<<規則3>>: 対象画素があるラスタの番号が3で割り切れない場合は、左右方向には画素位置を変更することなく、ラスタの番号を1つだけインクリメントさせる。
<<規則4>>: 対象画素があるラスタの番号が3で割り切れる場合は、ラスタ番号を2つだけデクリメントするとともに、画素位置を示す番号は1つだけインクリメントさせる。
この様な規則に基づいて対象画素を順次選択していけば、図10(a)に矢印で示したように、符番[1]の画素、符番[2]の画素、符番[3]の画素、符番[4]の画素と順番に対象画素を選択して、これら画素について順次ドット形成の有無を判断することができる。
FIG. 10A shows a state where three rasters are grouped as a raster group as an example. In the drawing, a rectangle indicated by a thick broken line schematically shows a state in which three rasters are grouped as a raster group. Even when the three rasters are combined as a raster group in this way, the target pixels may be sequentially selected from these rasters according to a predetermined rule. In this way, it is possible to determine whether or not dots are formed by paralleling the plurality of rasters. For example, paying attention to the remainder when the number of the target pixel is divided by 3, the target pixel can be selected based on the following rules.
<< Rule 3 >>: If the number of a raster with a target pixel is not divisible by 3, the raster number is incremented by one without changing the pixel position in the left-right direction.
<< Rule 4 >>: When the number of a raster with a target pixel is divisible by 3, the raster number is decremented by two and the number indicating the pixel position is incremented by one.
If the target pixels are sequentially selected based on such a rule, as indicated by the arrows in FIG. 10A, the pixel with the number [1], the pixel with the number [2], and the number [3 ] And the pixel number [4] are selected in order, and the presence or absence of dot formation can be sequentially determined for these pixels.

また、ラスタ群を構成する複数の画素から対象画素を選択する方法は、上述したものに限られず種々の方法を適用することが可能である。例えば、図10(b)に矢印で示したように、ラスタ群を斜め方向に横切るようにして順次、対象画素を選択することとしても良い。   Further, the method for selecting the target pixel from the plurality of pixels constituting the raster group is not limited to the above-described method, and various methods can be applied. For example, as indicated by arrows in FIG. 10B, the target pixels may be sequentially selected so as to cross the raster group in an oblique direction.

あるいは、ラスタ群を小さなブロックに区分けし、それぞれのブロックを構成する画素を、所定の順番で順次選択することとしても良い。例えば、図10(c)に示した例では、2本のラスタからなるラスタ群を、縦横2画素ずつ合計4画素からなる矩形の小さなブロックに区分けし、各ブロック内の画素を所定の順序で選択する。図10(c)に即して説明すると、初めに[1]と符番された画素を選択し、次に右隣の[2]と符番された画素を選択する。その次は、符番[1]の画素の真下にある[3]と符番された画素を選択し、最後は、その右隣にある[4]と符番された画素を選択する。こうして各ブロック毎にブロック内の画素を順番に選択しても良い。   Alternatively, the raster group may be divided into small blocks, and the pixels constituting each block may be sequentially selected in a predetermined order. For example, in the example shown in FIG. 10C, a raster group consisting of two rasters is divided into small rectangular blocks each consisting of two pixels in the vertical and horizontal directions and a total of four pixels, and the pixels in each block are arranged in a predetermined order. select. Referring to FIG. 10C, the pixel numbered [1] is selected first, and then the pixel numbered [2] on the right is selected. Next, the pixel numbered [3] directly below the pixel numbered [1] is selected, and finally, the pixel numbered [4] next to the right is selected. Thus, the pixels in the block may be selected in order for each block.

また、この様にして各ブロック内の画素を選択すれば、ブロック内で最初に選択した符番[1]からの距離にほぼ対応して、ブロック内の画素を順次選択することができる。画素間の距離が近いほど、近似した階調値が対応付けられている可能性が高くなることから、距離にほぼ対応するようにして画素を順次選択してやれば、キャッシュのヒット率、パイプライン処理の効率、あるいは分岐予測の的中率を向上させることができ、延いては階調数変換処理を高速化することが可能となる。   Further, if the pixels in each block are selected in this way, the pixels in the block can be sequentially selected almost corresponding to the distance from the first selected number [1] in the block. The closer the distance between the pixels, the more likely that the approximate gradation value is associated. Therefore, if the pixels are sequentially selected so as to substantially correspond to the distance, the cache hit rate, pipeline processing Efficiency or the accuracy of branch prediction can be improved, and as a result, the number of gradation conversion processing can be speeded up.

また、図10(c)に示した例示では、初めにラスタ1の画素(図中で[1]および[2]と符番した画素)を全て選択し、その後、ラスタ2の画素(図中で[3]および[4]と符番した画素)を全て選択している。このように、ラスタ群が小さなブロックに区分けされている場合は、ブロック内ではラスタ単位で対象画素を選択することとしてもよい。この様にしても全体として見れば、ラスタ群を構成するラスタを並行して処理することが可能である。   In the example shown in FIG. 10C, first, all the pixels of raster 1 (pixels numbered [1] and [2] in the figure) are selected, and then the pixels of raster 2 (in the figure). All the pixels numbered [3] and [4] are selected. Thus, when the raster group is divided into small blocks, the target pixel may be selected in units of rasters in the block. Even in this way, it is possible to process the rasters constituting the raster group in parallel when viewed as a whole.

C.第2実施例:
上述したように、複数のラスタをラスタ群としてまとめ、各ラスタから対称画素を所定の順序で選択しながら階調数変換処理を行う場合には、画素を選択する順序を考慮しながら閾値マトリックスの閾値を格納することで、処理の高速化を図ることが可能である。以下では、こうした第2実施例の階調数変換処理について説明する。
C. Second embodiment:
As described above, when a plurality of rasters are grouped into a raster group and the gradation number conversion process is performed while selecting symmetric pixels from each raster in a predetermined order, the threshold matrix of the threshold matrix is considered in consideration of the order of selecting pixels. By storing the threshold value, the processing speed can be increased. Hereinafter, the gradation number conversion process of the second embodiment will be described.

C−1.第2実施例の階調数変換処理における閾値の格納方法:
説明の便宜上、閾値マトリックスを構成する各マス目を、次の様に符番する。例えば、閾値(m,n)は、閾値マトリックスのm行n列目のマス目に記憶されている閾値を示すものとする。こうして各マス目を識別することにより、閾値マトリックスに記憶されている複数の閾値を識別することが可能となる。図11は、閾値マトリックスに記憶されている各閾値がこのようにして符番され、識別されている様子を表した説明図である。
C-1. Storage method of threshold in gradation number conversion process of the second embodiment:
For convenience of explanation, the cells constituting the threshold value matrix are numbered as follows. For example, the threshold value (m, n) indicates the threshold value stored in the m-th row and n-th column of the threshold value matrix. By identifying each cell in this way, a plurality of threshold values stored in the threshold value matrix can be identified. FIG. 11 is an explanatory diagram showing how the threshold values stored in the threshold value matrix are numbered and identified in this way.

第2実施例の階調数変換処理では、各ラスタから対称画素を選択する順序を考慮して、閾値マトリックスの各閾値を格納する。以下では、対称画素を図9に示した順序で選択する場合を例にとって、第2実施例の階調数変換処理について説明する。前述したように、図9に示した例では、ラスタ2本ずつをまとめてラスタ群を構成し、対称画素が奇数番目のラスタ上にあるときは、対称画素の直ぐ下の画素を新たな対称画素として選択し(前述の規則1を参照)、対称画素が偶数番目のラスタ上にあるときは、対称画素の直ぐ斜め右上の画素を新たな対称画素として選択する(前述の規則2を参照)。   In the gradation number conversion process of the second embodiment, each threshold value of the threshold value matrix is stored in consideration of the order of selecting symmetric pixels from each raster. In the following, the gradation number conversion process of the second embodiment will be described by taking as an example the case of selecting symmetric pixels in the order shown in FIG. As described above, in the example shown in FIG. 9, when two rasters are combined to form a raster group, and the symmetric pixel is on the odd-numbered raster, the pixel immediately below the symmetric pixel is newly symmetric. Select as a pixel (see Rule 1 above), and if the symmetric pixel is on an even-numbered raster, select the pixel immediately diagonally right above the symmetric pixel as a new symmetric pixel (see Rule 2 above) .

対称画素をこのような順序で選択することに対応して、第2実施例では、閾値マトリックスの閾値を次のような順番で格納する。先ず、閾値マトリックスの1行目と2行目とを組にする。便宜上、以下ではこの組を「ユニットA」と呼ぶことにする。これは、対称画素の選択に際して、隣接するラスタを2本ずつまとめてラスタ群を形成することに対応している。   Corresponding to the selection of the symmetric pixels in this order, the threshold values of the threshold value matrix are stored in the following order in the second embodiment. First, the first row and the second row of the threshold matrix are paired. For convenience, this set will be referred to as “unit A” below. This corresponds to forming a raster group by grouping two adjacent rasters together when selecting a symmetric pixel.

そして、先ず初めに、閾値マトリックスの1行1列目のマス目に記憶されている閾値(1,1)を記憶し、次いでその真下のマス目に記憶されている閾値(2,1)を記録する。これは、対称画素を選択する際の上述した<<規則1>>、すなわち、対称画素が奇数番目のラスタ上にあるときは、直ぐ下の画素を新たな対称画素として選択することに対応している。またハードウェア上では、このことは、コンピュータ100のROM104、あるいはRAM106の所定のアドレスに閾値(1,1)が記憶され、その次のアドレスに閾値(2,1)が記憶されることに相当する。   First, the threshold value (1, 1) stored in the first row and first column of the threshold matrix is stored, and then the threshold value (2, 1) stored in the immediately lower cell is stored. Record. This corresponds to the above-described << Rule 1 >> for selecting a symmetric pixel, that is, when the symmetric pixel is on an odd-numbered raster, the pixel immediately below is selected as a new symmetric pixel. ing. On the hardware side, this corresponds to storing the threshold (1, 1) at a predetermined address of the ROM 104 or RAM 106 of the computer 100 and storing the threshold (2, 1) at the next address. To do.

次いで、2行1列目のマス目の直ぐ右上のマス目に記憶されている閾値(1,2)を記憶する。これは、対称画素を選択する際の上述した<<規則2>>、すなわち、対称画素が偶数番目のラスタ上にあるときは、直ぐ右上の画素を新たな対称画素として選択することに対応している。ハードウェア上では、閾値(2,1)が記憶されているアドレスの次のアドレスに、閾値(1,2)が記憶されることになる。   Next, the threshold value (1, 2) stored in the upper right cell of the second row and first column cell is stored. This corresponds to the above-described << Rule 2 >> when selecting a symmetric pixel, that is, when the symmetric pixel is on an even-numbered raster, the pixel immediately above right is selected as a new symmetric pixel. ing. On the hardware, the threshold (1, 2) is stored at the address next to the address where the threshold (2, 1) is stored.

閾値(2,1)を記憶したら、再び規則1に対応して直ぐ下のマス目の閾値(1,2)を記憶し、次いで規則2の対応させて閾値(2,2)を記憶する。以下、同様にして、閾値(1,3)、閾値(2,3)、閾値(1,4)と順次記憶していく。こうして、閾値マトリックスの1行目および2行目(すなわちユニットA)に含まれている閾値をすべて記憶したら、今度は3行目の閾値と4行目の閾値とをまとめて「ユニットB」を形成する。そして、ユニットBに含まれる閾値についても、規則1および規則2に対応させた順序で順次記憶していく。すなわち、先ず初めにユニットBの左上隅のマス目に記憶されている閾値(3,1)を記憶し、次いで、その真下のマス目の閾値(4,1)を記憶する。更に直ぐ右上のマス目の閾値(3,2)を記憶し、以下同様に、閾値(4,2)、閾値(3,3)と順次記憶していく。こうして、ユニットBに含まれるすべての閾値を記憶し終わったら、今度は、閾値マトリックスの5行目の閾値および6行目の閾値を「ユニットC」としてまとめ、ユニットCに含まれる閾値も同様にして順次記憶していく。   After storing the threshold value (2, 1), the threshold value (1, 2) immediately below corresponding to rule 1 is stored again, and then the threshold value (2, 2) is stored corresponding to rule 2. Hereinafter, similarly, the threshold value (1, 3), the threshold value (2, 3), and the threshold value (1, 4) are sequentially stored. Thus, when all the threshold values included in the first and second rows (that is, unit A) of the threshold matrix are stored, this time, the threshold values in the third row and the fourth row are combined into “unit B”. Form. The threshold values included in the unit B are also stored sequentially in the order corresponding to the rules 1 and 2. That is, first, the threshold value (3, 1) stored in the upper left corner of the unit B is stored, and then the threshold value (4, 1) of the lower right cell is stored. Further, the threshold value (3, 2) of the upper right cell is stored immediately, and the threshold value (4, 2) and threshold value (3, 3) are sequentially stored in the same manner. When all the threshold values included in unit B have been stored in this way, the threshold values in the threshold matrix are summarized as “unit C” and the threshold values included in unit C are the same. And memorize sequentially.

図12(a)は、このように閾値マトリックスを2行ずつの3つのユニットに区分けし、ユニット内では規則1および規則2を反映させながら、閾値を順次記憶する様子を模式的に示した説明図である。図中でカギ括弧内に示した数字は、閾値が記憶される番数を示している。例えば、閾値マトリックスのマス目に示された[5]という表示は、そのマス目の閾値が、すべての閾値の中で5番目に記憶されることを示している。図12(b)は、コンピュータ100のROM104あるいはRAM106上で、これら閾値が連続したアドレスに順次記憶されている様子を模式的に示している。   FIG. 12A schematically illustrates how the threshold value matrix is divided into three units each having two rows, and the threshold values are sequentially stored while reflecting the rules 1 and 2 in the unit. FIG. The numbers shown in the brackets in the figure indicate the numbers in which the threshold values are stored. For example, the display [5] shown in the square of the threshold matrix indicates that the threshold of the square is stored fifth in all the thresholds. FIG. 12B schematically shows how these threshold values are sequentially stored at consecutive addresses on the ROM 104 or RAM 106 of the computer 100.

C−2.第2実施例の階調数変換処理:
このように、複数のラスタをラスタ群としてまとめ、各ラスタを並行させながら画像データの階調数を変換する場合には、各ラスタから対称画素を選択する順序を考慮しながら閾値マトリックスの閾値を格納することで、階調数変換処理を迅速に行うことができる。以下では、図8および図9を流用しながら第2実施例の階調数変換処理について説明する。
C-2. Tone number conversion processing of the second embodiment:
In this way, when a plurality of rasters are combined into a raster group and the number of gradations of image data is converted while paralleling each raster, the threshold matrix threshold is set in consideration of the order of selecting symmetric pixels from each raster. By storing, gradation number conversion processing can be performed quickly. Hereinafter, the tone number conversion process of the second embodiment will be described with reference to FIGS. 8 and 9.

図8のフローチャートを用いて前述したように、第2実施例の階調数変換処理においても、先ず初めに隣接する所定のN本のラスタをラスタ群としてまとめる(図8のステップS200相当)。そして、ラスタ群を構成する複数の画素の中から、所定の順番に従って対称画素を順次選択し、対称画素の階調値と閾値とを比較して対称画素にドットを形成するか否かを判断する処理を、繰り返し行う(図8のステップS202ないしステップS214相当)。ラスタ群に含まれるすべての画素についてドット形成の有無を判断したら(ステップS214:yesに相当)、新たなラスタ群を生成して(ステップS200相当)、新たなラスタ群の各画素について同様の処理を繰り返す。こうして画像データに含まれるすべてのラスタについて処理を完了するまで、同様の処理を繰り返す。   As described above with reference to the flowchart of FIG. 8, also in the tone number conversion process of the second embodiment, first, predetermined adjacent N rasters are first collected as a raster group (corresponding to step S200 of FIG. 8). Then, a symmetric pixel is sequentially selected from a plurality of pixels constituting the raster group in a predetermined order, and the gradation value of the symmetric pixel is compared with a threshold value to determine whether or not to form a dot on the symmetric pixel. This process is repeated (equivalent to step S202 to step S214 in FIG. 8). When it is determined whether or not dots are formed for all pixels included in the raster group (corresponding to step S214: yes), a new raster group is generated (corresponding to step S200), and the same processing is performed for each pixel of the new raster group. repeat. The same process is repeated until the process is completed for all rasters included in the image data.

一例として、隣接するラスタを2本ずつラスタ群としてまとめ、前述した規則1および規則2に従って、ラスタ群に含まれる複数の画素から対称画素を順次選択した場合は、図9に模式的に示すようにして階調数変換処理が行われる。すなわち、先ず初めに、ラスタ1の左端の画素(図9中で[1]と符番された画素)について階調値と閾値とが読み出され、これらの大小関係に基づいてドットを形成するか否かが判断される。次いで、図9中で[2]と符番された画素について階調値と閾値とが読み出され、ドット形成の有無が判断される。以下、同様にして[3]、[4]、[5]と符番された画素について、それぞれ階調値と閾値とが読み出されてドット形成有無が判断される。   As an example, when two adjacent rasters are grouped into a raster group and symmetric pixels are sequentially selected from a plurality of pixels included in the raster group according to the rules 1 and 2, the schematic diagram shown in FIG. Thus, the gradation number conversion process is performed. That is, first, the gradation value and the threshold value are read for the leftmost pixel of the raster 1 (the pixel numbered as [1] in FIG. 9), and dots are formed based on the magnitude relationship between them. It is determined whether or not. Next, the gradation value and the threshold value are read out for the pixel numbered [2] in FIG. 9, and it is determined whether or not dots are formed. In the same manner, for the pixels numbered [3], [4], and [5], the gradation value and the threshold value are read out to determine whether or not dots are formed.

ここで画像データは、実際にはコンピュータ100のRAM106上に記憶されているから、符番[1]の画素、符番[2]の画素、符番[3]の画素と階調値を読み出すためには、CPU102は階調値を読み出す度にアドレス計算を行って、RAM106上でこれら画素の階調値が記憶されているアドレス値を算出する必要がある。これに対して、閾値については、対象画素が選択される順序を考慮して予め記憶されているから、閾値を読み出すために複雑なアドレス計算を行う必要がない。例えば、図9に示す順序で対象画素が選択されることを考慮して、図12に示したように閾値マトリックスの各閾値を記憶しておけば、図9上で符番[1]の閾値が記憶されているアドレスを求めてやれば、それ以降はアドレス値を1つずつインクリメントするだけで、符番[2]から符番[12]までの画素の閾値を順次読み出すことができる。すなわち、図12に示したユニットAの閾値を先頭から順番に読み出すだけで、各画素に対応した閾値を読み出すことができる。   Here, since the image data is actually stored in the RAM 106 of the computer 100, the pixel number [1], the pixel number [2], the pixel number [3] and the gradation value are read out. For this purpose, the CPU 102 needs to calculate an address every time the gradation value is read, and calculate an address value in which the gradation value of these pixels is stored on the RAM 106. On the other hand, since the threshold value is stored in advance in consideration of the order in which the target pixel is selected, it is not necessary to perform complicated address calculation in order to read the threshold value. For example, if each threshold value of the threshold value matrix is stored as shown in FIG. 12 in consideration that the target pixel is selected in the order shown in FIG. 9, the threshold value of the number [1] in FIG. If the address at which the number is stored is obtained, the threshold values of the pixels from the number [2] to the number [12] can be sequentially read out by simply incrementing the address value one by one thereafter. That is, the threshold value corresponding to each pixel can be read by simply reading the threshold values of the unit A shown in FIG.

また、符番[13]の画素については、前述したように閾値マトリックスの位置を画像データに対してラスタ方向に移動させる結果、符番[1]の画素と同じ閾値が使用される。従って、符番[13]の画素の閾値は、符番[1]についての閾値が記憶されているアドレスから読み出せばよい。それ以降は同様にして、アドレス値を1つずつインクリメントしながら、ユニットAの閾値を順番に読み出すことで、符番[14]から符番[24]までの画素の閾値を順次読み出すことができる。これ以降の画素についても全く同様にして閾値を読み出すことができ、結局、ラスタ1およびラスタ2からなるラスタ群を処理している間は、ユニットAの閾値を繰り返し読み出すだけで各画素についての閾値を読み出すことができる。   As for the pixel with the code number [13], as described above, the threshold value of the pixel with the code number [1] is used as a result of moving the position of the threshold value matrix in the raster direction with respect to the image data. Therefore, the threshold value of the pixel of the code number [13] may be read from the address where the threshold value for the code number [1] is stored. Thereafter, similarly, the threshold values of the pixels from the number [14] to the number [24] can be sequentially read by sequentially reading out the threshold values of the unit A while incrementing the address value one by one. . The threshold values can be read out for the subsequent pixels in exactly the same manner. As a result, while the raster group consisting of raster 1 and raster 2 is being processed, the threshold value for each pixel is simply read out repeatedly. Can be read out.

ラスタ1およびラスタ2に含まれる画素をすべて処理したら、今度はラスタ3およびラスタ4をラスタ群としてまとめ、対象画素を順次選択して、各画素の階調値と閾値とを読み出しながらドット形成の有無を判断する。ここで、対象画素の閾値は、図12を用いて前述した閾値マトリックスのユニットBの閾値を繰り返し読み出すだけでよい。ラスタ3およびラスタ4の画素をすべて処理したら、今度はラスタ5およびラスタ6をラスタ群としてまとめ、今度は閾値マトリックスのユニットCの閾値を繰り返し読み出しながら、各画素についての階調数変換処理を行う。こうして、ラスタ5およびラスタ6についての処理を終了したら、ラスタ7およびラスタ8をラスタ群としてまとめて、再びユニットAの閾値を繰り返し読み出しながら各画素についての階調数変換処理を行う。以降のラスタにつても全く同様にして、閾値マトリックスの各ユニットから、繰り返し閾値を読み出して行けばよい。   After all the pixels included in raster 1 and raster 2 have been processed, this time, raster 3 and raster 4 are combined into a raster group, the target pixels are sequentially selected, and dot formation is performed while reading out the gradation value and threshold value of each pixel. Judgment is made. Here, as the threshold value of the target pixel, it is only necessary to repeatedly read the threshold value of the unit B of the threshold value matrix described above with reference to FIG. When all the pixels of the raster 3 and the raster 4 are processed, the raster 5 and the raster 6 are collected as a raster group, and the gradation number conversion process is performed for each pixel while reading the threshold value of the unit C of the threshold value matrix this time. . Thus, when the processing for the rasters 5 and 6 is completed, the rasters 7 and 8 are collected as a raster group, and the gradation number conversion processing for each pixel is performed while repeatedly reading out the threshold value of the unit A again. It is sufficient to read out the threshold value repeatedly from each unit of the threshold value matrix in the same manner for the subsequent rasters.

図13は、コンピュータ100のROM104あるいはRAM106上に記憶されている閾値マトリックスの閾値を、ユニット毎に繰り返し読み出している様子を模式的に示した説明図である。図示するように、閾値マトリックスの閾値は、ユニットA、ユニットB、ユニットCの各ユニットに分けて記憶されており、そして各ユニット内では各閾値は、階調数変換処理中で対象画素を選択する順序を考慮した所定の順番で、連続したアドレスに記憶されている。   FIG. 13 is an explanatory diagram schematically showing how the threshold values of the threshold value matrix stored in the ROM 104 or RAM 106 of the computer 100 are repeatedly read for each unit. As shown in the figure, threshold values in the threshold matrix are stored separately for each of unit A, unit B, and unit C, and within each unit, each threshold value selects the target pixel during the gradation number conversion process. Are stored in consecutive addresses in a predetermined order considering the order in which they are to be performed.

コンピュータ100のプリンタドライバが、ラスタ1およびラスタ2のラスタ群の階調数変換処理を行っている間は、図13の細い実線の矢印で示したように、ユニットA内に記憶されている閾値を順番に繰り返し読み出して使用する。階調数変換処理を行うラスタ群が、ラスタ3およびラスタ4からなるラスタ群に移った場合は、図中に細い破線の矢印で示したように、ユニットB内に記憶されている閾値を順番に繰り返し読み出して使用し、処理するラスタ群が、ラスタ5およびラスタ6からなるラスタ群に移った場合は、図中に細い一点鎖線の矢印で示したように、ユニットC内に記憶されている閾値を順番に繰り返し読み出して使用する。次いで、処理するラスタ群がラスタ7およびラスタ8からなるラスタ群に移った場合には、図中に太い実線の矢印で示したように、再び先頭のアドレス値に戻って、ユニットA内に記憶されている閾値を順番に繰り返し読み出して使用する。以降、画像データに含まれる全画素について階調数変換処理を終了するまで、同様にしてユニット内の閾値を読み出していけばよい。   While the printer driver of the computer 100 is performing the tone number conversion processing of the raster groups of raster 1 and raster 2, the threshold value stored in unit A is indicated by the thin solid arrow in FIG. Are used repeatedly in order. When the raster group that performs the tone number conversion process moves to a raster group consisting of the raster 3 and the raster 4, the threshold values stored in the unit B are set in order as indicated by the thin dashed arrows in the figure. When the raster group to be repeatedly read, used, and processed shifts to the raster group consisting of the raster 5 and the raster 6, it is stored in the unit C as indicated by the thin dashed line arrow in the figure. The threshold value is repeatedly read in order and used. Next, when the raster group to be processed moves to the raster group consisting of the raster 7 and the raster 8, as shown by the thick solid line arrow in the figure, the head address value is returned again and stored in the unit A. The read threshold values are repeatedly read in order and used. Thereafter, the threshold value in the unit may be read in the same manner until the tone number conversion process is completed for all the pixels included in the image data.

以上に説明したように、第2実施例の階調数変換処理においては、対象画素を選択する順序を考慮して、閾値マトリックスの各閾値を適切な順番で記憶しておく。こうすることで、ドット形成有無を判断するに際して、対象画素に対応する閾値を読み出すための複雑なアドレス計算を行うことなく、閾値を読み出してドット形成有無を判断することが可能となる。そのため、第2実施例の階調数変換処理では、迅速な変換を行うことが可能となっている。   As described above, in the tone number conversion process of the second embodiment, the threshold values of the threshold value matrix are stored in an appropriate order in consideration of the order of selecting the target pixels. In this way, when determining the presence or absence of dot formation, it is possible to determine the presence or absence of dot formation by reading the threshold without performing complicated address calculation for reading the threshold corresponding to the target pixel. Therefore, in the gradation number conversion process of the second embodiment, it is possible to perform a quick conversion.

以上の説明では、対象画素を図9に示した順番で選択する場合、すなわち、ラスタを2本ずつまとめてラスタ群を構成し、前述した<<規則1>>および<<規則2>>に従って、対象画素を順次選択する場合を例にとって説明した。もちろん、ラスタ群を構成するラスタの本数や、対象画素を選択する順番が異なれば、これに応じて閾値マトリックスの各閾値を記憶する順序も異なったものとなる。   In the above description, when the target pixels are selected in the order shown in FIG. 9, that is, two rasters are combined to form a raster group, and according to the above-described << Rule 1 >> and << Rule 2 >>. The case where the target pixels are sequentially selected has been described as an example. Of course, if the number of rasters constituting the raster group and the order in which the target pixels are selected are different, the order in which the threshold values are stored in the threshold value matrix will be different accordingly.

例えば、対象画素を選択する順番が、図10(b)に示すようなものである場合は、閾値マトリックスの閾値は、図14(a)に示す順序で記憶しておけばよい。すなわち、図10(b)において3本のラスタでラスタ群を構成していることに対応して、閾値マトリックスを3行ずつの2つのユニットにまとめる。そして、対象画素を選択する順序に合わせて、ユニットを斜めに横切るような順番で各閾値を記憶すればよい。ここで、図14中でカギ括弧内に示した数字は、閾値を記憶する順番を示している。また、対象画素を図10(c)に示すような順番で選択している場合は、図14(b)に示すように、閾値マトリックスを2行ずつユニットにまとめて、対象画素を選択する順序に合わせて各閾値を記憶しておけばよい。   For example, if the order of selecting the target pixel is as shown in FIG. 10B, the threshold values in the threshold matrix may be stored in the order shown in FIG. That is, the threshold value matrix is grouped into two units of three rows in correspondence with the fact that a raster group is formed by three rasters in FIG. Then, the threshold values may be stored in an order that crosses the unit diagonally according to the order in which the target pixels are selected. Here, the numbers shown in square brackets in FIG. 14 indicate the order in which the threshold values are stored. When the target pixels are selected in the order shown in FIG. 10C, the threshold matrix is grouped into units of two rows and the target pixels are selected as shown in FIG. 14B. Each threshold value may be stored in accordance with.

また、以上の説明では、対象画素を選択する順序と、各閾値を記憶する順序とが完全に一致する場合について説明しているが、これらの順番は必ずしも完全に一致している必要はなく、多少であれば、順番にずれが生じていても構わない。例えば、対象画素を選択する順番が、図10(c)に示すようなものである場合に、閾値マトリックスの各閾値を、図12(a)に示す順番で記憶しておくこととしても良い。図10(c)と図12(a)とを比較すれば明らかなように、対象画素を選択する順番と閾値を記憶する順番とは、符番[2]の画素と符番[3]の画素との間で順番が入れ替わった関係にある。同様に、符番[6]の画素と符番[7]の画素とについても順番が入れ替わっている。このように、符番の数字を4で割ったときに余りが2となる画素と、余りが3となる画素とで、対象画素を選択する順番と閾値を記憶する順番とが入れ替わっているが、その他の画素については一致している。この様な場合、閾値マトリックスに閾値が記憶される順序が、対象画素を選択する順序と完全には一致していないにもかかわらず、複雑なアドレス計算を行うことなく閾値を読み出すことが可能である。例えば、対象画素の順番を4で割ったときに余りが2になれば、一つ後ろの順番の閾値を読み出し、また、対象画素の順番を4で割ったときに余りが3になれば、一つ前の順番の閾値を読み出すことによって、対象画素に対応する閾値を簡便に読み出すことができる。あるいは、1つ1つの閾値を順番に読み出すのではなく、例えば4つずつまとめて読み出しておき、これらの4つの閾値の中から適切な閾値を選択することとしても良い。いずれにしても、閾値マトリックスに閾値を記憶する順番は、対象画素を選択する順番を考慮した順番であれば足り、閾値を記憶する順番と対象画素を選択する順番とは完全には一致している必要はない。   Further, in the above description, the case where the order of selecting the target pixel and the order of storing the respective threshold values are completely matched is described, but these orders do not necessarily need to be completely matched, If there is some difference, there may be a deviation in order. For example, when the order in which the target pixel is selected is as shown in FIG. 10C, the threshold values in the threshold matrix may be stored in the order shown in FIG. As is apparent from a comparison between FIG. 10C and FIG. 12A, the order of selecting the target pixel and the order of storing the threshold values are the number [2] pixel and the number [3]. The order is changed with the pixels. Similarly, the pixel number [6] and the pixel number [7] are switched in order. As described above, the order in which the target pixel is selected and the order in which the threshold value is stored are switched between the pixel in which the remainder is 2 when the number of the number is divided by 4 and the pixel in which the remainder is 3. The other pixels are the same. In such a case, it is possible to read out the threshold values without performing complicated address calculation even though the order in which the threshold values are stored in the threshold value matrix does not completely match the order in which the target pixels are selected. is there. For example, if the remainder is 2 when the order of the target pixel is divided by 4, the threshold of the next order is read, and if the remainder is 3 when the order of the target pixel is divided by 4, By reading the previous threshold value, the threshold value corresponding to the target pixel can be easily read. Alternatively, instead of sequentially reading out the threshold values one by one, for example, four threshold values may be read together and an appropriate threshold value selected from these four threshold values. In any case, the order in which the threshold values are stored in the threshold matrix may be an order that considers the order in which the target pixels are selected, and the order in which the threshold values are stored and the order in which the target pixels are selected are completely the same. There is no need to be.

このように、第2実施例の階調数変換処理においては、ラスタ群に含まれる複数の画素の中から対象画素を選択する順序を考慮しながら、閾値マトリックスの各閾値を適切な順番で格納しておく。こうすれば、複雑なアドレス計算を行うことなく、対応する閾値を次々と読み出すことが可能となり、階調数変換処理を迅速に行うことができる。   As described above, in the tone number conversion process of the second embodiment, the threshold values in the threshold matrix are stored in an appropriate order while considering the order of selecting the target pixel from the plurality of pixels included in the raster group. Keep it. In this way, it is possible to read out the corresponding threshold values one after another without performing complicated address calculation, and the gradation number conversion process can be performed quickly.

また、第2実施例の階調数変換処理においては、前述した第1実施例と同様に、複数のラスタをラスタ群としてまとめ、対象画素を所定の順序で選択することで、各ラスタを並行して処理している。このため、第1実施例と同様に、キャッシュのヒット率や、パイプライン処理の効率、分岐予測の的中率が向上するので、このことによる処理速度の高速化も図ることができる。   Further, in the tone number conversion process of the second embodiment, as in the first embodiment described above, a plurality of rasters are grouped as a raster group, and the target pixels are selected in a predetermined order, whereby each raster is parallelized. And processing. For this reason, as in the first embodiment, the cache hit rate, the efficiency of pipeline processing, and the predictive hit rate are improved, so that the processing speed can be increased.

もっとも、こうしたキャッシュのヒット率や、パイプライン処理の効率、分岐予測の的中率が向上する現象は、画像データ中で近接した画素の階調値には互いに近似した値となる傾向があるという事実によるものである。従って、ラスタ群を構成するラスタの本数があまりに多くなると、ラスタ群内の画素についても互いの階調値が近似した値を取らなくなるので、キャッシュのヒット率や、パイプライン処理の効率、分岐予測の的中率が向上する度合いは小さくなり、処理速度を高速化できる程度も少なくなってしまう。しかし、第2実施例の階調数変換処理のように、対象画素を選択する順序を考慮して閾値マトリックスの各閾値を格納しておけば、例えキャッシュのヒット率や、パイプライン処理の効率、分岐予測の的中率を向上させることができない場合でも、依然として迅速に階調数変換処理を行うことができる。   However, the phenomenon of improving the cache hit rate, pipeline processing efficiency, and branch prediction hit rate tends to be similar to the tone values of adjacent pixels in the image data. It is due to the facts. Therefore, if the number of rasters constituting the raster group becomes too large, the gradation values of the pixels in the raster group cannot be approximated. Therefore, the cache hit rate, the efficiency of pipeline processing, and branch prediction The degree of improvement in the hit rate is reduced, and the degree to which the processing speed can be increased is reduced. However, if each threshold value of the threshold value matrix is stored in consideration of the order of selecting the target pixel as in the gradation number conversion process of the second embodiment, for example, the cache hit rate and the efficiency of the pipeline process are stored. Even when the accuracy of branch prediction cannot be improved, the gradation number conversion process can still be performed quickly.

更に、第2実施例の階調数変換処理は、次のような場合にも処理速度を効果的に向上させることができる。例えば、JPEG形式で圧縮された画像データを解凍する場合は、ラスタ1本ずつ解凍されるのではなく、8画素×8画素をひとまとまりとして、各画素の階調値のデータに展開される。従って、こうして展開された階調値をラスタの順番に並べ換えることなく、そのままの順序で、換言すれば、これらひとかたまりのデータを8行8列の複数の画素に展開した順序のまま、各画素についての階調数変換処理を行えば、処理を高速化することができる。このとき、これら8行8列をひとまとまりとする複数の画素には、毎回同じ順序で階調値が展開される。従って、第2の階調数変換処理においては、これら複数の画素に階調値が順次展開される順番を考慮して、閾値マトリックスの各閾値を適切な順番で格納しておけば、処理速度の更なる向上を図ることができる。具体的には、閾値マトリックスを8行ずつのユニットにまとめ、各ユニット内を更に8行8列のブロックに区分する。そして、ブロック内の閾値を、圧縮された画像データが展開される順序に従って記憶してやる。こうすれば、各画素に展開されたデータをそのままの順序で階調数変換処理を行う際に、複雑なアドレス計算を行うことなく閾値を読み出すことができるので、処理をより一層迅速に行うことが可能となる。   Furthermore, the gradation number conversion process of the second embodiment can effectively improve the processing speed even in the following cases. For example, when decompressing image data compressed in the JPEG format, the raster data is not decompressed one by one, but is expanded into gradation value data of each pixel by taking 8 pixels × 8 pixels as a group. Therefore, the gradation values developed in this way are not rearranged in the order of the raster, but in the order as they are, in other words, in the order in which these pieces of data are developed into a plurality of pixels of 8 rows and 8 columns, If the tone number conversion process is performed for the above, the processing speed can be increased. At this time, the gradation values are developed in the same order each time for a plurality of pixels of 8 rows and 8 columns. Accordingly, in the second gradation number conversion process, if the threshold values in the threshold matrix are stored in an appropriate order in consideration of the order in which the gradation values are sequentially developed in the plurality of pixels, the processing speed is increased. Can be further improved. Specifically, the threshold matrix is grouped into units of 8 rows, and each unit is further divided into blocks of 8 rows and 8 columns. Then, the threshold values in the block are stored in the order in which the compressed image data is expanded. In this way, the threshold value can be read out without performing complicated address calculation when performing the gradation number conversion processing on the data developed in each pixel in the same order, so that the processing can be performed more quickly. Is possible.

以上の説明は、画像データがJPEG形式で圧縮されている場合を例に取って説明したが、同様の理由で処理の高速化が可能なケースは他にも種々存在する。例えば、画像データの解像度に対してプリンタの印刷解像度の方が高いために、補間演算を行って1画素の画像データから、縦方向にn画素、横方向にm画素分の画像データを生成する場合には、これらn行m列の複数の画素をひとまとまりとして処理してやることで処理の迅速化を図ることができ、閾値マトリックスの各閾値をこれらの画素を処理する順序を考慮して記憶してやれば、処理速度をより一層迅速化することが可能となる。   In the above description, the case where the image data is compressed in the JPEG format has been described as an example. However, there are various other cases where the processing speed can be increased for the same reason. For example, since the printing resolution of the printer is higher than the resolution of the image data, interpolation calculation is performed to generate image data for n pixels in the vertical direction and m pixels in the horizontal direction from the image data of one pixel. In this case, the processing can be speeded up by processing a plurality of pixels of n rows and m columns as a group, and the threshold values in the threshold matrix can be stored in consideration of the order of processing these pixels. Thus, the processing speed can be further increased.

C−3.変形例:
前述したように、閾値マトリックスのサイズは画像データのサイズよりも小さいので、すべての画素についてドット形成の有無を判断するために、閾値マトリックスは画像データに対して位置を移動させながら繰り返し使用される。上述した各種の実施例では、閾値マトリックスをいずれもラスタに沿った方向に移動させている。このように移動させた場合、一つのラスタに着目すると、閾値マトリックスの同じ部分の閾値が繰り返し使用されることになる。このため、画像データによっては同一ラスタ内のドット形成に一定のパターンが発生が生じることになる。これは、特にラスタごとにばらつき要素を有する出力機器、例えばラスタを任意のノズルを用いて印画するのではなく、結果として特定のラスタを特定のノズルの組合せを用いて印画するシリアル走査のインクジェットプリンタなどに出力した場合、特定のノズルのドット着弾位置にばらつきがあると、それがラスタ方向の一定のパターンと重なって、出力画質を悪化させてしまうことがあった。このような問題の発生を回避するためには、画像データに対して閾値マトリックスを移動させる際に、ラスタの方向に完全に一致させて移動させるのではなく、ラスタ方向に対して少し傾きを持たせて移動させることが効果的である。こうすれば、ひとつのラスタに着目した場合、閾値マトリックスの位置を移動させる度に、マトリックス中の少しずつ異なる部分に記憶された閾値が使用されることになる。従って、ドットの形成に一定のパターンが発生することを確実に回避することが可能である。
C-3. Variations:
As described above, since the size of the threshold matrix is smaller than the size of the image data, the threshold matrix is repeatedly used while moving the position with respect to the image data in order to determine the presence or absence of dot formation for all pixels. . In the various embodiments described above, the threshold value matrix is moved in the direction along the raster. When moving in this way, focusing on one raster, the threshold value of the same part of the threshold value matrix is repeatedly used. For this reason, a certain pattern occurs in dot formation in the same raster depending on image data. This is particularly an output device having a variation element for each raster, for example, a serial scanning inkjet printer that prints a specific raster using a specific combination of nozzles instead of printing the raster using an arbitrary nozzle. When there is a variation in the dot landing position of a specific nozzle, it may overlap with a certain pattern in the raster direction and deteriorate the output image quality. In order to avoid the occurrence of such a problem, when the threshold value matrix is moved with respect to the image data, the threshold value matrix has a slight inclination with respect to the raster direction instead of being moved so as to completely coincide with the raster direction. It is effective to move it. In this way, when focusing on one raster, each time the position of the threshold matrix is moved, threshold values stored in slightly different portions of the matrix are used. Therefore, it is possible to reliably avoid the occurrence of a certain pattern in the formation of dots.

上述した第2実施例の階調数変換処理では、閾値マトリックスを複数のユニットに区分けし、各ユニットに含まれる閾値を適切な順序で記憶しているが、閾値マトリックスを移動させる度に、マトリックスをラスタと交差する方向にもずらすこととして、このずらし量を適切な値に設定することで、階調数変換処理をより一層迅速に行うことが可能である。以下では、こうした第2実施例の変形例について説明する。   In the gradation number conversion process of the second embodiment described above, the threshold value matrix is divided into a plurality of units, and the threshold values included in each unit are stored in an appropriate order. By shifting this in the direction intersecting with the raster and setting this shift amount to an appropriate value, the tone number conversion process can be performed more rapidly. Below, the modification of such 2nd Example is demonstrated.

図15(a)は、閾値マトリックスを画像データに対して相対的に移動させながら、1つのマトリックスを繰り返し用いて階調数変換処理を行う様子を示している。図中に、細い破線で示した小さな矩形は画素を模式的に示したものであり、太い破線は閾値マトリックスを模式的に示している。また、ここでは、ラスタ群は2本のラスタによって構成され、ラスタを2本ずつ並行させながら階調数変換処理を行うものとする。図15(a)中で、ラスタ1およびラスタ2に付したハッチングは、これらラスタをラスタ群としてまとめて階調数変換処理を行っていることを表したものである。   FIG. 15A shows a state in which the tone number conversion process is performed by repeatedly using one matrix while moving the threshold value matrix relative to the image data. In the drawing, a small rectangle indicated by a thin broken line schematically shows a pixel, and a thick broken line schematically shows a threshold matrix. Here, it is assumed that the raster group is composed of two rasters, and the tone number conversion process is performed while the two rasters are arranged in parallel. In FIG. 15A, the hatching given to the raster 1 and the raster 2 represents that the gradation number conversion processing is performed by collecting these rasters as a raster group.

図15(a)に示した階調数変換処理では、閾値マトリックスをラスタに沿って移動させる際に、ラスタと交差する方向にもラスタ2本分だけずらしながら移動させる。より一般的に表現すれば、ラスタ群を構成するラスタ本数をN本としたときに、ラスタの上方向あるいは下方向に、Nの整数倍に相当するラスタ本数だけずらしながら閾値マトリックスを移動させる。図15(a)中に示した矢印は、ラスタ2本分ずつずらしながら閾値マトリックスを移動させている様子を模式的に表したものであり、これは、特にラスタ群を構成するラスタの本数と、閾値マトリックスのずらし量(閾値マトリックスがずれていくラスタ本数)とが一致している場合を例示している。このように、閾値マトリックスのずらし量を、ラスタ群を構成するラスタ本数の整数倍としておけば、階調数変換処理を迅速に行うことが可能である。以下では、図15の例示を参照しながらこの理由について説明する。   In the tone number conversion process shown in FIG. 15A, when the threshold value matrix is moved along the raster, the threshold value matrix is moved while being shifted by two rasters in the direction intersecting the raster. In more general terms, when the number of rasters constituting a raster group is N, the threshold value matrix is moved while being shifted by the number of rasters corresponding to an integral multiple of N in the upward or downward direction of the raster. The arrows shown in FIG. 15 (a) schematically show how the threshold value matrix is moved while shifting by two rasters. This is particularly true with the number of rasters constituting the raster group. The case where the shift amount of the threshold value matrix (the number of rasters to which the threshold value matrix shifts) matches is illustrated. In this way, if the shift amount of the threshold matrix is set to an integral multiple of the number of rasters constituting the raster group, the gradation number conversion process can be performed quickly. Hereinafter, this reason will be described with reference to the example of FIG.

前述したように、第2実施例の階調数変換処理では、閾値マトリックスの閾値は、対象画素を選択する順序を考慮して、ユニット毎に適切な順序で記憶されている。ここでは、図15(b)に示すように、ユニットAないしユニットCの3つのユニットに区分されて、コンピュータ100のメモリ上の連続したアドレスに記憶されている。   As described above, in the gradation number conversion process of the second embodiment, the threshold values of the threshold value matrix are stored in an appropriate order for each unit in consideration of the order of selecting the target pixel. Here, as shown in FIG. 15 (b), it is divided into three units, unit A to unit C, and stored in consecutive addresses on the memory of the computer 100.

画像データの階調数変換処理を開始すると、先ず初めは、閾値マトリックスのユニットAに含まれる閾値を読み出しながら、各画素についてのドット形成の有無を判断する。ユニットAの閾値はドット形成の有無を判断する順序を考慮して予め適切な順序で記憶されているから、アドレス値を1つずつインクリメントさせながら読み出すだけで適切な閾値を順次読み出すことができる。   When the gradation number conversion process of image data is started, first, the presence or absence of dot formation for each pixel is determined while reading the threshold value included in the unit A of the threshold value matrix. Since the threshold value of the unit A is stored in advance in an appropriate order in consideration of the order of determining the presence / absence of dot formation, the appropriate threshold value can be read sequentially by simply reading while incrementing the address value one by one.

ユニットA内の閾値を全て読み出してしまっても、処理中のラスタには未処理の画素が残っているから、閾値マトリックスを画像データに対して移動させて、これらの画素についてドット形成有無を判断する処理を継続する。ここで、図15(a)に示すように、閾値マトリックスをラスタ方向に移動させるに際して、ラスタと交差する方向にラスタ2本分だけずれた位置に移動させる。閾値マトリックスのずらし量をラスタ2本分としているのは、ラスタ群が2本のラスタから構成されていることに対応する。こうして閾値マトリックスをずらしてやれば、処理中のラスタ群に対応するユニットがずれるので、続く画素のドット形成有無を判断するために読み出す閾値は、ユニットBの中から読み出すことになる。ここで、ユニットB内の閾値についても、ドット形成の有無を判断する順序を考慮して予め適切な順序で記憶されているから、アドレス値を1つずつインクリメントさせるだけで適切な閾値を順次読み出すことができる。   Even if all the threshold values in unit A are read out, unprocessed pixels remain in the raster being processed, so the threshold value matrix is moved relative to the image data, and the presence or absence of dot formation is determined for these pixels. Continue processing. Here, as shown in FIG. 15A, when the threshold value matrix is moved in the raster direction, it is moved to a position shifted by two rasters in the direction intersecting the raster. The shift amount of the threshold value matrix corresponding to two rasters corresponds to the fact that the raster group is composed of two rasters. If the threshold value matrix is shifted in this way, the unit corresponding to the raster group being processed shifts, so that the threshold value to be read for determining the dot formation of the subsequent pixels is read from the unit B. Here, the threshold values in the unit B are also stored in advance in an appropriate order in consideration of the order in which the presence / absence of dot formation is determined. Therefore, the appropriate threshold values are sequentially read out by incrementing the address value one by one. be able to.

こうしてユニットB内の閾値を全て読み出したら、図15(a)に示すように、再び閾値マトリックスを画像データに対して移動させる。このとき、ラスタと交差する方向にラスタ2本分だけずらした状態で移動させる。こうして閾値マトリックスをずらすことにより、続く画素のドット形成有無を判断するために読み出す閾値は、ユニットCに含まれている閾値となる。ユニットC内の閾値を全て読み出したら、再び閾値マトリックスを移動させ、今度はユニットA内の閾値を読み出しながらドット形成有無の判断を継続する。   When all the threshold values in the unit B are read out in this way, the threshold value matrix is moved again with respect to the image data as shown in FIG. At this time, it is moved in a state where it is shifted by two rasters in the direction intersecting the raster. By shifting the threshold value matrix in this way, the threshold value that is read to determine the presence / absence of dot formation for the subsequent pixels is the threshold value included in the unit C. When all the threshold values in the unit C are read, the threshold value matrix is moved again, and this time, the determination of dot formation is continued while reading the threshold values in the unit A.

図16は、上述したように、閾値マトリックスを画像データに対して移動させる際に、ラスタ群を構成するラスタ本数と同じ本数だけ、ラスタと交差する方向にずらしながら閾値マトリックスを移動させることによって、閾値が読み出されるユニットが順次切り変わる様子を模式的に示した説明図である。   In FIG. 16, as described above, when the threshold matrix is moved relative to the image data, the threshold matrix is moved while being shifted in the direction intersecting the raster by the same number as the number of rasters constituting the raster group. It is explanatory drawing which showed typically a mode that the unit from which a threshold value is read switches sequentially.

先頭のラスタ群を処理する場合には、図16の最上段に示されているように、初めにユニットAから閾値が読み出され、次いでユニットBから、その次はユニットCから閾値が読み出され、以降はユニットA,ユニットB,ユニットCの順番で次々と閾値が読み出される。ここで、前述したように各ユニット内では閾値は連続したアドレスに記憶されているから、ユニットBをユニットAにマージした状態で、すなわちユニットAの最後尾アドレスに続けてユニットBを記憶し、更にユニットCをユニットBにマージした状態で記憶しておけば、アドレス値を1つずつインクリメントさせるだけで、閾値マトリックスに記憶されている全ての閾値を連続して読み出すことができる。   When processing the first raster group, as shown in the uppermost part of FIG. 16, the threshold value is first read from unit A, then read from unit B, and then read from unit C. Thereafter, the threshold values are read one after another in the order of unit A, unit B, and unit C. Here, as described above, since the threshold value is stored in a continuous address in each unit, the unit B is stored in a state where the unit B is merged with the unit A, that is, following the last address of the unit A, Further, if the unit C is stored in the state of being merged with the unit B, all the threshold values stored in the threshold value matrix can be read out continuously by incrementing the address value one by one.

こうして処理中のラスタ群の全画素の処理を終了し、新たなラスタ群の処理を開始したら、今度は、図16の上から2段目に示されているように、ユニットBの先頭アドレスからアドレス値を1つずつインクリメントさせながら、次々と閾値を読み出してやる。図中で、最上段から2段目に向かって表示されている破線の矢印は、最初のラスタ群の処理が終了して、次のラスタ群の処理に移ったことを模式的に示したものである。2つ目のラスタ群の処理を終了したら、今度は、ユニットCの先頭アドレスからアドレス値を1つずつインクリメントさせながら、次々と閾値を読み出してやればよい。3つ目のラスタ群の処理を終了したら、再びユニットAに戻って、ユニットAの先頭アドレスから順番に閾値を読み出してやる。以降、画像データの全ての画素についてのドット形成有無を判断してしまうまで、同様の処理を繰り返す。   When the processing of all the pixels of the raster group being processed is completed and the processing of a new raster group is started, this time, from the top address of unit B, as shown in the second row from the top in FIG. The threshold value is read one after another while incrementing the address value one by one. In the figure, the dashed arrows displayed from the top row to the second row schematically show that the processing of the first raster group has been completed and the processing of the next raster group has been started. It is. When the processing of the second raster group is completed, the threshold value may be read one after another while incrementing the address value one by one from the head address of unit C. When the processing of the third raster group is completed, the process returns to unit A, and the threshold values are read in order from the head address of unit A. Thereafter, the same processing is repeated until it is determined whether or not dots are formed for all the pixels of the image data.

以上に説明したように、閾値マトリックスを画像データに対して移動させる際に、上述したようにラスタと交差する方向に、ラスタ群を構成するラスタ本数と同じだけずらしながら移動させれば、複雑なアドレス計算を行うことなく適切な閾値を順次読み出すことができるので、階調数変換処理を迅速に行うことが可能となる。   As described above, when the threshold value matrix is moved with respect to the image data, it is complicated if it is moved in the direction intersecting with the raster while being shifted by the same number of rasters constituting the raster group as described above. Since an appropriate threshold value can be read sequentially without performing address calculation, the gradation number conversion process can be performed quickly.

尚、以上の説明においては、閾値マトリックスは、画像データに対して上方向に、ラスタ群と同じラスタ数だけずらすものとしているが、これに限らず、例えば画像データに対して下方向にずらした場合でも、あるいはラスタ群を構成するラスタ本数の整数倍だけずらした場合でも、階調数変換処理を高速化することができる。以下では、このような場合について説明する。   In the above description, the threshold value matrix is shifted upward with respect to the image data by the same number of rasters as the raster group. However, the present invention is not limited to this. For example, the threshold value matrix is shifted downward with respect to the image data. Even in this case, or even when the number of rasters constituting the raster group is shifted by an integral multiple, the gradation number conversion process can be speeded up. Hereinafter, such a case will be described.

図17は、ラスタ群を構成するラスタ本数の2倍に相当するラスタ数だけ、すなわちラスタ4本分だけ、閾値マトリックスをずらしながら移動させた場合を例示した説明図である。図17(a)は、画像データに対して閾値マトリックスを移動させながら、ドット形成有無を判断しようとする画素(対象画素)と閾値マトリックスに記憶されている閾値とを対応付けている様子を模式的に示している。また、図17(b)は、閾値マトリックスを移動させるに伴って、閾値を読み出すユニットが次々と切り変わる様子を模式的に示している。図示されているように、先頭のラスタ群を処理する場合は、ユニットAの閾値が読み出され、ユニットAの閾値を全て読み出してしまうと今度はユニットCの閾値が読み出される。ユニットCの閾値を全て読み出してしまうと、再びユニットAに戻って先頭の閾値から順番に読み出していく。以降、先頭のラスタ群の全ての画素についての処理を終了するまで、ユニットA、ユニットCの順番で繰り返し閾値を読み出しながらドット形成の有無を判断する。   FIG. 17 is an explanatory view exemplifying a case where the threshold matrix is shifted while being shifted by the number of rasters corresponding to twice the number of rasters constituting the raster group, that is, by four rasters. FIG. 17A schematically illustrates a state in which a pixel (target pixel) to be used to determine whether or not dots are formed is associated with a threshold value stored in the threshold value matrix while moving the threshold value matrix with respect to the image data. Is shown. FIG. 17B schematically shows a state in which the units for reading out the threshold values change one after another as the threshold value matrix is moved. As shown in the figure, when the first raster group is processed, the threshold value of unit A is read out, and when all the threshold values of unit A are read out, the threshold value of unit C is read out next time. When all the threshold values of the unit C are read out, the unit A is returned to the unit A and read out in order from the first threshold value. Thereafter, it is determined whether or not dots are formed while repeatedly reading out the threshold values in the order of unit A and unit C until the processing for all the pixels in the first raster group is completed.

先頭のラスタ群を全て処理してしまうと、次のラスタ群については、今度はユニットB、ユニットAの順番で繰り返し閾値を読み出しながらドット形成の有無を判断する。そして、3つ目のラスタ群については、ユニットC、ユニットBの順番で繰り返し閾値を読み出しながらドット形成の有無を判断していく。以降、画像データの全ての画素についての処理を終了するまで、同様にして次々と閾値を読み出しながらドット形成の有無を判断していけばよい。   When all the first raster groups have been processed, it is determined whether or not dots are formed for the next raster group while reading the threshold values repeatedly in the order of unit B and unit A. For the third raster group, the presence / absence of dot formation is determined while repeatedly reading out threshold values in the order of unit C and unit B. Thereafter, until the processing for all the pixels of the image data is completed, the presence or absence of dot formation may be determined while reading out the threshold values one after another.

結局、図17に示すようにして閾値マトリックスをずらしてやれば、少なくともユニット内では連続したアドレス値に記憶されている閾値を順番に読み出してやればよく、複雑なアドレス計算が不要となるので、階調数変換処理を迅速に行うことができる。また、各ユニットを読み出す順番も、1つのラスタ群を処理している間は、同じパターンで繰り返し読み出せばよいので、複雑なアドレス計算は不要である。以上では、閾値マトリックスを移動させる際に、ラスタ群を構成するラスタ本数の2倍に相当する本数だけずらした場合について説明したが、一般に、閾値マトリックスのずらし量を、ラスタ群を構成するラスタ本数の整数倍としておけば、全く同様のことが成り立ち、従って階調数変換処理を高速化することが可能となる。   After all, if the threshold value matrix is shifted as shown in FIG. 17, it is sufficient to read out the threshold values stored in consecutive address values at least within the unit in order, and complicated address calculation is not required. The logarithmic conversion process can be performed quickly. Further, the order of reading out each unit can be repeated with the same pattern while processing one raster group, so that complicated address calculation is unnecessary. In the above description, the case where the threshold matrix is shifted by the number corresponding to twice the number of rasters constituting the raster group when moving the threshold matrix has been described. However, generally, the shift amount of the threshold matrix is the number of rasters constituting the raster group. If the integer multiple is set, the same thing is true, so that the gradation number conversion process can be speeded up.

D.第3実施例:
上述した各種の実施例では、いわゆるディザ法と呼ばれる手法を用いて階調数変換処理を行ったが、階調数変換を行う代表的な手法には、いわゆる誤差拡散法と呼ばれる手法も存在する。以下に説明する第3実施例では、ディザ法と誤差拡散法とを組み合わせて階調数変換処理を行う。
D. Third embodiment:
In the various embodiments described above, the tone number conversion process is performed using a so-called dither method, but there is a so-called error diffusion method as a typical method for performing tone number conversion. . In the third embodiment described below, the tone number conversion process is performed by combining the dither method and the error diffusion method.

D−1.第3実施例の階調数変換処理:
初めに、ディザ法と誤差拡散法とを組み合わせて階調数変換処理を行う際の基本的な考え方について、図18を用いて説明する。カラー画像データは、通常、各色の画像データが組み合わされて表現されている。図18に示した例では、カラー画像データは、シアン(C)色の画像データと、マゼンタ(M)色の画像データと、イエロ(Y)色の画像データと、ブラック(K)色の画像データの組み合わせとして表現されている。ディザ法と誤差拡散法とを組み合わせて使用する場合は、これらの手法を色毎に使い分けて適用する。ここで、ディザ法は誤差拡散法に比べて迅速に処理することができるという利点があるが、その反面、誤差拡散法に比べると画質が劣る場合がある。そこで、比較的画質への影響が少ない色の画像データについてはディザ法を用いて階調数変換処理を行い、その他の色の画像データについては誤差拡散法を用いて階調数変換処理を行うものとする。
D-1. Tone number conversion processing of the third embodiment:
First, a basic concept when the gradation number conversion process is performed by combining the dither method and the error diffusion method will be described with reference to FIG. The color image data is usually expressed by combining image data of each color. In the example shown in FIG. 18, the color image data includes cyan (C) image data, magenta (M) image data, yellow (Y) image data, and black (K) image. Expressed as a combination of data. When the dither method and the error diffusion method are used in combination, these methods are used separately for each color. Here, the dither method has an advantage that it can be processed more quickly than the error diffusion method, but on the other hand, the image quality may be inferior to the error diffusion method. Therefore, the tone number conversion process is performed using the dither method for image data with a color that has relatively little influence on the image quality, and the tone number conversion process is performed using an error diffusion method for image data with other colors. Shall.

図18(b)は、対象画素からC,M,Y,K各色の画像データを読み出している様子を概念的に示した説明図である。図中で細い波線で示した小さな矩形は画素を模式的に表したものであり、対象画素にはハッチングを付して表示している。C,M,Y,K各色の画像データの中では、Y色が最も画質への影響が少ない画像データである。そこで、以下に説明する第3実施例では、Y色の画像データについてはディザ法を用いて階調数変換処理を行い、他の色の画像データについては誤差拡散法を用いて階調数変換処理を行う。   FIG. 18B is an explanatory diagram conceptually showing a state in which image data of each color of C, M, Y, and K is read from the target pixel. A small rectangle indicated by a thin wavy line in the drawing schematically represents a pixel, and the target pixel is displayed with hatching. Among the image data of C, M, Y, and K colors, the Y color is the image data that has the least influence on the image quality. Therefore, in the third embodiment described below, the tone number conversion process is performed on the Y color image data using the dither method, and the tone number conversion is performed on the other color image data using the error diffusion method. Process.

図19は、第3実施例の階調数変換処理において、C,M,Y,Kの各色毎にディザ法と誤差拡散法とを使い分けながらドット形成の有無を判断する処理の流れを示すフローチャートである。かかる処理は、図5に示した画像データ変換処理中でコンピュータ100のCPU102の機能を利用して、プリンタドライバによって実行される。   FIG. 19 is a flowchart showing the flow of processing for determining the presence or absence of dot formation while properly using the dither method and the error diffusion method for each color of C, M, Y, and K in the tone number conversion processing of the third embodiment. It is. Such processing is executed by the printer driver using the function of the CPU 102 of the computer 100 during the image data conversion processing shown in FIG.

第3実施例の階調数変換処理を開始すると、先ず初めに所定本数の隣接するラスタをまとめてラスタ群を形成する処理を行う(ステップS300)。次いで、ラスタ群を構成する複数の画素の中から、ドット形成の有無を判断しようとする対象画素を1つ選択する(ステップS302)。そして、対象画素に対応付けて記憶されているC,M,Y,K各色の画像データを読み込む処理を行う(ステップS304)。尚、ここでは画像データがC,M,Y,Kの各色データの組合せによって構成されているものとして説明しているが、カラー画像データに、例えば淡シアン(LC)や淡マゼンタ(LM)などの他色の画像データが含まれている場合には、これら各色の画像データも同時に読み込んでやる。また、これら各色の画像データは、コンピュータ100のメモリ上の連続したアドレスに記憶しておくこととしても良いが、各色の画像データ毎に異なる領域に記憶しておくことも可能である。   When the tone number conversion process of the third embodiment is started, first, a process of forming a raster group by combining a predetermined number of adjacent rasters is performed (step S300). Next, one target pixel from which a dot formation is determined is selected from a plurality of pixels constituting the raster group (step S302). And the process which reads the image data of each color of C, M, Y, and K memorize | stored matched with the object pixel is performed (step S304). Here, the image data is described as being composed of a combination of C, M, Y, and K color data. However, for example, light cyan (LC) or light magenta (LM) is used as color image data. When image data of other colors is included, the image data of each color is also read at the same time. The image data for each color may be stored at successive addresses on the memory of the computer 100, but may be stored in a different area for each color image data.

こうして各色の画像データを読み込んだら、Yの画像データか否かを判断する(ステップS306)。かかる判断は、例えば対象画像について画像データを読み込んだ順番に基づいて判断したり、あるいは画像データに予め識別用のデータを付加しておき、この識別用のデータに基づいて判断することができる。そして、Yの画像データである場合は(ステップS306:yes)、ディザ法を適用して対象画素についてのドット形成の有無を判断し(ステップS308)、Yの画像データでない場合には(ステップS306:no)誤差拡散法を適用してドット形成の有無を判断する(ステップS308)。これら処理の詳細については後述する。尚、各色の画像データに、LCあるいはLMの画像データが含まれている場合には、Yの画像データに加えて、これらLC,LMの画像データについても、ディザ法を適用してドット形成有無を判断する。   When the image data of each color is read in this way, it is determined whether or not the image data is Y (step S306). This determination can be made based on, for example, the order in which the image data is read for the target image, or by adding identification data to the image data in advance and making this determination. If the image data is Y image data (step S306: yes), the presence or absence of dot formation for the target pixel is determined by applying the dither method (step S308). If the image data is not Y image data (step S306). : No) The presence or absence of dot formation is determined by applying the error diffusion method (step S308). Details of these processes will be described later. If the image data of each color includes LC or LM image data, in addition to the Y image data, the dot and dithering is applied to these LC and LM image data. Judging.

対象画素についてのドット形成の有無を判断したら、処理中のラスタ群に含まれる全ての画素についてのドット形成有無を判断したか否かを判断し(ステップS312)、未処理の画素が残っていれば(ステップS312:no)、ステップS302に戻って続く一連の処理を繰り返す。ラスタ群内の全画素について判断を終了したら(ステップS312:yes)、今度は、画像データに含まれる全てのラスタについての処理を終了したか否かを判断する(ステップS314)。そして、未だ処理していないラスタが残っている場合は、ステップS300に戻って新たなラスタ群を生成し、かかるラスタ群について上述した一連の処理を行う。こうして全てのラスタについての処理を終了したら、第3実施例の階調数変換処理を抜けて、図5に示した画像データ変換処理に復帰する。   When the presence / absence of dot formation for the target pixel is determined, it is determined whether or not dot formation has been determined for all pixels included in the raster group being processed (step S312), and unprocessed pixels remain. If (step S312: no), the process returns to step S302 and repeats a series of processes. When the determination is completed for all the pixels in the raster group (step S312: yes), it is next determined whether or not the processing for all the rasters included in the image data has been completed (step S314). If there is any raster that has not yet been processed, the process returns to step S300 to generate a new raster group, and the series of processes described above are performed on the raster group. When the processing for all the rasters is completed in this manner, the gradation number conversion process of the third embodiment is exited, and the process returns to the image data conversion process shown in FIG.

図20は第3実施例の階調数変換処理中で、ディザ法を適用して対象画素についてのドット形成の有無を判断する処理の流れを示したフローチャートである。また、図21は、第3実施例の階調数変換処理中で、対象画素を選択しながらドット形成の有無を判断している様子を模式的に示した説明図である。図21中でカギ括弧の中に示した数字は、対象画素を選択する順番を示している。図21では、隣接するラスタを2本ずつまとめてラスタ群を構成している。以下、図21を参照しながら、図20のフローチャートに従って説明する。   FIG. 20 is a flowchart showing the flow of processing for determining the presence or absence of dot formation for the target pixel by applying the dither method during the tone number conversion processing of the third embodiment. FIG. 21 is an explanatory diagram schematically showing a state in which the presence / absence of dot formation is determined while selecting a target pixel during the gradation number conversion process of the third embodiment. The numbers shown in square brackets in FIG. 21 indicate the order in which the target pixel is selected. In FIG. 21, two adjacent rasters are grouped together to form a raster group. Hereinafter, a description will be given according to the flowchart of FIG. 20 with reference to FIG.

ディザ法を適用してドット形成の有無を判断する処理では、処理中の対象画素に対応した閾値thを閾値マトリックスから読み込む処理を行う(ステップS330)。閾値thを読み込む処理は、前述の各種実施例において説明したいずれかの方法を適用することができる。ここでは、詳細な説明は省略するが、例えば次のようにして閾値を読み込む。一例として、図21中で[1]と符番した画素が対象画素として選択されている場合は、画像データに閾値マトリックスを重ねた時に、かかる画素の位置に来るマス目を閾値マトリックスの中から選択し、該マス目に記憶されている閾値を読み込めばよい。   In the process of applying the dither method to determine the presence / absence of dot formation, a process of reading the threshold value th corresponding to the target pixel being processed from the threshold matrix is performed (step S330). Any of the methods described in the various embodiments described above can be applied to the process of reading the threshold th. Although detailed description is omitted here, the threshold value is read as follows, for example. As an example, when the pixel numbered as [1] in FIG. 21 is selected as the target pixel, when the threshold matrix is superimposed on the image data, the square at the position of the pixel is selected from the threshold matrix. It is only necessary to select and read the threshold value stored in the cell.

次いで、ステップS330において読み込んだ閾値thと、対象画素の画像データ(ここではYの画像データ)とについて、階調値の大きさを比較する。対象画素の画像データは、図19に示した階調数変換処理中でステップS304において既に読み込まれている。そして、画像データの方が大きければ(ステップS332:yes)対象画素にドットを形成すると判断し、ドット形成の有無の判断結果を示す変数Drに、ドットを形成することを意味する値「1」を書き込む(ステップS334)。逆に、閾値thの方が大きい場合は、判断結果を示す変数Drに、ドットを形成しないことを意味する値「0」を書き込む処理を行う(ステップS336)。以上のようにしてドット形成の有無を判断したら、ディザ法によるドット形成有無の判断処理を抜けて、図19に示した階調数変換処理に復帰する。こうして、階調数変換処理で選択した対象画素を処理していく。その結果、Yの画像データについてはディザ法を適用しながら、図21に示すように複数のラスタを並行させてドット形成有無を判断することができる。   Next, the magnitude of the gradation value is compared between the threshold th read in step S330 and the image data of the target pixel (here, Y image data). The image data of the target pixel is already read in step S304 during the gradation number conversion process shown in FIG. If the image data is larger (step S332: yes), it is determined that a dot is to be formed on the target pixel, and a value “1” indicating that a dot is to be formed in the variable Dr indicating the determination result of the presence or absence of dot formation. Is written (step S334). On the contrary, when the threshold th is larger, a process of writing a value “0” indicating that no dot is formed is performed in the variable Dr indicating the determination result (step S336). When the presence / absence of dot formation is determined as described above, the processing for determining the presence / absence of dot formation by the dither method is skipped, and the processing returns to the tone number conversion processing shown in FIG. In this way, the target pixel selected in the gradation number conversion process is processed. As a result, with respect to the Y image data, it is possible to determine the presence or absence of dot formation by applying a plurality of rasters in parallel while applying the dither method as shown in FIG.

Y以外の画像データについては、誤差拡散法を用いてドット形成の有無を判断する。ここで、対象画素は図21に示した順序で選択されるものとしているから、誤差拡散法によるドット形成有無の判断も、図21に示した順序で行う。以下、誤差拡散法を適用して対象画素についてのドット形成有無を判断する処理について説明する。   For image data other than Y, the presence or absence of dot formation is determined using an error diffusion method. Here, since the target pixels are selected in the order shown in FIG. 21, the determination of dot formation by the error diffusion method is also performed in the order shown in FIG. Hereinafter, processing for determining whether or not dots are formed for a target pixel by applying the error diffusion method will be described.

図22は、誤差拡散法を適用してドット形成有無を判断する処理の流れを示すフローチャートである。尚、かかる処理はC,M,Kの各色毎に行われるが、説明が煩雑となることを避けるために、以下では色を特定せず説明する。   FIG. 22 is a flowchart showing a flow of processing for determining the presence / absence of dot formation by applying the error diffusion method. Such processing is performed for each color of C, M, and K. In order to avoid complicated description, the following description will be made without specifying a color.

誤差拡散法による処理を開始すると、先ず初めに、対象画素に拡散されている拡散誤差erを読み込む処理を行う(ステップS360)。周知のように誤差拡散法では、ある画素についてドットを形成したこと、あるいはドットを形成しなかったことにより、その画素で発生した階調表現の誤差(階調誤差)を周辺の未処理の画素に対応付けて拡散しておく。そして、新たな画素についてのドット形成有無を判断するに際しては、周辺の画素から、その画素に対応付けて拡散された誤差を考慮して、誤差が解消されるようにドット形成の有無を判断する。ステップS360では、既にドット形成有無を判断した画素から対象画素に向かって拡散されてきた誤差(拡散誤差er)を読み込む処理を行う。階調表現の誤差を拡散する処理については後述する。   When processing by the error diffusion method is started, first, processing for reading the diffusion error er diffused in the target pixel is performed (step S360). As is well known, in the error diffusion method, a dot is formed for a certain pixel or a dot is not formed, so that an error in gradation expression (grayscale error) generated in that pixel is detected by surrounding unprocessed pixels. It spreads in association with. Then, when determining the presence or absence of dot formation for a new pixel, the presence or absence of dot formation is determined so as to eliminate the error in consideration of the error diffused in association with the pixel from surrounding pixels. . In step S360, a process of reading an error (diffusion error er) diffused from the pixel for which dot formation has already been determined toward the target pixel is performed. The process of diffusing the gradation expression error will be described later.

次いで、読み込んだ拡散誤差erと対象画素の画像データDtとを加算することにより、補正データDcを算出する(ステップS362)。そして、得られた補正データDcと所定の閾値therとの大小関係を判断する(ステップS364)。閾値therは予め適切な値が設定されている。補正データDcの方が閾値therより大きいと判断された場合は(ステップS364:yes)、対象画素にドットを形成すると判断し、判断結果を示す変数Drにドットを形成することを意味する値「1」を書き込む(ステップS366)。逆に、補正データDcの方が閾値therより小さい場合は、判断結果を示す変数Drに、ドットを形成しないことを意味する値「0」を書き込む処理を行う(ステップS368)。   Next, the correction data Dc is calculated by adding the read diffusion error er and the image data Dt of the target pixel (step S362). Then, the magnitude relationship between the obtained correction data Dc and the predetermined threshold value ther is determined (step S364). The threshold value ther is set to an appropriate value in advance. When it is determined that the correction data Dc is larger than the threshold ther (step S364: yes), it is determined that a dot is to be formed in the target pixel, and a value “meaning that a dot is formed in the variable Dr indicating the determination result”. 1 "is written (step S366). On the contrary, when the correction data Dc is smaller than the threshold value ther, a process of writing a value “0” indicating that no dot is formed is performed in the variable Dr indicating the determination result (step S368).

こうして対象画素についてドット形成するか否かを判断したら、かかる判断によって生じた階調表現の誤差(階調誤差)を算出した後、得られた階調誤差を周辺の未判断の画素に拡散する処理を行う(ステップS370)。階調誤差は、ドット形成有無を判断した結果として対象画素に表現される階調値(この階調値を結果値と呼ぶ)を、対象画素の階調値から減算することによって算出する。例えば、対象画素にドットを形成しないと判断した場合は、その画素にはドットが形成されないから、結果値は階調値「0」となる。また、対象画素にドットを形成すると判断した場合は、実際にドットを形成したときにその画素が表現する階調値(通常は、階調値「255」)となる。従って、対象画素の階調値から、これらの結果値を減算することで階調誤差を求めることができる。   When it is determined whether or not dots are to be formed for the target pixel in this manner, the gradation expression error (gradation error) caused by the determination is calculated, and then the obtained gradation error is diffused to surrounding undetermined pixels. Processing is performed (step S370). The gradation error is calculated by subtracting a gradation value (this gradation value is referred to as a result value) expressed in the target pixel as a result of determining whether or not dots are formed from the gradation value of the target pixel. For example, if it is determined that no dot is formed in the target pixel, no dot is formed in that pixel, and the result value is the gradation value “0”. If it is determined that a dot is to be formed on the target pixel, the gradation value represented by the pixel when the dot is actually formed (usually, the gradation value “255”). Therefore, the gradation error can be obtained by subtracting these result values from the gradation value of the target pixel.

こうして算出した階調誤差は、所定の重みを付けて周辺の画素に分配される。図23は、誤差を分配する際に用いられる重み係数を例示した説明図である。図中の小さな矩形は画素を示している。また、*印が記載された画素は対象画素を示し、各矩形の中に示された数値は重み係数を示している。例えば、図23(a)に示した例では、対象画素の右隣の画素には重み係数1/4を用いて階調誤差が分配される。換言すれば、対象画素で生じた階調誤差の1/4の階調値が、右隣の画素に分配される。同様に、対象画素の右下、真下、左下にあるそれぞれの画素にも、階調誤差の1/4の階調値がそれぞれ分配される。また、対象画素の上側あるいは左隣の画素は既にドット形成の有無が判断されているので、これらの画素には誤差は分配しない。このように、図23(a)に示した重み係数を用いて階調誤差を拡散すれば、各画素に階調誤差を分配する結果、対象画素の周辺にある4つの未判断画素に、対象画素で生じた階調誤差が1/4ずつ分配されることになる。尚、本明細書中では、「階調誤差を分配する」とは、階調誤差に所定の重み係数を乗算した階調値を、ある画素に対応付けられたメモリ上に加算することを意味するものとする。「階調誤差を拡散する」とは、複数の画素に階調誤差を分配することを意味するものとする。また、周辺の画素から階調誤差が分配された結果、ある画素に対応付けて蓄積されている誤差を「拡散誤差」と呼ぶものとする。   The gradation error calculated in this way is distributed to surrounding pixels with a predetermined weight. FIG. 23 is an explanatory diagram illustrating weighting factors used when distributing errors. Small rectangles in the figure indicate pixels. Further, a pixel marked with * indicates a target pixel, and a numerical value shown in each rectangle indicates a weighting coefficient. For example, in the example shown in FIG. 23A, the gradation error is distributed to the pixel on the right side of the target pixel using the weight coefficient ¼. In other words, a gradation value that is ¼ of the gradation error that has occurred in the target pixel is distributed to the pixel on the right. Similarly, a gradation value of ¼ of the gradation error is distributed to each pixel at the lower right, right below, and lower left of the target pixel. In addition, since it is already determined whether or not dots are formed on the upper or left adjacent pixel of the target pixel, no error is distributed to these pixels. As described above, if the gray scale error is diffused using the weighting coefficient shown in FIG. 23A, the gray scale error is distributed to each pixel. As a result, the four undecided pixels around the target pixel are divided into the target pixels. The gradation error generated in the pixels is distributed by 1/4. In this specification, “distributing gradation error” means adding a gradation value obtained by multiplying a gradation error by a predetermined weighting factor to a memory associated with a certain pixel. It shall be. “Diffusion of gradation error” means that gradation error is distributed to a plurality of pixels. Further, an error accumulated as a result of the distribution of gradation errors from surrounding pixels is referred to as a “diffusion error”.

階調誤差を拡散させるために用いる重み係数は、図23(a)に例示したものに限らず、良好な画質が得られるように、例えば、図23(b)に示すような種々の重み係数を用いることができる。こうして対象画素で生じた階調誤差を周辺に未判断画素に拡散したら(図22のステップS370)、図22に示した誤差拡散法によるドット形成判断処理を抜けて、図19に示す第3実施例の階調数変換処理に復帰する。   The weighting factors used for diffusing the gradation error are not limited to those illustrated in FIG. 23A, and various weighting factors, for example, as shown in FIG. Can be used. When the gradation error generated in the target pixel is diffused to the undetermined pixels in the vicinity (step S370 in FIG. 22), the dot formation determination process by the error diffusion method shown in FIG. Return to the tone conversion processing in the example.

以上に説明したように、第3実施例の階調数変換処理においては、カラー画像データを構成する各色のデータについての階調数変換処理を行うに際して、色の違いによる画質への影響の違いを考慮して、ディザ法と誤差拡散法とを適切に使い分けながら階調数変換処理を行う。そして、ディザ法を適用して階調数変換処理を行う場合には、隣接する複数本のラスタをラスタ群としてまとめ、かかるラスタについて並行して階調数変換処理を行うことにより、処理の高速化を図ることが可能である。   As described above, in the gradation number conversion process of the third embodiment, when the gradation number conversion process is performed on the data of each color constituting the color image data, the difference in the influence on the image quality due to the difference in color. In consideration of the above, gradation number conversion processing is performed while appropriately using the dither method and the error diffusion method. When the tone number conversion process is performed by applying the dither method, a plurality of adjacent rasters are collected as a raster group, and the tone number conversion process is performed on the rasters in parallel, thereby speeding up the processing. Can be achieved.

また、第3実施例の階調数変換処理においては、ディザ法による判断を、複数ラスタを並行させながら行うことに対応して、誤差拡散法による判断も複数ラスタを並行させて行うことになる。この結果、誤差拡散法による処理も高速化することができるので、ディザ法における処理の高速化と併せて、全体の階調数変換処理をより一層高速化することができる。以下では、複数のラスタを並行させて処理することで、誤差拡散法によるドット形成有無の判断を迅速に行うことができる理由について説明する。   In addition, in the tone number conversion process of the third embodiment, the determination by the error diffusion method is also performed in parallel with the determination by the error diffusion method, corresponding to the determination by the dither method being performed in parallel. . As a result, the processing by the error diffusion method can also be speeded up, so that the overall gradation number conversion processing can be further speeded up together with the speeding up of the processing by the dither method. Hereinafter, the reason why it is possible to quickly determine whether or not dots are formed by the error diffusion method by processing a plurality of rasters in parallel will be described.

ここでは、2本のラスタでラスタ群を構成し、ラスタ群に含まれる画素の中から図21に示した順番で対象画素を選択するものとして説明する。図24は、ラスタ3およびラスタ4に含まれる画素から対象画素を順次選択して、ドット形成の有無を判断している様子を示した説明図である。図中の小さな矩形は画素を示し、画素中のカギ括弧の中に記載した数字は、ラスタ群中でその画素を処理する順番を示している。   Here, a description will be given on the assumption that a raster group is composed of two rasters, and the target pixel is selected from the pixels included in the raster group in the order shown in FIG. FIG. 24 is an explanatory diagram showing a state in which target pixels are sequentially selected from the pixels included in the raster 3 and the raster 4 to determine whether or not dots are formed. A small rectangle in the figure indicates a pixel, and the numbers described in square brackets in the pixel indicate the order in which the pixel is processed in the raster group.

図24(a)はラスタ群の中で最初に選択した対象画素(図中で[1]と符番した画素)から、周辺の画素に階調誤差を拡散している様子を模式的に示している。図中の実線の矢印は、所定の重み係数に従って階調誤差が周辺の画素に分配されている様子を模式的に表している。尚、ここでは図23(a)に示した重み係数に従って誤差を拡散するものとする。符番[1]の画素で生じた階調誤差を拡散したら、右隣にある符番[2]の画素についてドット形成の有無を判断する処理を開始する。すなわち、符番[2]の画素に対応付けて記憶されている拡散誤差を読み出して補正データを算出し、所定の閾値と比較することによってドット形成の有無を判断する。そして判断に伴って生じた階調誤差を算出したら、得られた階調誤差を周辺の未判断画素に拡散する。図24(b)は、符番[2]で生じた階調誤差を周辺の画素に拡散している様子を模式的に示している。尚、図24(b)では、既にドット形成有無を判断済みの画素を、ハッチングを付して表示している。   FIG. 24A schematically shows a state in which gradation errors are diffused from the target pixel first selected in the raster group (the pixel numbered [1] in the figure) to the surrounding pixels. ing. A solid line arrow in the drawing schematically represents a state in which gradation errors are distributed to surrounding pixels according to a predetermined weighting factor. Here, it is assumed that the error is diffused according to the weighting factor shown in FIG. When the gradation error generated in the pixel with the number [1] is diffused, a process for determining whether or not dots are formed is started for the pixel with the number [2] on the right. That is, the diffusion error stored in association with the pixel with the number [2] is read to calculate correction data, and compared with a predetermined threshold value to determine the presence / absence of dot formation. Then, when the gradation error caused by the determination is calculated, the obtained gradation error is diffused to surrounding undetermined pixels. FIG. 24B schematically shows a state in which the gradation error caused by the number [2] is diffused to surrounding pixels. In FIG. 24B, pixels that have already been determined for dot formation are hatched and displayed.

次いで、符番[3]の画素についてのドット形成有無を判断する。かかる判断に際しては、周辺の画素から符番[3]の画素に分配されてきた拡散誤差を読み出して、符番[3]についての補正データを算出することによってドット形成の有無を判断する。ここで、図24(c)から明らかなように、符番[3]の画素に分配される階調誤差は、符番[1]の画素からの誤差と符番[2]の画素からの誤差だけである。符番[2]の画素から分配されてきた誤差は、直前の処理で算出したばかりであり、符番[1]の画素から分配されてきた誤差についても、その前の処理で算出したばかりである。従って、これらの誤差はいずれもコンピュータ100のキャッシュメモリに残っているので、極めて高速に読み出すことができる。こうして誤差を高速に読み出すことができれば、補正データを迅速に算出して符番[3]についてのドット形成有無の判断を迅速に行うことができる。尚、ここでは符番[1]あるいは符番[2]から分配されてきた誤差の値を、キャッシュメモリから読み出すものとして説明したが、分配された誤差を読み出すのではなく、これら画素で発生した階調誤差をキャッシュメモリから読み出して、符番[3]に分配される誤差を算出するものとしても良い。これらの処理は実質的には等価な処理と考えることができる。   Next, it is determined whether or not dots are formed for the pixel numbered [3]. In this determination, the diffusion error distributed to the pixel [3] from the surrounding pixels is read, and correction data for the code [3] is calculated to determine the presence / absence of dot formation. Here, as is clear from FIG. 24C, the gradation error distributed to the pixel of the number [3] is the error from the pixel of the number [1] and the pixel from the number [2]. It is only an error. The error distributed from the pixel with the number [2] has just been calculated in the immediately preceding process, and the error distributed from the pixel with the number [1] has just been calculated in the previous process. is there. Accordingly, all of these errors remain in the cache memory of the computer 100, so that they can be read out at a very high speed. If the error can be read out at high speed in this way, the correction data can be quickly calculated and the dot formation presence / absence determination for the number [3] can be quickly made. Here, the error value distributed from the number [1] or the number [2] has been described as being read from the cache memory. However, instead of reading the distributed error, the error occurred in these pixels. The gradation error may be read from the cache memory and the error distributed to the number [3] may be calculated. These processes can be considered as substantially equivalent processes.

以上の説明は、符番[3]の画素についてのドット形成有無を判断する場合について説明したが、符番[2]の画素について判断する場合にも、同様の理由により、処理を高速化することが可能である。すなわち、符番[2]の画素についてドット形成有無を判断する際には、符番[2]の画素に対応付けて蓄積されている拡散誤差をメモリから読み出して、補正データを算出する。符番[2]の画素に蓄積される拡散誤差には、符番[1]の画素を含む複数の画素からの誤差も蓄積されるが、符番[1]の画素からの誤差は直前の処理で算出されている。従ってこの誤差については、符番[2]に対応付けて既にメモリ上に蓄積されている拡散誤差に加算するのではなく、メモリ上に一時的に蓄えておいてもよい。そして、符番[1]からの誤差が未だ分配されていない拡散誤差をメモリから読み出して、一時的に蓄えておいた誤差とCPU102上で加算することにより、符番[2]についての拡散誤差を算出することとしても良い。こうすれば、符番[1]の画素から符番[2]の画素に分配される誤差を、符番[2]の画素に対応付けられたメモリに既に蓄積されている拡散誤差に加算する処理が不要となるので、ドット形成の有無を判断する処理を迅速に行うことが可能となる。   In the above description, the case where the dot formation presence / absence is determined for the pixel with the number [3] has been described. However, when the determination is made for the pixel with the number [2], the processing speed is increased for the same reason. It is possible. That is, when determining the presence or absence of dot formation for the pixel with the number [2], the diffusion error accumulated in association with the pixel with the number [2] is read from the memory to calculate correction data. In the diffusion error accumulated in the pixel of the number [2], errors from a plurality of pixels including the pixel of the number [1] are also accumulated, but the error from the pixel of the number [1] It is calculated by processing. Therefore, this error may be temporarily stored in the memory instead of being added to the diffusion error already stored in the memory in association with the number [2]. Then, a diffusion error for which the error from the number [1] is not yet distributed is read from the memory, and the error stored temporarily and added on the CPU 102, thereby the diffusion error for the number [2]. May be calculated. In this way, the error distributed from the pixel with the number [1] to the pixel with the number [2] is added to the diffusion error already accumulated in the memory associated with the pixel with the number [2]. Since processing is not necessary, it is possible to quickly perform processing for determining the presence or absence of dot formation.

尚、こうして他の画素からの誤差と加算されることなく、単独でメモリ上に蓄えられる誤差は、あくまでも一時的に蓄えられるものであって、ほどなくドット形成有無の判断に使用される。従って、これら誤差が多数蓄えられることはないので、これらの誤差は、レジスタなどの高速に読み書き可能なメモリに蓄えておくことができる。こうして高速に読み書き可能なメモリに蓄えることとすれば、ドット形成の有無を判断する処理をより一層迅速に行うことが可能となる。   Note that the error stored in the memory independently without being added to the error from other pixels in this way is temporarily stored, and is used for the determination of dot formation. Therefore, since many of these errors are not stored, these errors can be stored in a memory such as a register that can be read and written at high speed. If the data is stored in a readable / writable memory in this manner, the process for determining the presence or absence of dot formation can be performed more quickly.

また、図24(a)で符番[2]の画素からの誤差を分配する画素はいずれも、程なくドット形成の有無を判断する画素である。従って、これらの誤差については、周辺画素に対応付けられたメモリ上に蓄積するのではなく、誤差のまま、メモリ上に一時的に蓄えておくこととしても良い。こうすれば、上述した説明と同様の理由により、ドット形成有無を判断する処理をより一層迅速に行うことが可能となる。   In FIG. 24A, each pixel that distributes an error from the pixel with the number [2] is a pixel that determines whether or not a dot is formed. Therefore, these errors may be temporarily stored in the memory as errors, instead of being stored in the memory associated with the peripheral pixels. In this way, for the same reason as described above, it is possible to perform the process of determining the dot formation more quickly.

一方、符番[3]の画素で生じた階調誤差は、図24(c)に示すように、ラスタ4の画素とラスタ5の画素とに拡散される。ここでは、ラスタ2本ずつ、すなわちラスタ3とラスタ4とを並行して処理するものとしているから、ラスタ5に含まれる画素については、しばらくの間はドット形成の有無が判断されることはない。従って、符番[3]の画素からラスタ5の画素に分配される誤差は、これら画素に対応付けられたメモリに分配しておく。これら画素に、他の画素からの誤差が分配されてきたときには、既に蓄えられている誤差に加算した値をメモリに蓄えておけばよい。図24中の実線の矢印は、誤差を画素に対応付けて分配するのではなく、誤差の値を一時的にメモリに蓄えることを示し、白抜きの矢印は、誤差を周辺の未判断画素に対応付けてメモリ上に分配することを示している。   On the other hand, as shown in FIG. 24C, the gradation error generated in the pixel with the number [3] is diffused into the raster 4 pixel and the raster 5 pixel. Here, since two rasters, that is, raster 3 and raster 4 are processed in parallel, the presence or absence of dot formation is not determined for a while for the pixels included in raster 5. . Therefore, the error distributed from the pixel with the number [3] to the pixels of the raster 5 is distributed to the memories associated with these pixels. When errors from other pixels have been distributed to these pixels, a value added to the error that has already been stored may be stored in the memory. The solid arrow in FIG. 24 indicates that the error value is temporarily stored in the memory instead of being distributed in association with the pixel, and the white arrow indicates that the error is transferred to the surrounding undetermined pixels. It shows that the data is distributed on the memory in association with each other.

符番[3]の画素についての処理が終了したら、今度は符番[4]の画素についての処理を開始する。処理に際しては、符番[4]に対応付けて記憶されている画像データおよび拡散誤差をメモリから読み出す。そして、左隣の画素(符番[2]の画素)からの誤差を加算することによって補正データを算出し、得られた補正データと所定の閾値との大小関係に基づいてドット形成の有無を判断する。次いで、判断によって発生した階調誤差と所定の重み係数とに基づいて、各画素に分配すべき誤差を算出し、得られた誤差をメモリ上に一時的に記憶しておく。こうして、符番[4]の画素についての処理が終了したら、続く、符番[5]以降の画素についても同様の処理を繰り返す。   When the process for the pixel with the number [3] is completed, the process for the pixel with the number [4] is started. In the processing, the image data and the diffusion error stored in association with the number [4] are read from the memory. Then, correction data is calculated by adding an error from the pixel on the left (the pixel with the number [2]), and whether or not dots are formed is determined based on the magnitude relationship between the obtained correction data and a predetermined threshold value. to decide. Next, an error to be distributed to each pixel is calculated based on the gradation error generated by the determination and a predetermined weighting factor, and the obtained error is temporarily stored in the memory. In this way, when the process for the pixel of the number [4] is completed, the same process is repeated for the subsequent pixels of the number [5].

このように、第3実施例の階調数変換処理では、ラスタ群を構成する複数本のラスタを並行して処理することにより、ディザ法を適用した処理の高速化を図ることが可能なだけではなく、誤差拡散法を適用してドット形成の有無を判断する処理も高速化することが可能である。   As described above, in the tone number conversion process of the third embodiment, it is possible to increase the speed of the process using the dither method by processing a plurality of rasters constituting the raster group in parallel. Instead, it is possible to speed up the process of determining the presence or absence of dot formation by applying the error diffusion method.

D−2.変形例:
上述した第3実施例の階調数変換処理では、ラスタ群を構成する複数のラスタを並行して処理することで、ディザ法を適用した処理も、誤差拡散法を適用した処理も、いずれについても処理速度を向上させることが可能である。もっとも、ラスタ群に含まれる複数のラスタを並行して処理する方法は、上述した方法に限られるものではない。以下に説明する変形例では、ラスタ群を複数のブロックに区分けして、ブロック毎にドット形成有無を判断することにより、複数本のラスタを並行して処理している。こうすることによっても、階調数変換処理の高速化を図ることが可能である。図25は、第3実施例の変形例としての階調数変換処理の流れを示すフローチャートである。また、図26は、変形例の階調数変換処理が画像データをドット形成有無による表現形式のデータに変換している様子を例示した説明図である。以下、図26を参照しながら、図25に示すフローチャートに従って説明する。
D-2. Variations:
In the gradation number conversion process of the third embodiment described above, by processing a plurality of rasters constituting a raster group in parallel, both the process applying the dither method and the process applying the error diffusion method are performed. It is also possible to improve the processing speed. However, the method of processing a plurality of rasters included in the raster group in parallel is not limited to the method described above. In the modification described below, a plurality of rasters are processed in parallel by dividing the raster group into a plurality of blocks and determining whether or not dots are formed for each block. This also makes it possible to speed up the gradation number conversion process. FIG. 25 is a flowchart showing the tone number conversion process as a modification of the third embodiment. FIG. 26 is an explanatory view exemplifying a state in which the tone number conversion processing according to the modification converts image data into data in an expression format based on the presence or absence of dot formation. Hereinafter, a description will be given according to the flowchart shown in FIG. 25 with reference to FIG.

第3実施例の変形例の階調数変換処理を開始すると、先ず初めに隣接するN本のラスタをまとめてラスタ群を生成する(ステップS400)。図26では、ラスタ群が2本のラスタによって構成されているものとして、ラスタ1およびラスタ2の2本のラスタをラスタ群としてまとめた様子を示している。   When the tone number conversion process of the modified example of the third embodiment is started, first, a raster group is generated by collecting N adjacent rasters (step S400). FIG. 26 shows a state in which two rasters, raster 1 and raster 2, are combined into a raster group, assuming that the raster group is composed of two rasters.

次いで、ラスタ群中の画素を、隣接する所定数ずつまとめて複数のブロックに区分し、ドット形成の有無を判断しようとする処理ブロックを設定する(ステップS402)。ブロックは、図26中では太い破線で示した矩形によって表されている。図示した例では、ラスタ群は、縦横2画素ずつ合計4つの画素からなる複数のブロックに区分されている。ステップS402では、こうして区分された複数のブロックの中から一番左端のブロックを、ドット形成の有無を判断するブロック(すなわち、処理ブロック)として設定する。   Next, a predetermined number of adjacent pixels in the raster group are grouped into a plurality of blocks, and a processing block for determining the presence / absence of dot formation is set (step S402). The block is represented by a rectangle indicated by a thick broken line in FIG. In the example shown in the figure, the raster group is divided into a plurality of blocks each consisting of a total of four pixels of two pixels vertically and horizontally. In step S402, the leftmost block among the plurality of blocks thus divided is set as a block for determining the presence or absence of dot formation (that is, a processing block).

こうして設定した処理ブロックに含まれる各画素から、C,M,Y,K各色の画像データを読み込む(ステップS404)。すなわち、図26に示した例では、図中で[1]と符番した画素、および[2]と符番した画素、[3]と符番した画素、[4]と符番した画素の合計4つの画素について、各色の画像データを読み込む。次いで、画像データがY色の画像データか否かを判断し(ステップS406)、Y色の画像データであれば(ステップS406:yes)、ディザ法を適用することにより処理ブロック内の各画素についてのドット形成有無の判断を判断する(ステップS408)。すなわち、処理ブロックに含まれる4つの画素を、図26中に符番された番号の若い画素から順番に、ディザ法を適用してドット形成の有無を判断していけばよい。ドット形成の有無を判断するための具体的な方法には上述した各種実施例の方法を適用することができる。処理の詳細については、先に行った説明と重複するので、ここでは説明を省略する。   Image data of each color of C, M, Y, and K is read from each pixel included in the processing block thus set (step S404). That is, in the example shown in FIG. 26, the pixel numbered [1], the pixel numbered [2], the pixel numbered [3], and the pixel numbered [4] in the figure. The image data of each color is read for a total of four pixels. Next, it is determined whether the image data is Y-color image data (step S406). If the image data is Y-color image data (step S406: yes), the dither method is applied to each pixel in the processing block. It is determined whether or not there is any dot formation (step S408). That is, the presence or absence of dot formation may be determined by applying the dither method to the four pixels included in the processing block in order from the youngest pixel numbered in FIG. As specific methods for determining the presence or absence of dot formation, the methods of the various embodiments described above can be applied. Details of the process are the same as those described above, and thus the description thereof is omitted here.

ステップS406において、画像データがY色の画像データではない場合は(ステップS406:no)、誤差拡散法を適用しながらブロック単位でドット形成の有無を判断する(ステップS410)。かかる処理の詳細については後述する。   In step S406, if the image data is not Y-color image data (step S406: no), the presence / absence of dot formation is determined for each block while applying the error diffusion method (step S410). Details of this processing will be described later.

こうして処理ブロックについてのドット形成の有無を判断したら、処理中のラスタ群に含まれるすべての画素について処理を終了したか否かを判断する(ステップS412)。そして、ラスタ群に未処理の画素が残っていると判断された場合には、ステップS402に戻って、すべての画素の処理を終了するまで続く一連の処理を繰り返し行う。ラスタ群の全ての画素を処理していると判断された場合は(ステップS412:yes)、今度は、画像データに含まれる全てのラスタについての処理を終了したか否かを判断する(ステップS414)。そして、未処理のラスタが残っている場合には(ステップS414:no)、ステップS400に戻って、続く一連の処理を行う。画像データに含まれる全てのラスタについて処理を終了したと判断した場合は(ステップS414:yes)、図25に示した変形例の階調数変換処理を終了して、図5の画像データ変換処理に復帰する。   When the presence or absence of dot formation for the processing block is determined in this way, it is determined whether or not the processing has been completed for all pixels included in the raster group being processed (step S412). If it is determined that an unprocessed pixel remains in the raster group, the process returns to step S402, and a series of processes are repeated until the process for all pixels is completed. If it is determined that all the pixels of the raster group have been processed (step S412: yes), it is determined whether or not the processing for all the rasters included in the image data has been completed (step S414). ). If an unprocessed raster remains (step S414: no), the process returns to step S400 to perform a series of subsequent processes. When it is determined that the processing has been completed for all the rasters included in the image data (step S414: yes), the gradation number conversion processing of the modification shown in FIG. 25 is ended, and the image data conversion processing of FIG. Return to.

以下では、ステップS410の処理、すなわち誤差拡散法を適用しながら処理ブロック内の各画素について、ドット形成の有無を判断する処理について説明する。尚、以下に説明する処理は、C,M,K各色の画像データについても全く同様に行われる。   Hereinafter, the process of step S410, that is, the process of determining the presence / absence of dot formation for each pixel in the processing block while applying the error diffusion method will be described. The processing described below is performed in exactly the same manner for the C, M, and K color image data.

図27は、誤差拡散法を適用しながら、処理ブロック内の各画素についてのドット形成有無を判断する処理の流れを示すフローチャートである。処理を開始すると、先ず初めに、処理ブロックに含まれる各画素についての階調値の総和Sを算出する(ステップS450)。処理ブロック内の各画素についての階調値は、図25を用いて前述した第3実施例の変形例の階調数変換処理中で既に読み込まれている。   FIG. 27 is a flowchart showing a flow of processing for determining whether or not dots are formed for each pixel in the processing block while applying the error diffusion method. When the processing is started, first, a sum S of gradation values for each pixel included in the processing block is calculated (step S450). The gradation value for each pixel in the processing block has already been read in the gradation number conversion process of the modification of the third embodiment described above with reference to FIG.

次いで、処理ブロック内の各画素に対応付けて記憶されている拡散誤差erを読み込む処理を行う(ステップS452)。例えば、図26に示したブロックの中で、先頭のブロックについて処理している場合は、符番[1]ないし符番[4]の各画素に向かって分配されてきた拡散誤差erを読み出してやる。   Next, processing for reading the diffusion error er stored in association with each pixel in the processing block is performed (step S452). For example, in the case of processing the first block among the blocks shown in FIG. 26, the diffusion error er distributed toward each pixel of the number [1] to the number [4] is read out. do.

こうして読み出した各画素の拡散誤差erと先に算出しておいた総和Sとを加算することにより、処理ブロックについての補正データBxを算出する(ステップS454)。そして、得られた補正データBxと所定の閾値th1 とを比較する(ステップS456)。補正データBxの方が閾値th1 よりも小さい場合は、その処理ブロックの画素にはいずれもドットを形成しないと判断する(ステップS458)。   The correction data Bx for the processing block is calculated by adding the diffusion error er of each pixel read out in this way and the previously calculated sum S (step S454). Then, the obtained correction data Bx is compared with a predetermined threshold th1 (step S456). If the correction data Bx is smaller than the threshold value th1, it is determined that no dot is formed in any pixel of the processing block (step S458).

一方、ステップS456において、補正データBxが閾値th1 よりも大きいと判断された場合には、更に所定の閾値th2 との比較を行う(ステップS460)。ここで、閾値th2 と閾値th1 とは、th1 <th2 の関係が成り立つように設定されている。補正データBxの値が閾値th2 よりは小さい場合、すなわち、閾値th1 よりは大きいが閾値th2 よりは小さい場合(ステップS460:no)は、処理ブロックに含まれる画素の中の1つの画素にのみ、ドットを形成すると判断する(ステップS462)。   On the other hand, when it is determined in step S456 that the correction data Bx is larger than the threshold value th1, the comparison with the predetermined threshold value th2 is further performed (step S460). Here, the threshold value th2 and the threshold value th1 are set so that the relationship of th1 <th2 is satisfied. When the value of the correction data Bx is smaller than the threshold th2, that is, larger than the threshold th1 but smaller than the threshold th2 (step S460: no), only one pixel among the pixels included in the processing block is It is determined that dots are formed (step S462).

図28は、処理ブロックに含まれる4つの画素の中の1画素にのみ、ドットを形成している様子を示している。処理ブロック中の1画素にのみドットを形成する方法は、図28に示した4通りの方法がある。本実施例ではステップS462の処理において、処理ブロック中の1画素にのみドットを形成する場合は、これら4通りの中から毎回ランダムに選択した位置の画素にドットを形成するものとする。もちろん、毎回同じ位置の画素にドットを形成することとしても良いし、あるいは、処理ブロックに含まれる画素の中で、階調値の最も大きな画素にドットを形成するものとしても良い。   FIG. 28 shows a state where dots are formed only in one of the four pixels included in the processing block. There are four methods shown in FIG. 28 for forming dots in only one pixel in the processing block. In this embodiment, in the process of step S462, when dots are formed only for one pixel in the processing block, dots are formed at pixels at positions selected randomly from these four patterns each time. Needless to say, dots may be formed at the same position each time, or dots may be formed at the pixel having the largest gradation value among the pixels included in the processing block.

以上のようにして、処理ブロックに含まれる画素にドットを形成しないと判断したか(ステップS458)、あるいは1つの画素にのみドットを形成すると判断したら(ステップS462)、こうした判断によって処理ブロックに生じた階調表現の誤差を算出する(ステップS464)。処理ブロックで生じた階調誤差は、その処理ブロックの補正データBxの階調値から、そのブロックについての結果値を減算することで算出することができる。ここで、処理ブロックについての結果値とは、そのブロックを構成する各画素についての結果値(ドットが形成されたこと、あるいは形成されなかったことによって、画素に表現される階調値)の総和値である。   As described above, if it is determined that dots are not formed on the pixels included in the processing block (step S458), or if it is determined that dots are formed only on one pixel (step S462), such determination causes the processing block. An error in the gradation expression is calculated (step S464). The gradation error generated in the processing block can be calculated by subtracting the result value for the block from the gradation value of the correction data Bx of the processing block. Here, the result value for the processing block is the sum of the result values (tone values expressed in the pixels when dots are formed or not formed) for each pixel constituting the block. Value.

例えば、処理ブロック内のいずれの画素にもドットを形成しない場合(ステップS458の場合)は、各画素の結果値はいずれも「0」であるから、その着目ブロックの結果値も「0」となる。従って、処理ブロックでは、補正データBxの階調値がそのまま階調誤差として発生する。同様に、処理ブロック内の1画素にのみドットが形成される場合(ステップS462の場合)は、処理ブロックの結果値は、ドットが形成される画素についての結果値となる。従って、補正データBxからドットを形成した画素の結果値を減算すれば、その処理ブロックでの階調誤差を算出することができる。   For example, when no dot is formed in any pixel in the processing block (in the case of step S458), since the result value of each pixel is “0”, the result value of the target block is also “0”. Become. Accordingly, in the processing block, the gradation value of the correction data Bx is directly generated as a gradation error. Similarly, when a dot is formed only on one pixel in the processing block (in the case of step S462), the result value of the processing block is the result value for the pixel on which the dot is formed. Therefore, if the result value of the pixel in which the dot is formed is subtracted from the correction data Bx, the gradation error in the processing block can be calculated.

こうして処理ブロックに発生した階調誤差を算出したら、この誤差を周辺の画素に拡散する処理を行う(ステップS466)。図29は、処理ブロックで生じた階調誤差を周辺の未判断画素に拡散させる様子を概念的に示した説明図である。図中にハッチングを付して示した大きな矩形は、階調誤差が発生した処理ブロックを示しており、処理ブロックの周囲に実線で示した小さな矩形は階調誤差を分配する周辺画素を示している。例えば、階調誤差を処理ブロックに隣接する画素に拡散する場合は、図29(a)に各画素に記載した重み係数を用いて各画素に誤差を分配する。また、処理ブロックの周辺の画素に均等に誤差が拡散されるように、図29(b)に例示するような重み係数を用いても良い。   When the gradation error generated in the processing block is calculated in this way, processing for diffusing this error to surrounding pixels is performed (step S466). FIG. 29 is an explanatory diagram conceptually showing a state in which a gradation error generated in a processing block is diffused to surrounding undetermined pixels. The large rectangles shown with hatching in the figure indicate processing blocks in which gradation errors have occurred, and the small rectangles indicated by solid lines around the processing blocks indicate peripheral pixels that distribute gradation errors. Yes. For example, when the gradation error is diffused to pixels adjacent to the processing block, the error is distributed to each pixel using the weighting factor described in each pixel in FIG. In addition, a weighting factor as illustrated in FIG. 29B may be used so that an error is evenly diffused to pixels around the processing block.

尚、図29(a)中に細い破線で示した大きな矩形は、処理ブロックに隣接した周辺のブロックを示している。図29(a)に示した例では、処理ブロックで生じた階調誤差が、隣接する周辺のブロックに均等に分配されるように、各画素の重み係数が定められている。重み係数をこのように設定しておけば、各ブロックには均等に誤差を分配することができるので、比較的良好な画質を簡便に得ることができる。もちろん、隣接するブロック内の一部の画素に誤差を分配した場合、誤差が分配された画素では誤差が分配されない画素と比べてドットの形成のされ方が異なることが予想される。しかし、図27に示したフローチャートからも明らかなように、処理ブロックで発生した階調誤差をまとめて拡散するのは、画像データの階調値が小さい領域、換言すれば、ドットがまばらにしか形成されない領域である。この様な領域では、ブロック内の各画素でドットの形成のされ方が多少異なったとしても、画質に大きな影響を与えることはない。   Note that a large rectangle indicated by a thin broken line in FIG. 29A indicates a peripheral block adjacent to the processing block. In the example shown in FIG. 29A, the weighting coefficient of each pixel is determined so that the gradation error generated in the processing block is evenly distributed to adjacent peripheral blocks. If the weighting factor is set in this way, errors can be evenly distributed to the respective blocks, so that relatively good image quality can be easily obtained. Of course, when an error is distributed to a part of pixels in an adjacent block, it is expected that a dot is formed differently in a pixel in which the error is distributed compared to a pixel in which the error is not distributed. However, as apparent from the flowchart shown in FIG. 27, the gradation errors generated in the processing block are diffused together only in a region where the gradation value of the image data is small, in other words, the dots are sparse. This is a region that is not formed. In such a region, even if the dot formation is slightly different in each pixel in the block, the image quality is not greatly affected.

尚、図29に示した重み係数は例示であり、従って、得られた画像を確認しながら、各画素への重み係数を修正していくことで、より良好な画質を得ることができるのは言うまでもない。   It should be noted that the weighting factors shown in FIG. 29 are exemplary, and therefore, it is possible to obtain better image quality by correcting the weighting factors for each pixel while confirming the obtained image. Needless to say.

図27のステップS460において、処理ブロックの補正データBxが所定の閾値th2 よりも大きいと判断された場合は(ステップS460:yes)、誤差拡散法を適用しながら処理ブロック内の各画素毎にドットの形成の有無を判断する処理を行う(ステップS468)。図30を参照しながら、かかる処理の内容について説明する。   If it is determined in step S460 of FIG. 27 that the correction data Bx of the processing block is larger than the predetermined threshold th2 (step S460: yes), a dot is applied to each pixel in the processing block while applying the error diffusion method. Processing for determining the presence or absence of formation is performed (step S468). The contents of such processing will be described with reference to FIG.

図30は、誤差拡散法を適用して階調誤差を周辺の画素に拡散しながら、処理ブロック内の画素毎にドット形成の有無を判断する様子を模式的に示した説明図である。図26に太い破線の矩形で示した各ブロック毎にかかる処理を行うことで、各画素についてドット形成の有無を判断することができる。説明を一般化するために、以下では、処理ブロック中の左上の画素を画素Pa、右上の画素を画素Pb、左下の画素を画素Pc、右下の画素を画素Pdと呼ぶことにする。従って、画素Paは、図26中でそれぞれ符番[1],[5],[9]…が付された画素に相当する。同様に、画素Pbは、図26中でそれぞれ符番[2],[6],[10]…が付された画素に相当し、画素Pcは符番[3],[7],[11]…が付された画素に、画素Pdは符番[4],[8],[12]…が付された画素に相当している。   FIG. 30 is an explanatory diagram schematically showing a state in which the presence / absence of dot formation is determined for each pixel in the processing block while applying the error diffusion method to diffuse the gradation error to surrounding pixels. By performing such processing for each block indicated by a thick dashed rectangle in FIG. 26, it is possible to determine the presence or absence of dot formation for each pixel. In order to generalize the description, in the following, the upper left pixel in the processing block is referred to as pixel Pa, the upper right pixel is referred to as pixel Pb, the lower left pixel is referred to as pixel Pc, and the lower right pixel is referred to as pixel Pd. Therefore, the pixel Pa corresponds to a pixel to which reference numerals [1], [5], [9],. Similarly, the pixel Pb corresponds to the pixels with the numbers [2], [6], [10]... In FIG. 26, and the pixels Pc are the numbers [3], [7], [11. ..., And the pixel Pd corresponds to the pixels with the numbers [4], [8], [12].

図30中で、破線で示した大きな矩形は処理ブロックを示し、処理ブロック中に実線で示した小さな矩形は、ブロック内の各画素を示している。図30(a)は、画素Paについてドット形成有無を判断することによって生じた階調誤差ERaを周辺の未判断画素に拡散している様子を模式的に示している。ここでは、ブロック毎に処理を行うものとしているから、処理ブロックの左側の画素は、既にドット形成の有無を判断済みである。図30では、ドット形成有無を判断済みの画素にハッチングを付して表示している。そこで、図30(a)に示すように、画素Paで生じた階調誤差ERaは、処理ブロック内の3つの画素に所定の重み係数で拡散させる。図31は、階調誤差を換算させるための重み係数を例示した説明図である。図中に示した*印は、ドット形成有無を判断したことにより階調誤差が生じた画素を示しており、周辺の画素内の数値は、その画素に誤差を分配するための重み係数を示している。   In FIG. 30, a large rectangle indicated by a broken line indicates a processing block, and a small rectangle indicated by a solid line in the processing block indicates each pixel in the block. FIG. 30A schematically shows a state in which the gradation error ERa generated by determining the presence or absence of dot formation for the pixel Pa is diffused to the surrounding undetermined pixels. Here, since processing is performed for each block, the pixel on the left side of the processing block has already been determined for dot formation. In FIG. 30, the pixels for which dot formation has been determined are hatched and displayed. Therefore, as shown in FIG. 30A, the gradation error ERa generated in the pixel Pa is diffused to the three pixels in the processing block with a predetermined weight coefficient. FIG. 31 is an explanatory diagram exemplifying weighting factors for converting gradation errors. The * mark in the figure indicates a pixel in which a tone error has occurred due to the determination of dot formation, and the numerical values in the surrounding pixels indicate weighting factors for distributing the error to that pixel. ing.

画素Paで生じた階調誤差に、図31(a)に示した重み係数を乗算することにより、処理ブロック内の各画素に分配すべき誤差を算出することができる。ここで、誤差を分配すべき各画素は、ほどなくドット形成有無を判断される画素であるから、これら誤差はメモリ上に一時記憶しておく。図30中で、画素から隣接する画素に向かう実線の矢印は、算出した誤差を周辺の画素に分配してメモリ上で蓄積するのではなく、誤差そのものを一時的に記憶しておくことを表している。   By multiplying the gradation error generated in the pixel Pa by the weighting coefficient shown in FIG. 31A, an error to be distributed to each pixel in the processing block can be calculated. Here, since each pixel to which an error is to be distributed is a pixel for which it is determined whether or not a dot is formed, these errors are temporarily stored in a memory. In FIG. 30, a solid line arrow pointing from a pixel to an adjacent pixel indicates that the calculated error is not temporarily distributed to the surrounding pixels and stored in the memory, but the error itself is temporarily stored. ing.

画素Paに続いて、画素Pbのドット形成有無を判断する。判断に際しては、画素Pbの画像データと、画素Pbに対応付けて記憶されている拡散誤差と、メモリ上に一時的に蓄えておいた誤差(画素Paの階調誤差ERaに所定の重み係数を乗算した階調値)とを読み出し、これらを加算して補正データを算出する。こうして得られた補正データと所定の閾値とを比較することによって、画素Pbについてのドット形成有無を判断することができる。次いで、ドット形成の判断結果に応じて画素Pbで生じた階調誤差ERbを算出し、図31(b)に示した重み係数を用いて周辺の未判断画素に分配すべき誤差を算出する。こうして得られた誤差を分配すべき画素も、ほどなくドット形成有無を判断する画素であると考えられる。そこで、得られた誤差はいずれもメモリ上の一時的に蓄えておく。尚、図31(b)に示した重み係数は、誤差拡散法をブロック単位で行うことを考慮して、処理中のブロック外の画素よりもブロック内の画素により多くの誤差が分配されるように設定されている。もちろん、周辺の画素に均等に誤差が分配されるような重み係数としても良い。   Following the pixel Pa, the presence / absence of dot formation of the pixel Pb is determined. In the determination, the image data of the pixel Pb, the diffusion error stored in association with the pixel Pb, and the error temporarily stored in the memory (a predetermined weighting factor is applied to the gradation error ERa of the pixel Pa). (Multiplied gradation value) is read out and added to calculate correction data. By comparing the correction data thus obtained with a predetermined threshold value, it is possible to determine whether or not dots are formed for the pixel Pb. Next, the gradation error ERb generated in the pixel Pb is calculated according to the dot formation determination result, and the error to be distributed to the surrounding undetermined pixels is calculated using the weighting factor shown in FIG. The pixel to which the error thus obtained is to be distributed is considered to be a pixel for determining whether or not to form dots soon. Therefore, all the obtained errors are temporarily stored in the memory. The weighting factor shown in FIG. 31 (b) is such that more errors are distributed to the pixels in the block than the pixels outside the block being processed in consideration of performing the error diffusion method in units of blocks. Is set to Of course, a weighting coefficient that evenly distributes errors to surrounding pixels may be used.

ここで、画素Pbから右隣の画素、および右下の画素に分配される誤差を、メモリ上に一時的に記憶している理由について補足して説明する。図27を用いて説明したように、処理ブロックについてのドット形成有無の判断を、画素毎に行うか、それとも図28を用いて説明したように、ブロックをまとめて行うかは、処理ブロックの補正データの階調値によって決定される。従って、処理ブロックの右隣のブロックについては、必ずしも画素毎にドット形成有無を判断するとは限らない。すなわち、画素Pbから右隣の画素あるいは右下の画素に分配される誤差が、程なく使用されるのは、右隣のブロックも画素毎にドット形成有無が判断される場合である。しかし画像データは、ほとんどの場合、近傍の画素ではほぼ同じ様な階調値を取るから、処理中のブロックを画素毎に判断していれば、右隣のブロックについてもかなりの高い確率で画素毎に判断すると考えることができる。そうであれば、画素Pbから右隣の画素および右下の画素に分配すべき誤差も、一時的にメモリ上に蓄えておくことで、ドット形成有無を判断する処理を高速化することが可能である。この様なことを考慮して、ここでは、画素Pbから周辺画素に分配すべき誤差は、メモリ上に一時的に蓄えることとしている。そして、仮に右隣のブロックが、ブロックをまとめてドット形成有無が判断される場合は、メモリ上に一時的に蓄えておいた誤差をこれらの画素に分配してやればよい。また、より簡便には、一時的に蓄えた誤差をこれらの画素に分配することなく、処理を行うこととしてもよい。ブロック全体としてドット形成有無を判断する領域では、ドットがまばらに形成されるから、隣接するブロックからの誤差の拡散を省略したとしても、これによる影響は限定的であり、処理を簡素なものとすることで、処理速度の更なる向上を図ることができる。   Here, the reason why the error distributed from the pixel Pb to the right adjacent pixel and the lower right pixel is temporarily stored in the memory will be supplementarily described. As described with reference to FIG. 27, whether the determination of dot formation on a processing block is performed for each pixel or whether the blocks are collectively performed as described with reference to FIG. It is determined by the gradation value of the data. Therefore, regarding the block on the right side of the processing block, the presence / absence of dot formation is not necessarily determined for each pixel. That is, the error distributed from the pixel Pb to the right adjacent pixel or the lower right pixel is used soon when the dot formation is determined for each pixel in the right adjacent block. However, in most cases, the image data takes almost the same gradation value in the neighboring pixels. Therefore, if the block being processed is judged for each pixel, the pixel in the right adjacent block has a considerably high probability. It can be considered to judge every time. If so, the error to be distributed from the pixel Pb to the right adjacent pixel and the lower right pixel can also be temporarily stored in the memory, so that the process of determining whether or not dots are formed can be sped up. It is. In consideration of this, here, the error to be distributed from the pixel Pb to the peripheral pixels is temporarily stored in the memory. If it is determined whether the right adjacent block collects the blocks and whether or not dots are formed, the error temporarily stored in the memory may be distributed to these pixels. Further, more simply, the processing may be performed without distributing the temporarily accumulated error to these pixels. In the area where the presence / absence of dot formation as a whole block is determined, dots are formed sparsely, so even if error diffusion from adjacent blocks is omitted, the effect of this is limited and the processing is simplified. By doing so, the processing speed can be further improved.

以上のようにして、画素Pbについての処理を終了したら、画素Pcについての処理を開始する。画素Pcについても同様にしてドット形成の有無を判断し、判断によって生じた階調誤差ERcを算出する。次いで、図31(c)に示した重み係数に従って、周辺の各画素に分配すべき誤差を算出する。画素Pcからの誤差を拡散する場合、処理中のブロック内の画素は右隣の画素Pdしか存在しない。そこで、画素Pcの階調誤差の拡散には、周辺の画素に誤差が均等に分配されるような図31(c)に示す重み係数を使用している。もちろん、処理中のブロック内の画素に、より多くの誤差が分配されるように設定された重み係数を用いても良い。   When the process for the pixel Pb is completed as described above, the process for the pixel Pc is started. Similarly, the presence or absence of dot formation is also determined for the pixel Pc, and the gradation error ERc caused by the determination is calculated. Next, the error to be distributed to the surrounding pixels is calculated according to the weighting factor shown in FIG. When the error from the pixel Pc is diffused, only the pixel Pd on the right side exists in the block being processed. Therefore, for the diffusion of the gradation error of the pixel Pc, the weighting coefficient shown in FIG. 31C is used so that the error is evenly distributed to the surrounding pixels. Of course, a weighting factor set so that more errors are distributed to the pixels in the block being processed may be used.

画素Pcの周辺画素の中で、右隣にある画素Pdについては、直ぐ後にドット形成有無が判断される。これに対して、他の画素、すなわち左下の画素、真下の画素、右下の画素についてのドット形成有無の判断は、処理中のラスタ群に含まれる全ての画素についての判断を終了した後になる。そこで、画素Pcから右隣の画素に分配すべき誤差については、メモリ上の一時的に記憶しておき、その他の誤差については、それぞれの画素に分配する。すなわち、メモリ上の所定のアドレスに各画素に対応付けて記憶しておき、他の画素からの誤差が分配されてきた場合は、既に記憶されている誤差に加えて、誤差を蓄積していく。前述したように、図30中で、画素から隣接する画素に向かう実線の矢印は、算出した誤差を一時的に蓄えておくことを示しているが、これに対して、画素から隣接する画素に向かう白抜きの矢印は、誤差を一時的に記憶するのではなく、これら画素に分配することを表している。   Regarding the pixel Pd adjacent to the right among the peripheral pixels of the pixel Pc, the presence / absence of dot formation is determined immediately thereafter. On the other hand, the determination of dot formation for other pixels, that is, the lower left pixel, the lower right pixel, and the lower right pixel is after the determination for all the pixels included in the raster group being processed is completed. . Therefore, the error to be distributed from the pixel Pc to the right adjacent pixel is temporarily stored in the memory, and the other errors are distributed to the respective pixels. In other words, a predetermined address on the memory is stored in association with each pixel, and when errors from other pixels are distributed, the errors are accumulated in addition to the errors already stored. . As described above, in FIG. 30, the solid line arrow from the pixel to the adjacent pixel indicates that the calculated error is temporarily stored. On the other hand, from the pixel to the adjacent pixel, The white arrow heading indicates that the error is not temporarily stored but distributed to these pixels.

こうして画素Pcについての処理を終了したら、画素Pdについてのドット形成の有無を判断する。図30に示した例では、画素Pdには分配される誤差は、画素Paないし画素Pcの3つ画素からの誤差のみであり、これら誤差は前述したようにメモリ上に一時的に記憶されている。従って、画素Pdについての判断に際しては、画素Pdの画像データを読み出して、メモリ上に一時的に蓄えておいた誤差を加算することによって補正データを算出することができる。こうすれば、画素Pdに対応付けて記憶されている拡散誤差をメモリ上から読み出す処理が不要となるので、補正データを迅速に算出することができ、延いては、ドット形成有無の判断を迅速に行うことができる。また、一時的に蓄えておく誤差は、データ数が限られており、従ってレジスタなどの高速に読み書き可能なメモリに蓄えておくことができる。こうすれば、より一層の高速化を図ることができる。更に、これら誤差を意図的にレジスタを記憶するのではなく、一般的なメモリ上に記憶する場合でも、実際には、これら誤差はキャッシュメモリから読み出される可能性が高く、従って通常は迅速に読み出すことができる。このため、補正データを迅速に算出することができ、延いてはドット形成有無を判断する処理を高速化することが可能となる。   When the process for the pixel Pc is completed in this way, it is determined whether or not dots are formed for the pixel Pd. In the example shown in FIG. 30, the error distributed to the pixel Pd is only the error from the three pixels Pa to Pc, and these errors are temporarily stored in the memory as described above. Yes. Therefore, when determining the pixel Pd, the correction data can be calculated by reading the image data of the pixel Pd and adding the error temporarily stored in the memory. This eliminates the need to read out the diffusion error stored in association with the pixel Pd from the memory, so that the correction data can be calculated quickly, and the determination of dot formation presence / absence can be quickly performed. Can be done. Further, the error to be temporarily stored has a limited number of data, and therefore can be stored in a memory such as a register that can be read and written at high speed. In this way, it is possible to further increase the speed. Furthermore, even if these errors are not intentionally stored in registers but stored in general memory, in practice, these errors are likely to be read from the cache memory, and are therefore usually read quickly. be able to. For this reason, it is possible to calculate correction data quickly, and it is possible to speed up the process of determining whether or not dots are formed.

画素Pdについてのドット形成有無を判断したら、判断によって生じた階調誤差ERdを算出し、周辺の画素に分配する処理を行う。図30(d)は、画素Pdで生じた階調誤差ERdを拡散する様子を模式的に示している。各画素へ分配すべき誤差は、図30(c)に示した重み係数を用いて算出する。そして、画素Pdの左下、真下、右下の各画素へは、算出したそれぞれの誤差を分散させ、画素Pdの右隣の画素へ分配すべき誤差は、メモリ上に一時的に蓄えておく。   When it is determined whether or not dots are formed for the pixel Pd, the gradation error ERd generated by the determination is calculated and distributed to surrounding pixels. FIG. 30D schematically shows a state where the gradation error ERd generated in the pixel Pd is diffused. The error to be distributed to each pixel is calculated using the weighting factor shown in FIG. Then, the calculated errors are distributed to the lower left, right below, and lower right pixels of the pixel Pd, and the error to be distributed to the right adjacent pixel of the pixel Pd is temporarily stored in the memory.

尚、図30(d)に示されているように、画素Pdに右上にも未判断画素が存在している。そこで、画素Pdで生じた階調誤差を、右上の画素にも分配することとしても良い。このように、右上の画素にも誤差を拡散すれば、画質を効果的に改善できる場合がある。図31(d)は、このような場合に使用される重み係数の設定を例示している。画素Pdの右上の画素は、画素Pdに続いてドット形成有無を判断する画素であるから、この画素への誤差はメモリ上に一時的に記憶しておく。図30(d)中で画素Pdから右上の画素に向かう破線の矢印は、この画素への誤差をメモリ上に一時的に蓄えることを表している。   As shown in FIG. 30D, there is an undetermined pixel in the upper right of the pixel Pd. Therefore, the gradation error generated in the pixel Pd may be distributed to the upper right pixel. As described above, if the error is diffused also in the upper right pixel, the image quality may be effectively improved. FIG. 31D illustrates the setting of weighting factors used in such a case. Since the upper right pixel of the pixel Pd is a pixel that determines whether or not dots are formed following the pixel Pd, the error to this pixel is temporarily stored in the memory. In FIG. 30D, a broken-line arrow from the pixel Pd to the upper right pixel indicates that an error for this pixel is temporarily stored in the memory.

図27に示したステップS468では、以上の様にして、誤差拡散法を適用しながら処理ブロック内の各画素毎にドットの形成の有無を判断する処理を行う。こうして、処理ブロック内の全ての画素についてのドット形成の有無を判断したら、図27のフローチャートに示した処理を抜けて、図25に示した第3実施例の変形例の階調数変換処理に復帰する。階調数変換処理では、処理中のラスタ群の全画素についての処理を終了したか否かを判断し(図25のステップS412)、未処理の画素が残っていれば、処理ブロックを1ブロックだけ右方向に移動させて、続く一連の処理を繰り返す。   In step S468 shown in FIG. 27, processing for determining whether or not dots are formed for each pixel in the processing block is performed as described above while applying the error diffusion method. In this manner, when it is determined whether or not dots are formed for all the pixels in the processing block, the process shown in the flowchart of FIG. 27 is skipped, and the gradation number conversion process of the modified example of the third embodiment shown in FIG. 25 is performed. Return. In the tone number conversion process, it is determined whether or not the process has been completed for all the pixels of the raster group being processed (step S412 in FIG. 25). If there are any unprocessed pixels, one process block is determined. Only the right direction is moved, and the following series of processes is repeated.

以上に説明したように、第3実施例の変形例の階調数変換処理では、ラスタ群を複数のブロックに区分けして、ブロック毎にドット形成有無を判断する。こうすれば、ラスタ群内の複数のラスタを並行して処理することに加えて、ブロック内の各画素を一括してドット形成有無を判断することで、階調数変換処理の高速化を図ることができる。例えば、処理しようとするブロックの補正データに応じて、ブロック内の画素を区別することなく、ドット形成有無を判断してやれば、処理を迅速化することが可能である。   As described above, in the tone number conversion process of the modification of the third embodiment, the raster group is divided into a plurality of blocks, and the presence / absence of dot formation is determined for each block. In this way, in addition to processing a plurality of rasters in the raster group in parallel, the tone number conversion processing is speeded up by determining whether or not dots are formed for each pixel in the block at once. be able to. For example, if it is determined whether or not dots are formed without distinguishing the pixels in the block according to the correction data of the block to be processed, the processing can be speeded up.

尚、以上の説明では、処理ブロックについての補正データBxを算出し、得られた補正データBxと所定の閾値とを比較することによって、該ブロックについての処理方法を使い分けるものとしたが、簡便には、ブロック内の総和Sに基づいて判断することとしても良い。こうすれば、補正データを算出することなくドット形成有無を判断することができるので、処理を高速化することができる。   In the above description, the correction data Bx for the processing block is calculated, and the obtained correction data Bx is compared with a predetermined threshold value, so that the processing method for the block is selectively used. May be determined based on the sum S in the block. In this way, since it is possible to determine the presence or absence of dot formation without calculating correction data, the processing can be speeded up.

また、上述した説明では、ブロックは縦横2画素ずつ合計4画素から構成されているものとしたが、ブロックの構成は、必要に応じて種々の構成とすることができる。例えば、より多くの画素によって構成しても良く、また縦方向と横方向とで画素数を異ならせても良い。   In the above description, the block is composed of 4 pixels in total of 2 pixels in the vertical and horizontal directions. However, the configuration of the block may be various as required. For example, it may be configured by more pixels, and the number of pixels may be different in the vertical direction and the horizontal direction.

更に、ブロック内で、各画素を処理する順番についても、上述した順番に限らず必要に応じて適切な順番とすることができる。   Furthermore, the order in which each pixel is processed in the block is not limited to the order described above, and can be set to an appropriate order as necessary.

また、階調誤差を拡散する範囲も、図29あるいは図31に例示したものに限られず、より遠方の画素に拡散させることとしても良い。   Further, the range in which the gradation error is diffused is not limited to that illustrated in FIG. 29 or FIG. 31, and may be diffused to a farther pixel.

以上、各種の実施例について説明してきたが、本発明は上記すべての実施例に限られるものではなく、その要旨を逸脱しない範囲において種々の態様で実施することができる。例えば、上述の機能を実現するソフトウェアプログラム(アプリケーションプログラム)を、通信回線を介してコンピュータシステムのメインメモリまたは外部記憶装置に供給し実行するものであってもよい。もちろん、CD−ROMやフレキシブルディスクに記憶されたソフトウェアプログラムを読み込んで実行するものであっても構わない。   Although various embodiments have been described above, the present invention is not limited to all the embodiments described above, and can be implemented in various modes without departing from the scope of the invention. For example, a software program (application program) that realizes the above functions may be supplied to a main memory or an external storage device of a computer system via a communication line and executed. Of course, a software program stored in a CD-ROM or a flexible disk may be read and executed.

また、上述した各種実施例では、階調数変換処理を含む画像データ変換処理はコンピュータ内で実行されるものとして説明したが、画像データ変換処理の一部あるいは全部をプリンタ側、あるいは専用の画像処理装置を用いて実行するものであっても構わない。   In the various embodiments described above, the image data conversion process including the gradation number conversion process is described as being executed in the computer. However, part or all of the image data conversion process is performed on the printer side or a dedicated image. It may be executed using a processing device.

更には、画像表示装置は、必ずしも印刷媒体上にインクドットを形成して画像を印刷する印刷装置に限定されるものではない。例えば、液晶表示画面上で輝点を適切な密度で分散させることにより、階調が連続的に変化する画像を表現する液晶表示装置に対しても、本発明を効果的に適用することが可能である。   Furthermore, the image display device is not necessarily limited to a printing device that prints an image by forming ink dots on a print medium. For example, the present invention can be effectively applied to a liquid crystal display device that expresses an image whose gradation changes continuously by dispersing bright spots at an appropriate density on the liquid crystal display screen. It is.

印刷システムを例にとって本発明の画像処理装置の概要を示す説明図である。1 is an explanatory diagram showing an outline of an image processing apparatus according to the present invention, taking a printing system as an example. FIG. 本実施例の画像処理装置としてのコンピュータの構成を示す説明図である。It is explanatory drawing which shows the structure of the computer as an image processing apparatus of a present Example. 本実施例の画像処理装置に組み合わせて用いられるプリンタの概略構成図である。1 is a schematic configuration diagram of a printer used in combination with the image processing apparatus of the present embodiment. プリンタの印字ヘッドの底面に複数のノズルが設けられている様子を示す説明図である。It is explanatory drawing which shows a mode that the several nozzle is provided in the bottom face of the printing head of a printer. 本実施例の画像処理装置で行われる画像データ変換処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the image data conversion process performed with the image processing apparatus of a present Example. 画像データ変換処理中で用いられる閾値マトリックスを例示した説明図である。It is explanatory drawing which illustrated the threshold value matrix used in an image data conversion process. 閾値マトリックスに記憶された閾値を画像データに対応付けてドット形成有無を判断している様子を示す説明図である。It is explanatory drawing which shows a mode that the threshold value memorize | stored in the threshold value matrix is matched with image data, and the presence or absence of dot formation is judged. 第1実施例の階調数変換処理において複数本のラスタを並行させながらドット形成有無を判断する処理の流れを示すフローチャートである。6 is a flowchart showing a flow of processing for determining the presence or absence of dot formation while paralleling a plurality of rasters in the gradation number conversion processing of the first embodiment. 第1実施例の階調数変換処理において複数本のラスタを並行させながらドット形成有無を判断している様子を模式的に示した説明図である。It is explanatory drawing which showed typically a mode that the presence or absence of dot formation was judged in parallel with several rasters in the gradation number conversion process of 1st Example. 第1実施例の階調数変換処理の各種変形例において、複数本のラスタを並行させながらドット形成の有無を判断している様子を示す説明図である。It is explanatory drawing which shows a mode that the presence or absence of dot formation is judged in the various modifications of the gradation number conversion process of 1st Example, making several rasters parallel. 閾値マトリックスを構成する各マス目の表示方法を示す説明図である。It is explanatory drawing which shows the display method of each square which comprises a threshold value matrix. 第2実施例の階調数変換処理において閾値マトリックスの閾値が、対称画素を選択する順序を考慮して格納されている様子を概念的に示した説明図である。It is explanatory drawing which showed notionally the mode that the threshold value of a threshold value matrix was stored in consideration of the order which selects a symmetrical pixel in the gradation number conversion process of 2nd Example. 第2実施例の階調数変換処理において閾値マトリックスから閾値を読み出している様子を模式的に示した説明図である。It is explanatory drawing which showed typically a mode that the threshold value was read from the threshold value matrix in the gradation number conversion process of 2nd Example. 対象画素を選択する順序に応じて閾値マトリックスの閾値が適切な順序で記憶されている様子を示す説明図である。It is explanatory drawing which shows a mode that the threshold value of a threshold value matrix is memorize | stored in the suitable order according to the order which selects an object pixel. 第2実施例の変形例において、閾値マトリックスを、ラスタ群に含まれるラスタ数と同じラスタ数だけずらしながら、画像データに対応付けている様子を示す説明図である。FIG. 10 is an explanatory diagram showing a state in which a threshold value matrix is associated with image data while being shifted by the same number of rasters as the number of rasters included in a raster group in a modification of the second embodiment. 閾値マトリックスを、ラスタ群に含まれるラスタ数と同じラスタ数だけずらしながら対応付けたときに、閾値マトリックスから閾値が読み出される様子を示す説明図である。It is explanatory drawing which shows a mode that a threshold value is read from a threshold value matrix, when it matches, shifting a threshold value matrix by the same raster number as the number of rasters contained in a raster group. 第2実施例の他の変形例において、閾値マトリックスを、ラスタ群に含まれるラスタ数の整数倍のラスタ数だけずらしながら、画像データに対応付けている様子を示す説明図である。FIG. 15 is an explanatory diagram showing a state in which a threshold value matrix is associated with image data while being shifted by a number of rasters that is an integral multiple of the number of rasters included in a raster group in another modification of the second embodiment. ディザ法と誤差拡散法とを組み合わせて階調数変換処理を行う際の基本的な考え方を示す説明図である。It is explanatory drawing which shows the basic way of thinking at the time of performing the gradation number conversion process combining the dither method and the error diffusion method. ディザ法と誤差拡散法とを切り換えながら処理を行う第3実施例の階調数変換処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the gradation number conversion process of 3rd Example which processes while switching a dither method and an error diffusion method. 第3実施例の階調数変換処理中でディザ法を適用してドット形成有無を判断する処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the process which judges the dot formation presence or absence by applying a dither method in the gradation number conversion process of 3rd Example. 第3実施例の階調数変換処理において複数本のラスタを並行させながらドット形成の有無を判断している様子を模式的に示した説明図である。It is explanatory drawing which showed typically a mode that the presence or absence of dot formation was judged in the gradation number conversion process of 3rd Example, making several rasters parallel. 第3実施例の階調数変換処理中で誤差拡散法を適用してドット形成有無を判断する処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the process which judges the dot formation presence or absence by applying an error diffusion method in the gradation number conversion process of 3rd Example. 誤差拡散法において階調誤差を周辺の未判断画素へ拡散するために用いられる重み係数を例示した説明図である。It is explanatory drawing which illustrated the weighting coefficient used in order to diffuse a gradation error to the surrounding undetermined pixel in an error diffusion method. 第3実施例の階調数変換処理において複数本のラスタを並行させながら、誤差拡散法を適用してドット形成の有無を判断している様子を模式的に示す説明図である。It is explanatory drawing which shows typically a mode that the presence or absence of dot formation is judged by applying an error diffusion method, making the several raster parallel in the gradation number conversion process of 3rd Example. ラスタ群を複数のブロックに区分して処理を行う第3実施例の変形例の階調数変換処理の流れを示したフローチャートである。It is the flowchart which showed the flow of the gradation number conversion process of the modification of the 3rd Example which divides | segments a raster group into a some block, and processes. 第3実施例の変形例においてラスタ群が複数のブロックに区分されている様子を模式的に示した説明図である。It is explanatory drawing which showed typically a mode that the raster group was divided into the some block in the modification of 3rd Example. 第3実施例の変形例の階調数変換処理において、誤差拡散法を用いてブロック毎にドット形成有無を判断する処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the process which judges the dot formation presence or absence for every block using an error diffusion method in the gradation number conversion process of the modification of 3rd Example. 第3実施例の変形例の階調数変換処理において、ブロックをまとめてドット形成有無を判断する様子を示す説明図である。FIG. 10 is an explanatory diagram illustrating a state in which whether or not dots are formed is determined collectively in blocks in a gradation number conversion process according to a modified example of the third embodiment. 第3実施例の変形例の階調数変換処理において、ブロックで発生した階調誤差を周辺画素に拡散するための重み係数を例示した説明図である。It is explanatory drawing which illustrated the weighting coefficient for diffusing the gradation error which generate | occur | produced in the block to a surrounding pixel in the gradation number conversion process of the modification of 3rd Example. 第3実施例の変形例の階調数変換処理において、誤差拡散法を適用しながらブロック毎にドット形成有無を判断している様子を示す説明図である。FIG. 10 is an explanatory diagram showing a state in which the presence / absence of dot formation is determined for each block while applying an error diffusion method in a tone number conversion process of a modification of the third embodiment. 第3実施例の変形例の階調数変換処理において、ブロック内の各画素で生じた階調誤差を周辺画素に拡散するための重み係数を例示した説明図である。It is explanatory drawing which illustrated the weighting coefficient for diffusing the gradation error produced in each pixel in a block to a surrounding pixel in the gradation number conversion process of the modification of 3rd Example.

符号の説明Explanation of symbols

10…画像処理装置
20…プリンタ
100…コンピュータ
102…CPU
104…ROM
106…RAM
108…周辺機器インターフェースP−I/F
109…ディスクコントローラDDC
110…ネットワークインターフェースカードNIC
112…ビデオインターフェースV−I/F
114…CRT
116…バス
118…ハードディスク
120…デジタルカメラ
122…カラースキャナ
124…フレキシブルディスク
126…コンパクトディスク
200…カラープリンタ
230…キャリッジモータ
235…紙送りモータ
236…プラテン
240…キャリッジ
241…印字ヘッド
242,243…インクカートリッジ
244…インク吐出用ヘッド
260…制御回路
261…CPU
262…ROM
263…RAM
300…通信回線
310…記憶装置
DESCRIPTION OF SYMBOLS 10 ... Image processing apparatus 20 ... Printer 100 ... Computer 102 ... CPU
104 ... ROM
106 ... RAM
108 ... Peripheral device interface PI / F
109 ... Disk controller DDC
110: Network interface card NIC
112 ... Video interface V-I / F
114 ... CRT
116: Bus 118 ... Hard disk 120 ... Digital camera 122 ... Color scanner 124 ... Flexible disk 126 ... Compact disk 200 ... Color printer 230 ... Carriage motor 235 ... Paper feed motor 236 ... Platen 240 ... Carriage 241 ... Print heads 242, 243 ... Ink Cartridge 244 ... Ink ejection head 260 ... Control circuit 261 ... CPU
262 ... ROM
263 ... RAM
300 ... Communication line 310 ... Storage device

Claims (11)

カラー画像データを構成する各画素についてのドット形成の有無を各色成分毎に判断することによって、該カラー画像データをドットの形成有無による表現形式の各色のデータに変換する画像処理装置であって、
画素の列であるラスタであって互いに隣接する所定のN本(Nは2以上の整数)のラスタをまとめてラスタ群を生成するラスタ群生成手段と、
前記各色成分の中から予め選択された第1の色成分の画像データについては、各画素の前記階調値と各画素に対応付けられた所定の閾値とを比較しながら、前記ラスタ群を構成する前記N本のラスタを並行してドット列に変換することにより、ドットの形成有無による表現形式のデータに変換する第1の画像変換処理を実施する第1のデータ変換手段と、
前記各色成分から前記第1の色成分を除いた第2の色成分の画像データについては、ドット形成の有無を判断したことで判断した画素で生じた階調誤差を周辺の未判断画素に拡散するとともに、周辺の判断済みの画素から拡散されてきた階調誤差を解消するようにドット形成の有無を判断しながら、前記ラスタ群を構成する前記N本のラスタを並行してドット列に変換することにより、ドットの形成有無による表現形式のデータに変換する第2の画像変換処理を実施する第2のデータ変換手段と
を備え、
前記第1,第2のデータ変換手段は、前記第1,第2の画像変換処理を、キャッシュ、パイプライン処理の少なくとも一方を実装するコンピュータの処理として実施し、
前記第1のデータ変換手段は、
複数の前記閾値が二次元的に配列された閾値マトリックスを記憶しておく閾値マトリックス記憶手段と、
ドットの形成有無の判断を行う対象画素を選択する対象画素選択手段と、
前記対象画素に対応する閾値を前記閾値マトリックスの中から読み出して、該対象画素に対応付けられた前記階調値と比較することにより、該対象画素についてのドット形成有無を判断するドット形成判断手段と
を備え、
前記対象画素選択手段は、前記ラスタ群に含まれる各画素を所定の順番に従って順次選択することにより、該ラスタ群を構成する各ラスタから並行して前記対象画素を選択する手段であり、
前記対象画素選択手段における画素の選択の順番は、同一ラスタ上で連続して選択される画素が2つまでとした
画像処理装置。
An image processing apparatus that converts the color image data into data of each color in an expression format based on the presence or absence of dot formation by determining the presence or absence of dot formation for each pixel constituting each color image data,
Raster group generation means for generating a raster group by combining predetermined N (N is an integer of 2 or more) rasters that are adjacent to each other, which are rasters of pixel rows;
For the image data of the first color component selected in advance from the color components, the raster group is configured by comparing the gradation value of each pixel with a predetermined threshold value associated with each pixel. First data conversion means for performing a first image conversion process of converting the N rasters to dot rows in parallel, thereby converting the data into data in an expression format depending on whether or not dots are formed;
For the image data of the second color component obtained by removing the first color component from each color component, the gradation error caused by the pixel determined by determining the presence / absence of dot formation is diffused to surrounding undetermined pixels. At the same time, the N rasters constituting the raster group are converted into dot rows in parallel while judging the presence / absence of dot formation so as to eliminate the gradation error diffused from the surrounding judged pixels. And a second data conversion means for performing a second image conversion process for converting the data into an expression format data based on the presence or absence of dot formation,
The first and second data conversion means perform the first and second image conversion processing as processing of a computer that implements at least one of cache and pipeline processing ,
The first data conversion means includes
Threshold matrix storage means for storing a threshold matrix in which a plurality of the thresholds are two-dimensionally arranged;
Target pixel selection means for selecting a target pixel for determining whether or not to form a dot;
A dot formation determination unit that reads out a threshold value corresponding to the target pixel from the threshold value matrix and compares the threshold value with the gradation value corresponding to the target pixel, thereby determining whether or not the target pixel is formed. When
With
The target pixel selecting means is means for selecting the target pixel in parallel from each raster constituting the raster group by sequentially selecting each pixel included in the raster group in a predetermined order.
An image processing apparatus in which the pixel selection order in the target pixel selection means is up to two pixels that are continuously selected on the same raster .
カラー画像データを構成する各画素についてのドット形成の有無を各色成分毎に判断することによって、該カラー画像データをドットの形成有無による表現形式の各色のデータに変換する画像処理装置であって、
画素の列であるラスタであって互いに隣接する所定のN本(Nは2以上の整数)のラスタをまとめてラスタ群を生成するラスタ群生成手段と、
前記各色成分の中から予め選択された第1の色成分の画像データについては、各画素の前記階調値と各画素に対応付けられた所定の閾値とを比較しながら、前記ラスタ群を構成する前記N本のラスタを並行してドット列に変換することにより、ドットの形成有無による表現形式のデータに変換する第1の画像変換処理を実施する第1のデータ変換手段と、
前記各色成分から前記第1の色成分を除いた第2の色成分の画像データについては、ドット形成の有無を判断したことで判断した画素で生じた階調誤差を周辺の未判断画素に拡散するとともに、周辺の判断済みの画素から拡散されてきた階調誤差を解消するようにドット形成の有無を判断しながら、前記ラスタ群を構成する前記N本のラスタを並行してドット列に変換することにより、ドットの形成有無による表現形式のデータに変換する第2の画像変換処理を実施する第2のデータ変換手段と
を備え、
前記第1,第2のデータ変換手段は、前記第1,第2の画像変換処理を、キャッシュ、パイプライン処理の少なくとも一方を実装するコンピュータの処理として実施し、
前記第1のデータ変換手段は、
複数の前記閾値が二次元的に配列された閾値マトリックスを記憶しておく閾値マトリックス記憶手段と、
ドットの形成有無の判断を行う対象画素を選択する対象画素選択手段と、
前記対象画素に対応する閾値を前記閾値マトリックスの中から読み出して、該対象画素に対応付けられた前記階調値と比較することにより、該対象画素についてのドット形成有無を判断するドット形成判断手段と
を備え、
前記対象画素選択手段は、前記ラスタ群に含まれる各画素を所定の順番に従って順次選択することにより、該ラスタ群を構成する各ラスタから並行して前記対象画素を選択する手段であり、
前記対象画素選択手段における画素の選択の順番は、前記複数のラスタにおいてラスタ方向に同一の位置にある画素を順次選択した後で、隣接するラスタの画素の選択に移行する
画像処理装置。
An image processing apparatus that converts the color image data into data of each color in an expression format based on the presence or absence of dot formation by determining the presence or absence of dot formation for each pixel constituting each color image data,
Raster group generation means for generating a raster group by combining predetermined N (N is an integer of 2 or more) rasters that are adjacent to each other, which are rasters of pixel rows;
For the image data of the first color component selected in advance from the color components, the raster group is configured by comparing the gradation value of each pixel with a predetermined threshold value associated with each pixel. First data conversion means for performing a first image conversion process of converting the N rasters to dot rows in parallel, thereby converting the data into data in an expression format depending on whether or not dots are formed;
For the image data of the second color component obtained by removing the first color component from each color component, the gradation error caused by the pixel determined by determining the presence / absence of dot formation is diffused to surrounding undetermined pixels. At the same time, the N rasters constituting the raster group are converted into dot rows in parallel while judging the presence / absence of dot formation so as to eliminate the gradation error diffused from the surrounding judged pixels. A second data conversion means for performing a second image conversion process for converting the data into an expression format data depending on whether or not dots are formed.
With
The first and second data conversion means perform the first and second image conversion processing as processing of a computer that implements at least one of cache and pipeline processing,
The first data conversion means includes
Threshold matrix storage means for storing a threshold matrix in which a plurality of the thresholds are two-dimensionally arranged;
Target pixel selection means for selecting a target pixel for determining whether or not to form a dot;
A dot formation determination unit that reads out a threshold value corresponding to the target pixel from the threshold value matrix and compares the threshold value with the gradation value corresponding to the target pixel, thereby determining whether or not the target pixel is formed. When
With
The target pixel selecting means is means for selecting the target pixel in parallel from each raster constituting the raster group by sequentially selecting each pixel included in the raster group in a predetermined order.
An image processing apparatus in which the selection order of pixels in the target pixel selection means shifts to selection of pixels of adjacent rasters after sequentially selecting pixels at the same position in the raster direction in the plurality of rasters.
請求項1または請求項2に記載の画像処理装置であって、
前記第2のデータ変換手段は、
前記ラスタ群の中の最後尾にある最後尾ラスタを選択し、該最後尾ラスタを構成する各画素についてドット形成の有無を判断することによって、該最後尾ラスタをドット形成の有無を表すドット列に変換する最後尾ラスタ変換手段と、
前記階調誤差を、前記最後尾ラスタを構成する各画素について算出し、該各画素の周辺にある複数の未判断の画素に拡散する第1の誤差拡散手段と、
前記最後尾ラスタに隣接するラスタ群の中の先頭位置にある先頭ラスタを選択し、該最後尾ラスタから該先頭ラスタの各画素に拡散された前記階調誤差を考慮しながら、該先頭ラスタを構成する各画素についてドット形成の有無を判断することによって、該先頭ラスタをドット形成の有無を表すドット列に変換する先頭ラスタ変換手段と、
前記先頭ラスタを構成する各画素で生じた前記階調誤差を、該各画素の周辺にある未判断の画素に拡散する第2の誤差拡散手段と、
前記ラスタ群から前記先頭ラスタを除いた残余ラスタについては、該残余ラスタと同じラスタ群に属し且つドット形成有無を判断済みの画素から拡散された前記階調誤差を考慮しながら該残余ラスタの各画素のドット形成有無を判断することにより、該先頭ラスタを前記ドット列に変換する処理に並行して該残余ラスタをドット列に変換する残余ラスタ変換手段と
を備え、
前記第1の誤差拡散手段および前記第2の誤差拡散手段は、前記ドット形成の有無を判断した画素とは異なるラスタ群の画素に拡散された誤差については第1の誤差記憶部に記憶し、該ドット形成有無を判断した画素と同じラスタ群の画素に拡散された誤差については第2の誤差記憶部に記憶する手段である画像処理装置。
The image processing apparatus according to claim 1 or 2 ,
The second data conversion means includes
The last raster in the raster group is selected, and a dot string representing the presence or absence of dot formation is determined by determining the presence or absence of dot formation for each pixel constituting the last raster. The last raster converting means for converting to
A first error diffusing means for calculating the gradation error for each pixel constituting the tail raster and diffusing to a plurality of undetermined pixels around each pixel;
The first raster at the head position in the raster group adjacent to the last raster is selected, and the first raster is selected while considering the gradation error diffused from the last raster to each pixel of the first raster. First raster conversion means for converting the first raster into a dot row representing the presence / absence of dot formation by determining the presence / absence of dot formation for each of the constituent pixels;
Second error diffusion means for diffusing the gradation error generated in each pixel constituting the head raster to undecided pixels around each pixel;
For the remaining rasters obtained by removing the head raster from the raster group, each of the remaining rasters is considered in consideration of the gradation error diffused from pixels that belong to the same raster group as the residual raster and for which dot formation has been determined. A residual raster converting means for converting the residual raster into a dot row in parallel with the process of converting the leading raster into the dot row by determining the presence or absence of dot formation of a pixel;
The first error diffusing unit and the second error diffusing unit store, in the first error storage unit, an error diffused to a pixel of a raster group different from the pixel for which the presence / absence of dot formation is determined, An image processing apparatus which is means for storing an error diffused to a pixel in the same raster group as the pixel for which the dot formation is determined or not, in a second error storage unit.
請求項1または請求項2記載の画像処理装置であって、
前記第2のデータ変換手段は、
前記ラスタ群を構成する複数の画素を、縦横それぞれ所定画素数ずつの複数の画素からなるブロックとしてまとめることにより、該ラスタ群を複数のブロックに区分するブロック形成手段と、
前記ドットの形成有無の判断を前記ブロック単位で行うことにより、前記ラスタをN本ずつ並行してドット列に変換するブロック単位変換手段と
を備えている画像処理装置。
The image processing apparatus according to claim 1 or 2 ,
The second data conversion means includes
Block forming means for dividing the raster group into a plurality of blocks by grouping a plurality of pixels constituting the raster group as a block composed of a plurality of pixels each having a predetermined number of pixels in the vertical and horizontal directions;
An image processing apparatus comprising: a block unit conversion unit that converts the rasters into N dot columns in parallel by determining whether or not the dots are formed in units of blocks.
請求項4記載の画像処理装置であって、
前記第2のデータ変換手段は、前記第2の画像変換処理を、キャッシュを実装するコンピュータの処理として実施し、
前記ブロック単位変換手段は、前記ブロック単位での前記変換において、前記ブロックの内部における他の画素の処理により生じた前記誤差の配分を受ける処理が終了している画素が複数存在する場合には、前記キャッシュに蓄えられた誤差の配分のデータを利用できる画素の選択を優先して行なう
画像処理装置。
The image processing apparatus according to claim 4 ,
The second data conversion means performs the second image conversion process as a computer process for mounting a cache,
When there are a plurality of pixels for which the process of receiving the distribution of the error caused by the processing of other pixels in the block has been completed in the block-by-block conversion unit, An image processing apparatus that prioritizes selection of pixels that can use error distribution data stored in the cache.
請求項1ないし請求項5のいずれかに記載の画像処理装置であって、
前記カラー画像データは、前記画素の各々に、少なくともシアン色、マゼンタ色、イエロ色を含む各色の階調値を対応付けたデータであり、
前記第1の色成分には、少なくともイエロ色が含まれている画像処理装置。
An image processing apparatus according to any one of claims 1 to 5 ,
The color image data is data in which gradation values of each color including at least cyan, magenta, and yellow are associated with each of the pixels,
The image processing apparatus, wherein the first color component includes at least a yellow color.
請求項1ないし請求項5のいずれかに記載の画像処理装置であって、
前記カラー画像データは、前記画素の各々に、少なくともシアン色、マゼンタ色、イエロ色を含む各色の階調値を対応付けたデータであり、
前記第2の色成分には、少なくともシアン色あるいはマゼンタ色が含まれている画像処理装置。
An image processing apparatus according to any one of claims 1 to 5 ,
The color image data is data in which gradation values of each color including at least cyan, magenta, and yellow are associated with each of the pixels,
The image processing apparatus, wherein the second color component includes at least a cyan color or a magenta color.
請求項1ないし請求項5のいずれかに記載の画像処理装置であって、
前記カラー画像データは、前記画素の各々に、少なくともシアン色、マゼンタ色、イエロ色、ブラック色を含む各色の階調値を対応付けたデータであり、
前記第2の色成分には、少なくともブラック色が含まれている画像処理装置。
An image processing apparatus according to any one of claims 1 to 5 ,
The color image data is data in which gradation values of each color including at least cyan, magenta, yellow, and black are associated with each of the pixels,
The image processing apparatus, wherein the second color component includes at least a black color.
請求項1ないし請求項5のいずれかに記載の画像処理装置であって、
前記カラー画像データは、色相が略同一で濃度が異なる濃淡一組の色を少なくとも含んだ前記所定の複数色の階調値を、前記画素の各々に対応付けたデータであり、
前記濃淡一組の色の中の一方の色は、前記第1の色成分として選択され、他方の色は前記第2の色成分として選択されている画像処理装置。
An image processing apparatus according to any one of claims 1 to 5 ,
The color image data is data in which gradation values of the predetermined plurality of colors including at least a set of shades having substantially the same hue and different densities are associated with each of the pixels,
An image processing apparatus in which one color in the set of shades is selected as the first color component and the other color is selected as the second color component.
カラー画像データを構成する各画素についてのドット形成の有無を各色成分毎に判断することによって、該カラー画像データをドットの形成有無による表現形式の印刷データに変換し、該印刷データに基づいて各色のドットを形成することによって印刷媒体上にカラー画像を表現する印刷装置であって、
画素の列であるラスタであって互いに隣接する所定のN本(Nは2以上の整数)のラスタをまとめてラスタ群を生成するラスタ群生成手段と、
前記各色成分の中から予め選択された第1の色成分の画像データについては、各画素の前記階調値と各画素に対応付けられた所定の閾値とを比較しながら、前記ラスタ群を構成する前記N本のラスタを並行してドット列に変換することにより、ドットの形成有無による表現形式の第1の印刷データに変換する第1の画像変換処理を実施する第1のデータ変換手段と、
前記各色成分から前記第1の色成分を除いた第2の色成分の画像データについては、ドット形成の有無を判断したことで判断した画素で生じた階調誤差を周辺の未判断画素に拡散するとともに、周辺の判断済みの画素から拡散されてきた階調誤差を解消するようにドット形成の有無を判断しながら、前記ラスタ群を構成する前記N本のラスタを並行してドット列に変換することにより、ドットの形成有無による表現形式の第1の印刷データに変換する第2の画像変換処理を実施する第2のデータ変換手段と
前記第1の印刷データおよび第2の印刷データに基づいて印刷媒体上に各色のドットを形成するドット形成手段と
を備え、
前記第1,第2のデータ変換手段は、前記第1,第2の画像変換処理を、キャッシュ、パイプライン処理の少なくとも一方を実装するコンピュータの処理として実施し、
前記第1のデータ変換手段は、
複数の前記閾値が二次元的に配列された閾値マトリックスを記憶しておく閾値マトリックス記憶手段と、
ドットの形成有無の判断を行う対象画素を選択する対象画素選択手段と、
前記対象画素に対応する閾値を前記閾値マトリックスの中から読み出して、該対象画素に対応付けられた前記階調値と比較することにより、該対象画素についてのドット形成有無を判断するドット形成判断手段と
を備え、
前記対象画素選択手段は、前記ラスタ群に含まれる各画素を所定の順番に従って順次選択することにより、該ラスタ群を構成する各ラスタから並行して前記対象画素を選択する手段であり、
前記対象画素選択手段における画素の選択の順番は、同一ラスタ上で連続して選択される画素が2つまでである
印刷装置。
By determining the presence or absence of dot formation for each of the pixels constituting the color image data for each color component, the color image data is converted into print data in an expression format based on the presence or absence of dot formation, and each color based on the print data A printing apparatus for expressing a color image on a print medium by forming dots of
Raster group generation means for generating a raster group by combining predetermined N (N is an integer of 2 or more) rasters that are adjacent to each other, which are rasters of pixel rows;
For the image data of the first color component selected in advance from the color components, the raster group is configured by comparing the gradation value of each pixel with a predetermined threshold value associated with each pixel. First data conversion means for performing first image conversion processing for converting the N rasters to be converted into dot rows in parallel, thereby converting the N rasters into first print data in an expression format depending on the presence or absence of dot formation; ,
For the image data of the second color component obtained by removing the first color component from each color component, the gradation error caused by the pixel determined by determining the presence / absence of dot formation is diffused to surrounding undetermined pixels. At the same time, the N rasters constituting the raster group are converted into dot rows in parallel while judging the presence / absence of dot formation so as to eliminate the gradation error diffused from the surrounding judged pixels. By doing so, based on the second data conversion means for performing the second image conversion processing for converting into the first print data of the expression format depending on the presence or absence of dot formation, the first print data and the second print data And dot forming means for forming dots of each color on the print medium,
The first and second data conversion means perform the first and second image conversion processing as processing of a computer that implements at least one of cache and pipeline processing ,
The first data conversion means includes
Threshold matrix storage means for storing a threshold matrix in which a plurality of the thresholds are two-dimensionally arranged;
Target pixel selection means for selecting a target pixel for determining whether or not to form a dot;
A dot formation determination unit that reads out a threshold value corresponding to the target pixel from the threshold value matrix and compares the threshold value with the gradation value corresponding to the target pixel, thereby determining whether or not the target pixel is formed. When
With
The target pixel selecting means is means for selecting the target pixel in parallel from each raster constituting the raster group by sequentially selecting each pixel included in the raster group in a predetermined order.
The order of pixel selection in the target pixel selection means is up to two pixels that are continuously selected on the same raster.
Printing device.
カラー画像データを構成する各画素についてのドット形成の有無を各色成分毎に判断することによって、該カラー画像データをドットの形成有無による表現形式の各色のデータに変換する画像処理方法であって、
前記受け取ったカラー画像データを、前記各色成分の中から予め選択された第1の色成分の画像データと、該第1の色成分を除いた第2の色成分の画像データとに分離する工程(A)と、
前記第1の色成分の画像データについては、各画素の前記階調値と各画素に対応付けられた所定の閾値とを比較しながら、画素の列であるラスタのうち隣接するラスタを所定のN本(Nは2以上の整数)ずつ並行してドット列に変換することにより、ドットの形成有無による表現形式のデータに変換する第1の画像変換処理を実施する工程(B)と、
前記第2の色成分の画像データについては、ドット形成の有無を判断したことで判断した画素で生じた階調誤差を周辺の未判断画素に拡散するとともに、周辺の判断済みの画素から拡散されてきた階調誤差を解消するようにドット形成の有無を判断しながら、隣接するラスタを前記N本ずつ並行してドット列に変換することにより、ドットの形成有無による表現形式のデータに変換する第2の画像変換処理を実施する工程(C)と
を備え、
前記工程(B)、(C)は、前記第1,第2の画像変換処理を、キャッシュ、パイプライン処理の少なくとも一方を実装するコンピュータの処理として実施し、
前記工程(B)は、
複数の前記閾値が二次元的に配列された閾値マトリックスを記憶しておく工程(b1)と、
ドットの形成有無の判断を行う対象画素を選択する工程(b2)と、
前記対象画素に対応する閾値を前記閾値マトリックスの中から読み出して、該対象画素に対応付けられた前記階調値と比較することにより、該対象画素についてのドット形成有無を判断する工程(b3)と
を備え、
前記工程(b2)は、前記ラスタ群に含まれる各画素を所定の順番に従って順次選択することにより、該ラスタ群を構成する各ラスタから並行して前記対象画素を選択する工程であり、
前記工程(b2)における画素の選択の順番は、同一ラスタ上で連続して選択される画素が2つまでである
画像処理方法。
An image processing method for converting the color image data into data of each color in an expression format according to the presence or absence of dot formation by determining the presence or absence of dot formation for each pixel constituting each color image data,
Separating the received color image data into image data of a first color component preselected from the color components and image data of a second color component excluding the first color component; (A) and
For the image data of the first color component, an adjacent raster among rasters that are columns of pixels is determined by comparing the gradation value of each pixel with a predetermined threshold value associated with each pixel. A step (B) of performing a first image conversion process for converting the data into an expression format data according to the presence or absence of dot formation by converting N dots (N is an integer of 2 or more) in parallel to each other;
As for the image data of the second color component, the gradation error generated in the pixel determined by determining the presence / absence of dot formation is diffused to the surrounding undetermined pixels and diffused from the surrounding determined pixels. By converting the adjacent rasters into dot rows in parallel while determining the presence / absence of dot formation so as to eliminate the tone error, the data is converted into data in an expression format according to the presence / absence of dot formation. And (C) performing the second image conversion process,
In the steps (B) and (C), the first and second image conversion processes are performed as a process of a computer that implements at least one of a cache process and a pipeline process ,
The step (B)
Storing a threshold matrix in which a plurality of the thresholds are two-dimensionally arranged (b1);
A step (b2) of selecting a target pixel for determining whether or not to form a dot;
A step (b3) of determining whether or not a dot is formed for the target pixel by reading out a threshold corresponding to the target pixel from the threshold matrix and comparing it with the gradation value corresponding to the target pixel. When
With
The step (b2) is a step of selecting the target pixel in parallel from each raster constituting the raster group by sequentially selecting each pixel included in the raster group in a predetermined order.
The order of pixel selection in the step (b2) is up to two pixels that are continuously selected on the same raster.
Image processing method.
JP2008015729A 2008-01-28 2008-01-28 Image processing apparatus for processing a plurality of rasters in parallel Expired - Fee Related JP4577366B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008015729A JP4577366B2 (en) 2008-01-28 2008-01-28 Image processing apparatus for processing a plurality of rasters in parallel

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008015729A JP4577366B2 (en) 2008-01-28 2008-01-28 Image processing apparatus for processing a plurality of rasters in parallel

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2002239102A Division JP2004080480A (en) 2002-08-20 2002-08-20 Image processing device for processing a plurality of rasters in parallel

Related Child Applications (1)

Application Number Title Priority Date Filing Date
JP2009025475A Division JP4453782B2 (en) 2009-02-06 2009-02-06 Image processing apparatus for processing a plurality of rasters in parallel

Publications (2)

Publication Number Publication Date
JP2008167468A JP2008167468A (en) 2008-07-17
JP4577366B2 true JP4577366B2 (en) 2010-11-10

Family

ID=39696194

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008015729A Expired - Fee Related JP4577366B2 (en) 2008-01-28 2008-01-28 Image processing apparatus for processing a plurality of rasters in parallel

Country Status (1)

Country Link
JP (1) JP4577366B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115115643B (en) * 2022-08-30 2022-11-15 一道新能源科技(衢州)有限公司 Method for detecting production defects of photovoltaic cell panel

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08265590A (en) * 1995-02-03 1996-10-11 Eastman Kodak Co Half-tone color image processing method
JPH08307720A (en) * 1995-05-12 1996-11-22 Seiko Epson Corp System and method for gradation number conversion of color image
JPH1093819A (en) * 1996-09-12 1998-04-10 Canon Inc Picture processor
JPH10224627A (en) * 1997-01-28 1998-08-21 Hewlett Packard Co <Hp> Error propagation system
JPH11252370A (en) * 1998-03-05 1999-09-17 Ricoh Co Ltd Screening method
JP2000059625A (en) * 1998-08-07 2000-02-25 Murata Mach Ltd Image processor
JP2000184197A (en) * 1998-12-14 2000-06-30 Ricoh Co Ltd Image processor
JP2001016448A (en) * 1999-06-29 2001-01-19 Nec Ic Microcomput Syst Ltd Picture processor and picture processing method
JP2002199220A (en) * 2000-10-06 2002-07-12 Seiko Epson Corp Image processor, print controller, image processing method, and recording medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08265590A (en) * 1995-02-03 1996-10-11 Eastman Kodak Co Half-tone color image processing method
JPH08307720A (en) * 1995-05-12 1996-11-22 Seiko Epson Corp System and method for gradation number conversion of color image
JPH1093819A (en) * 1996-09-12 1998-04-10 Canon Inc Picture processor
JPH10224627A (en) * 1997-01-28 1998-08-21 Hewlett Packard Co <Hp> Error propagation system
JPH11252370A (en) * 1998-03-05 1999-09-17 Ricoh Co Ltd Screening method
JP2000059625A (en) * 1998-08-07 2000-02-25 Murata Mach Ltd Image processor
JP2000184197A (en) * 1998-12-14 2000-06-30 Ricoh Co Ltd Image processor
JP2001016448A (en) * 1999-06-29 2001-01-19 Nec Ic Microcomput Syst Ltd Picture processor and picture processing method
JP2002199220A (en) * 2000-10-06 2002-07-12 Seiko Epson Corp Image processor, print controller, image processing method, and recording medium

Also Published As

Publication number Publication date
JP2008167468A (en) 2008-07-17

Similar Documents

Publication Publication Date Title
JP4586712B2 (en) Printing device
JP3661624B2 (en) Image processing device
JP2002185789A (en) Image processing unit, print controller, image processing method, and recording medium
JP4363382B2 (en) Image processing apparatus for printing and image processing method
JP2007019652A (en) Image processor and image processing method, program, and test pattern
JP3963598B2 (en) Image processing apparatus, processing method, and recording medium
JP4375050B2 (en) An image output system for outputting an image based on information on the number of dots formed in a predetermined area
JP4577366B2 (en) Image processing apparatus for processing a plurality of rasters in parallel
JP4096949B2 (en) Image processing apparatus, processing method, and recording medium
JP4228814B2 (en) Printing method for printing images while processing multiple rasters in parallel
JP4691880B2 (en) An image output device that outputs an image while converting resolution of data of a plurality of pixel columns in which dots are formed simultaneously
JP4453782B2 (en) Image processing apparatus for processing a plurality of rasters in parallel
JP2005303666A (en) Image output system for outputting image on basis of information of number of dots formed within prescribed area
JP4561049B2 (en) Printing system for printing an image based on information on the number of dots formed in a predetermined area
JP2004080480A (en) Image processing device for processing a plurality of rasters in parallel
JP6259951B2 (en) Image forming method
JP2007118225A (en) Image processor, processing method and program, and storage medium
JP2006231915A (en) Printer, printing program, printing method, image processor, image processing program, image processing method, and recording medium with program recorded
JP3823859B2 (en) Image processing apparatus for converting image data in units of multiple pixels
JP2004255700A (en) Process for creating dot data while saving memory capacity
JP4007179B2 (en) Printing system that prints while performing image processing by sharing between image processing device and printing device
JP4013855B2 (en) Image processing apparatus for converting image data in units of multiple pixels
JP3972875B2 (en) Image processing apparatus for converting image data in units of multiple pixels
JP2005102068A (en) Image display system for displaying image based on information of the number of dots in prescribed region
JP2005081770A (en) Printer for printing image while converting image data in units of a plurality of pixels

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20090929

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20091127

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20100316

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20100616

A911 Transfer to examiner for re-examination before appeal (zenchi)

Free format text: JAPANESE INTERMEDIATE CODE: A911

Effective date: 20100629

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20100727

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20100809

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130903

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

LAPS Cancellation because of no payment of annual fees