JP4696738B2 - Image data compression method and apparatus, and pseudo gradation image restoration method - Google Patents

Image data compression method and apparatus, and pseudo gradation image restoration method Download PDF

Info

Publication number
JP4696738B2
JP4696738B2 JP2005204843A JP2005204843A JP4696738B2 JP 4696738 B2 JP4696738 B2 JP 4696738B2 JP 2005204843 A JP2005204843 A JP 2005204843A JP 2005204843 A JP2005204843 A JP 2005204843A JP 4696738 B2 JP4696738 B2 JP 4696738B2
Authority
JP
Japan
Prior art keywords
representative value
region
image data
value
area
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
JP2005204843A
Other languages
Japanese (ja)
Other versions
JP2007028006A (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.)
Konica Minolta Business Technologies Inc
Original Assignee
Konica Minolta Business Technologies Inc
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 Konica Minolta Business Technologies Inc filed Critical Konica Minolta Business Technologies Inc
Priority to JP2005204843A priority Critical patent/JP4696738B2/en
Publication of JP2007028006A publication Critical patent/JP2007028006A/en
Application granted granted Critical
Publication of JP4696738B2 publication Critical patent/JP4696738B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Description

本発明は、ディザパターンを用いて擬似階調化された画像データを圧縮する方法および装置、並びに擬似階調画像の復元方法に関する。   The present invention relates to a method and apparatus for compressing pseudo gradation image data using a dither pattern, and a pseudo gradation image restoration method.

一般に、コンピュータとプリンタなどから構成されるプリントシステムが用いられている。このようなプリントシステムにおいては、プリントすべき画像データに対して、擬似階調化などの画像処理をコンピュータ側で行い、プリンタ側ではコンピュータから送信される画像データに対して特別な処理を行うことなく、そのまま出力して用紙にプリントするという方式がある。   In general, a printing system including a computer and a printer is used. In such a printing system, image processing such as pseudo gradation processing is performed on the computer side on the image data to be printed, and special processing is performed on the image data transmitted from the computer on the printer side. However, there is a method in which the data is output as it is and printed on paper.

従来より、この方式に使用されるプリンタとしてラスタプリンタが知られている。ラスタプリンタは、プリンタ側で特別な画像処理を行わないため、小規模なハードウェアを用いて安価に実現できる。しかし、その反面、そのまま用紙にプリント可能な画像データをプリンタに送信するため、送信するデータ量が大きくなってしまうという欠点がある。また、近年の高画質化への要請から画像データがますます大きくなり、その結果、プリンタに送信するデータ量がさらに大きくなってしまう。そのため、コンピュータからプリンタへの画像データの送信に多くの時間を要することとなる。   Conventionally, a raster printer is known as a printer used in this method. Since the raster printer does not perform special image processing on the printer side, it can be realized at low cost using small-scale hardware. However, on the other hand, since image data that can be printed on paper as it is is transmitted to the printer, there is a drawback that the amount of data to be transmitted becomes large. In addition, image data has become larger due to the recent demand for higher image quality, and as a result, the amount of data to be transmitted to the printer becomes even larger. Therefore, it takes a lot of time to transmit image data from the computer to the printer.

この問題を解消するために、コンピュータ側において画像データを圧縮する必要がある。しかし、圧縮のための処理が複雑であった場合には、圧縮処理自体に時間を要してしまい、プリンタ側においても展開処理に時間を要したりそのためのハードウェアの規模が大きくなって高価となる。   In order to solve this problem, it is necessary to compress the image data on the computer side. However, if the processing for compression is complicated, it takes time for the compression processing itself, and it takes time for the expansion processing on the printer side as well, and the scale of hardware for that becomes large and expensive. It becomes.

したがって、安価なプリンタの使用を可能とし、全体として処理を高速に行えるプリントシステムを実現するために、圧縮時の処理が軽く、小規模なハードウェアで展開でき、かつ高い圧縮率を実現できる圧縮技術が望まれる。   Therefore, in order to realize a printing system that enables the use of inexpensive printers and performs high-speed processing as a whole, the compression processing is light, the processing at the time of compression is light, can be developed with small hardware, and a high compression rate can be realized. Technology is desired.

ところで、多階調の画像データをプリンタでプリントするには、多くの場合、その画像データを擬似階調化しなければならない。擬似階調化の方法として、ディザ法が従来からよく知られている。ディザ法では、ディザパターンを用い、ディザパターンの各しきい値と画像データの各画素の値とを比較して2値化または多値化する。   By the way, in order to print multi-gradation image data with a printer, in many cases, the image data must be converted into pseudo gradations. A dither method has been well known as a pseudo gradation method. In the dither method, a dither pattern is used, and each threshold value of the dither pattern is compared with the value of each pixel of the image data to be binarized or multi-valued.

ディザパターンに着目した圧縮技術として、特許文献1に開示された方法がある。特許文献1に示された方法によると、2値化された画像データを所定の大きさのブロックに分割する。任意の画像ブロックに含まれるドットの個数に対応する基準パターンと当該画像ブロックとの比較を行い、画像ブロックと基準パターンとが一致した場合は基準パターンを示す符号を割当て、そうでない場合は比較結果を符号化する。   As a compression technique focusing on the dither pattern, there is a method disclosed in Patent Document 1. According to the method disclosed in Patent Document 1, the binarized image data is divided into blocks of a predetermined size. The reference pattern corresponding to the number of dots included in an arbitrary image block is compared with the image block, and if the image block and the reference pattern match, a code indicating the reference pattern is assigned. Otherwise, the comparison result Is encoded.

また、2値化された画像データのための圧縮技術として、ITU(国際電気通信連合)−T勧告により採用が認められたJBIG方式が知られている。   Further, as a compression technique for binarized image data, the JBIG system, which has been approved for adoption by ITU (International Telecommunication Union) -T recommendation, is known.

また、ディザパターンにより擬似階調化された画像データを圧縮する方法が特許文献2に開示されている。特許文献2に記載の方法によると、各画素についての画素値がしきい値と比較され、これによって各画素ごとにレンジが求められる。
特開平6−152986 USP6201614
Further, Patent Document 2 discloses a method of compressing image data that has been pseudo-gradated with a dither pattern. According to the method described in Patent Document 2, the pixel value for each pixel is compared with a threshold value, thereby obtaining a range for each pixel.
JP-A-6-152986 USP 6201614

しかし、上に述べた特許文献1の方法では、指定した画像ブロックと基準パターンが一致した場合に、基準パターンを符号化するため、基準パターンの符号の分だけ送信するデータ量が増大してしまう。さらに、画像データは、変化するのでブロック内で全ての画素が一致することは少なく、その場合は差分データを送信するのでデータ量がますます増大してしまう。   However, in the method of Patent Document 1 described above, when the designated image block matches the reference pattern, the reference pattern is encoded, so the amount of data to be transmitted increases by the amount of the reference pattern code. . Furthermore, since the image data changes, it is unlikely that all the pixels match in the block. In this case, the difference data is transmitted, so that the amount of data further increases.

これに対して、JBIG方式では、圧縮処理が比較的軽く、コンピュータ上でも高速に圧縮処理を行うことができる。しかし、JBIG方式によると、LZS方式またはLZW方式などの他の方式に比べて圧縮率があまり高くなく、特に中間調のデータが増えた場合に圧縮率が低下する。   On the other hand, in the JBIG method, the compression process is relatively light, and the compression process can be performed at high speed even on a computer. However, according to the JBIG method, the compression rate is not so high as compared with other methods such as the LZS method or the LZW method, and the compression rate decreases particularly when halftone data increases.

また、特許文献2の方法では、各画素ごとに値を決定するので、それだけでは情報量が減らない。したがって、情報量を減らすためには別途圧縮する手段が必要である。   Further, in the method of Patent Document 2, since the value is determined for each pixel, the amount of information is not reduced by itself. Therefore, in order to reduce the amount of information, a means for separately compressing is necessary.

本発明は、上述の問題に鑑みてなされたもので、ディザパターンを用いて擬似階調化された画像データを高速でかつ高い圧縮率で圧縮することができ、しかも小規模なハードウェアで高速で復元することができる、画像データの圧縮方法および装置並びに擬似階調画像の復元方法を提供することを目的とする。   The present invention has been made in view of the above-described problems, and can compress image data that has been pseudo-graded using a dither pattern at a high speed and with a high compression rate, and can be performed at high speed with a small amount of hardware. It is an object of the present invention to provide a method and apparatus for compressing image data and a method for restoring a pseudo gradation image that can be restored by the above method.

本発明に係る圧縮方法は、ディザパターンを用いて擬似階調化された画像である擬似階調画像のデータを圧縮する方法であって、前記擬似階調画像を所定の領域ごとに区画する第1のステップと、前記各領域の代表値を決定する第2のステップと、決定した代表値を用いて圧縮データを作成する第3のステップとを有してなり、前記第2のステップにおいて、前記領域のうちの1つの領域である注目領域について、当該注目領域の代表値および当該注目領域に隣接する1つまたは複数の領域の代表値を用い予め定められた補間ルールにしたがって当該注目領域における各画素の濃度を補間して求めさらに前記ディザパターンを用いて擬似階調化を行った場合に当該注目領域における前記擬似階調画像が再現されるような、そのような代表値を求めて当該注目領域の代表値として決定する。   A compression method according to the present invention is a method for compressing pseudo gradation image data that is a pseudo gradation image using a dither pattern, wherein the pseudo gradation image is partitioned into predetermined regions. 1 step, a second step of determining a representative value of each region, and a third step of creating compressed data using the determined representative value. In the second step, For a region of interest that is one of the regions, a representative value of the region of interest and a representative value of one or a plurality of regions adjacent to the region of interest are used according to a predetermined interpolation rule. Such a representative value is obtained such that the pseudo gradation image in the region of interest is reproduced when the density of each pixel is interpolated and pseudo gradation is performed using the dither pattern. Umate determined as the representative value of the region of interest.

または、前記第2のステップにおいて、前記領域のうちの1つの領域である注目領域について、当該注目領域の代表値および当該注目領域に隣接する1つまたは複数の領域の代表値を用い予め定められた補間ルールにしたがって当該注目領域における各画素の濃度を補間して求めさらに前記ディザパターンを用いて擬似階調化を行って得られる画像データのドットの配列パターンと当該注目領域内の画像データのドットの配列パターンとが所定の誤差範囲内で一致するような、そのような代表値を求めて当該注目領域の代表値として決定する。   Alternatively, in the second step, the attention area that is one of the areas is determined in advance using a representative value of the attention area and a representative value of one or more areas adjacent to the attention area. In accordance with the interpolation rule, the density of each pixel in the region of interest is interpolated, and the dot arrangement pattern of the image data obtained by performing pseudo gradation using the dither pattern and the image data in the region of interest Such a representative value that matches the dot arrangement pattern within a predetermined error range is obtained and determined as the representative value of the region of interest.

好ましくは、前記第2のステップにおいて、前記代表値を、前記各領域の端部に位置する画素の濃度値に対応する値とする。   Preferably, in the second step, the representative value is a value corresponding to a density value of a pixel located at an end of each region.

また、前記第2のステップにおいて、前記代表値として選択することの可能な値が所定の範囲を持っている場合に、その範囲における中央値を前記代表値として決定する。   In the second step, when a value that can be selected as the representative value has a predetermined range, a median value in the range is determined as the representative value.

また、前記補間ルールは、当該注目領域の代表値および当該注目領域に隣接する2つの領域のそれぞれの代表値の合計3つの代表値で定義される平面によって各画素の濃度を補間するものである。   Further, the interpolation rule interpolates the density of each pixel by a plane defined by a total of three representative values of the representative value of the region of interest and the representative values of two regions adjacent to the region of interest. .

また、前記第2のステップにおいて、前記注目領域内において代表値が決定できない場合に、当該注目領域における画像データを、当該注目領域の代替の代表値として決定する。   In the second step, when a representative value cannot be determined in the attention area, the image data in the attention area is determined as an alternative representative value of the attention area.

また、前記第2のステップにおいて、前記注目領域内において代表値が決定できない場合に、当該注目領域をさらに複数の小領域に区画し、各小領域内において代表値を決定する。   In the second step, when the representative value cannot be determined in the attention area, the attention area is further divided into a plurality of small areas, and the representative value is determined in each small area.

また、前記第2のステップにおいて、前記小領域内において代表値が決定できない場合に、当該小領域における画像データを、当該小領域の代替の代表値として決定する。   In the second step, when the representative value cannot be determined in the small area, the image data in the small area is determined as an alternative representative value of the small area.

本発明に係る復元方法は、圧縮されたデータから各領域の代表値を取得し、前記領域のうちの1つの領域である注目領域について、当該注目領域の代表値および当該注目領域に隣接する1つまたは複数の領域の代表値を用い予め定められた前記補間ルールにしたがって当該注目領域における各画素の濃度を補間して求めさらに前記ディザパターンを用いて擬似階調化を行って擬似階調画像を復元する。   The restoration method according to the present invention obtains a representative value of each region from the compressed data, and for a region of interest that is one of the regions, the representative value of the region of interest and 1 adjacent to the region of interest. A pseudo gradation image obtained by interpolating the density of each pixel in the region of interest according to a predetermined interpolation rule using a representative value of one or a plurality of areas and further performing pseudo gradation using the dither pattern To restore.

本発明に係る圧縮装置は、ディザパターンを用いて擬似階調化された画像である擬似階調画像のデータを圧縮する装置であって、前記擬似階調画像を所定の領域ごとに区画する第1の手段と、前記各領域の代表値を決定する第2の手段と、決定した前記代表値を用いて圧縮データを作成する第3の手段とを有してなり、前記第2の手段は、前記領域のうちの1つの領域である注目領域について、当該注目領域の代表値および当該注目領域に隣接する1つまたは複数の領域の代表値を用い予め定められた補間ルールにしたがって当該注目領域における各画素の濃度を補間して求めさらに前記ディザパターンを用いて擬似階調化を行った場合に当該注目領域における前記擬似階調画像が再現されるような、そのような代表値を求めて当該注目領域の代表値として決定する。   A compression apparatus according to the present invention is an apparatus that compresses pseudo gradation image data that is a pseudo gradation image using a dither pattern, and divides the pseudo gradation image into predetermined areas. 1 means, second means for determining the representative value of each area, and third means for creating compressed data using the determined representative value, wherein the second means For the attention area that is one of the areas, the attention area according to a predetermined interpolation rule using the representative value of the attention area and the representative value of one or more areas adjacent to the attention area Obtaining such representative values so that the pseudo gradation image in the region of interest can be reproduced when pseudo gradation is performed using the dither pattern. The area of interest It is determined as the representative value.

本発明によると、ディザパターンを用いて擬似階調化された画像データを高速でかつ高い圧縮率で圧縮することができ、しかも小規模なハードウェアで高速に復元することができる。これにより、安価なプリンタを使用しつつ、全体の処理を短時間で行うことが可能となる。   According to the present invention, image data that has been pseudo-gradated using a dither pattern can be compressed at a high speed and with a high compression rate, and can be restored at high speed with a small amount of hardware. As a result, the entire process can be performed in a short time while using an inexpensive printer.

本実施形態の説明においては、第1で、擬似階調化された2値の画像データを圧縮する場合について説明し、第2で、擬似階調化された4値の画像データを圧縮する場合について説明する。第2での説明は、第1との相違点について、その要点のみを説明する。
〔第1〕
2値の画像データを圧縮する場合についての実施形態
〔システム全体の構成〕
図1は本発明に係る画像データの圧縮方法を適用したプリントシステム1の全体構成を示す図である。
In the description of the present embodiment, first, the case of compressing pseudo-graded binary image data will be described, and second, the case of compressing pseudo-gradated 4-level image data. Will be described. In the second description, only the main points of the differences from the first will be described.
[First]
Embodiment for compressing binary image data [Configuration of entire system]
FIG. 1 is a diagram showing an overall configuration of a print system 1 to which an image data compression method according to the present invention is applied.

図1において、プリントシステム1は、コンピュータ本体11、ディスプレイ12、プリンタ13、キーボード14、およびマウス15などから構成される。   In FIG. 1, the print system 1 includes a computer main body 11, a display 12, a printer 13, a keyboard 14, a mouse 15, and the like.

コンピュータ本体11は、外部から入力された画像データまたは内部で生成した画像データなど(原画像データ)を、ディザ法によりディザパターンを用いて擬似階調化する。原画像データは、例えばRGBまたはCMY各色256階調の階調画像データである。擬似階調化は、ハーフトーン化と呼称されることもある。擬似階調化された画像は、擬似階調画像、ハーフトーン画像などという。本実施形態においては、擬似階調化として2値化を行い、2値画像データD1を生成する。そして、生成した2値画像データD1を圧縮して圧縮データD2を生成し、生成した圧縮データD2をプリンタ13に送信する。プリンタ13は、受信した圧縮データD2について、2値化に用いたディザパターンなどを参照して2値画像データ(ハーフトーン画像)を復元し、用紙などにプリントアウトする。なお、2値画像データD1とディザパターンとの関係については、図29を参照することができる。   The computer main body 11 pseudo-gradates image data input from the outside or image data generated inside (original image data) using a dither pattern by a dither method. The original image data is, for example, gradation image data of 256 gradations for each color of RGB or CMY. Pseudo gradation is sometimes called halftoning. The pseudo gradation image is referred to as a pseudo gradation image, a halftone image, or the like. In the present embodiment, binarization is performed as pseudo gradation processing, and binary image data D1 is generated. Then, the generated binary image data D1 is compressed to generate compressed data D2, and the generated compressed data D2 is transmitted to the printer 13. The printer 13 restores binary image data (halftone image) with respect to the received compressed data D2 by referring to the dither pattern used for binarization and prints it out on paper or the like. Note that FIG. 29 can be referred to for the relationship between the binary image data D1 and the dither pattern.

本実施形態において、圧縮処理に際しては、2値画像データD1をディザパターン情報成分と画像情報成分とに分離する。そして、画像情報成分のみを取り出し、ハフマン法による符号化処理を行って圧縮データD2とする。ディザパターン情報成分は圧縮データD2に含めない。因みに、従来においては、ディザパターン情報成分と画像情報成分の両方をまとめて圧縮処理を行っていた。   In the present embodiment, during the compression process, the binary image data D1 is separated into a dither pattern information component and an image information component. Then, only the image information component is extracted and encoded by the Huffman method to obtain compressed data D2. The dither pattern information component is not included in the compressed data D2. Incidentally, conventionally, both the dither pattern information component and the image information component have been compressed together.

より詳しくは、本実施形態の圧縮処理の過程において、2値画像データD1を所定の領域(後述する低解像度領域TL)ごとに区画する(第1のステップ)。次に、各領域の代表値を決定する(第2のステップ)。そして、決定した代表値を用いて圧縮データを作成する(第3のステップ)。なお、代表値を「a」または「AP」で表すことがある。   More specifically, in the course of the compression processing of the present embodiment, the binary image data D1 is partitioned for each predetermined area (a low-resolution area TL described later) (first step). Next, the representative value of each area is determined (second step). Then, compressed data is created using the determined representative value (third step). The representative value may be represented by “a” or “AP”.

この第2のステップにおいて、領域のうちの1つの領域である注目領域について、当該注目領域の代表値および当該注目領域に隣接する1つまたは複数の領域の代表値を用い予め定められた補間ルールにしたがって当該注目領域における各画素の濃度を補間して求めさらにディザパターンを用いて擬似階調化を行った場合に当該注目領域における擬似階調画像が再現されるような、そのような代表値を求めて当該注目領域の代表値aとして決定する。   In this second step, for an attention area that is one of the areas, a predetermined interpolation rule using a representative value of the attention area and a representative value of one or more areas adjacent to the attention area Such that the pseudo gradation image in the region of interest is reproduced when pseudo-gradation is performed using the dither pattern obtained by interpolating the density of each pixel in the region of interest Is determined as a representative value a of the region of interest.

代表値aが決定された領域に隣接する領域を次の注目領域とし、注目領域を順次移動させて全ての領域について代表値aを決定する。最初に注目領域とした領域については、既に代表値aの決定された領域が存在しないので、その注目領域における周辺部または端部、特に頂点部に位置する画素の濃度値などを考慮して代表値aを決定すればよい。   The region adjacent to the region for which the representative value a is determined is set as the next region of interest, and the region of interest is sequentially moved to determine the representative value a for all regions. Since there is no area for which the representative value “a” has already been determined, the area that has been initially set as the attention area is representative in consideration of the density value of the pixel located at the periphery or end of the attention area, particularly at the apex. The value a may be determined.

また、第2のステップにおいて、代表値を求める方法を次のように言うこともできる。つまり、領域のうちの1つの領域である注目領域について、当該注目領域の代表値および当該注目領域に隣接する1つまたは複数の領域の代表値を用い予め定められた補間ルールにしたがって当該注目領域における各画素の濃度を補間して求めさらにディザパターンを用いて擬似階調化を行って得られる画像データのドットの配列パターンと当該注目領域内の画像データのドットの配列パターンとが所定の誤差範囲内で一致するような、そのような代表値を求めて当該注目領域の代表値aとして決定する。   In the second step, the method for obtaining the representative value can also be said as follows. That is, for a region of interest that is one of the regions, the region of interest according to a predetermined interpolation rule using a representative value of the region of interest and a representative value of one or more regions adjacent to the region of interest. Is obtained by interpolating the density of each pixel in the image, and the dot arrangement pattern of the image data obtained by performing pseudo gradation using the dither pattern and the dot arrangement pattern of the image data in the region of interest have a predetermined error. Such a representative value that matches within the range is obtained and determined as the representative value a of the region of interest.

また、第2のステップにおいて、代表値aを、各領域の端部に位置する画素の濃度値に対応する値とする。また、代表値として選択することの可能な値が所定の範囲を持っている場合に、その範囲において例えば中央値を代表値aとして決定する。なお、代表値として選択可能な所定の範囲のことを「代表値範囲」ということがある。   In the second step, the representative value a is set to a value corresponding to the density value of the pixel located at the end of each region. Further, when a value that can be selected as the representative value has a predetermined range, for example, the median value is determined as the representative value a in the range. The predetermined range that can be selected as the representative value may be referred to as a “representative value range”.

第2のステップにおいて、代表値aを求める際に補間ルールを用いるが、次は補間ルールの例である。
(1) 当該注目領域の代表値および当該注目領域に隣接する2つの領域のそれぞれの代表値の合計3つの代表値で定義される平面によって各画素の濃度を補間する。また、平面以外を用いた直線補間とする。
(2) 当該注目領域の代表値および当該注目領域に隣接する3つの領域のそれぞれの代表値の合計4つの代表値で定義される曲面(ねじれ面)によって各画素の濃度を補間する。
(3) 当該注目領域の代表値および当該注目領域に隣接する複数の領域のそれぞれの代表値で定義されるスプライン曲面によって各画素の濃度を補間する。また、スプライン補間に代えて多項式補間とする。
In the second step, an interpolation rule is used when obtaining the representative value a. The following is an example of the interpolation rule.
(1) The density of each pixel is interpolated by a plane defined by a total of three representative values of the representative value of the attention area and the representative values of two areas adjacent to the attention area. In addition, linear interpolation using a plane other than a plane is used.
(2) The density of each pixel is interpolated by a curved surface (twisted surface) defined by a total of four representative values of the representative value of the attention area and the representative values of three areas adjacent to the attention area.
(3) The density of each pixel is interpolated by the spline curved surface defined by the representative value of the attention area and the representative values of a plurality of areas adjacent to the attention area. Also, polynomial interpolation is used instead of spline interpolation.

このように、補間ルールは、記述したものの他、補間式、補間テーブルなどで表現することも可能である。なお、補間ルールは、圧縮処理や復元処理の前提として予め共通に定めておいてもよく、また、原画像データの種類などに応じて異なる補間ルールを適用して圧縮処理を行い、圧縮処理に用いた補間ルールを復元処理を行う側に通知するようにしてもよい。補間ルールは、具体的には、例えば補間ルールを実行する処理回路やプログラムまたは変換テーブルなどによって実現可能である。   In this way, the interpolation rule can be expressed by an interpolation formula, an interpolation table, or the like in addition to what has been described. The interpolation rule may be determined in advance as a precondition for the compression process and the decompression process, and the compression process is performed by applying a different interpolation rule depending on the type of the original image data. The used interpolation rule may be notified to the restoration processing side. Specifically, the interpolation rule can be realized, for example, by a processing circuit, a program, a conversion table, or the like that executes the interpolation rule.

ところで、代表値aを求める別の方法として、各領域内における画像データのドットの配列パターンが2値化に用いられたディザパターンと一致するか否かを判別し、一致する場合にその領域における画像データの濃度に関する代表値を求めるという方法がある。この方法は、先に特願平2004−377575として提案した。したがって、この方法を「先願方法」ということがある。先願方法は、本実施形態の方法とは異なるが、圧縮における「代表値」の基本的な概念は本実施形態と同じであり、「代表値」の意義を理解する上で大変参考となるので、本明細書においても必要に応じてなお書きなどによって言及する。   By the way, as another method for obtaining the representative value a, it is determined whether the dot arrangement pattern of the image data in each area matches the dither pattern used for binarization. There is a method of obtaining a representative value related to the density of image data. This method was previously proposed as Japanese Patent Application No. 2004-377575. Therefore, this method is sometimes referred to as “prior application method”. Although the prior application method is different from the method of the present embodiment, the basic concept of “representative value” in compression is the same as that of the present embodiment, and is very helpful in understanding the significance of “representative value”. Therefore, in this specification, reference is made by writing or the like as necessary.

説明を元に戻して、各領域の代表値aがそれぞれ決定すると、第3のステップでは、隣り合う領域間の代表値aの差分情報を求め、求めた差分情報をハフマン法で符号化することによって圧縮データD2を得る。2値化に用いられたディザパターンがディザパターン情報成分であり、代表値aが画像情報成分である。   Returning to the description, when the representative value a of each region is determined, in the third step, difference information of the representative value a between adjacent regions is obtained, and the obtained difference information is encoded by the Huffman method. To obtain compressed data D2. The dither pattern used for binarization is a dither pattern information component, and the representative value a is an image information component.

2値化処理に際して、文字領域または画像領域など、領域の種類に応じて複数のディザパターンが切り換えられて用いられるので、圧縮処理の際にも、それら複数のディザパターンを切り換えて処理を行う。なお、先願方法では、複数のディザパターンを切り換えて各領域内における画像データのドットの配列パターンと一致するか否かを判別する。   In the binarization process, a plurality of dither patterns are switched and used in accordance with the type of area such as a character area or an image area. Therefore, in the compression process, the plurality of dither patterns are switched. In the prior application method, a plurality of dither patterns are switched to determine whether or not the pattern matches the dot arrangement pattern of the image data in each region.

第2のステップにおいて、注目領域内において代表値aが決定できない場合には、当該注目領域をさらに複数の小領域(後述する中解像度領域TM)に区画し、各小領域において代表値aを決定する。   In the second step, when the representative value a cannot be determined in the attention area, the attention area is further divided into a plurality of small areas (a medium resolution area TM described later), and the representative value a is determined in each small area. To do.

なお、先願方法においては、いずれのディザパターンにも一致しない場合に、その領域をさらに複数の小領域に区画し、各小領域内における画像データのドットの配列パターンがディザパターンと一致するか否かを判別する。ここで一致した場合は、小領域に打たれたドット数を代表値とする。ここでも一致しなかった場合には、それら領域または小領域のドットの配列を符号化して圧縮データD2を得る。   In the prior application method, if the pattern does not match any dither pattern, the area is further divided into a plurality of small areas, and the dot pattern of the image data in each small area matches the dither pattern. Determine whether or not. If they match, the representative value is the number of dots hit in the small area. If they do not match again, the compressed data D2 is obtained by encoding the dot arrangement of these areas or small areas.

コンピュータ本体11は、得られた圧縮データD2をプリンタ13に送信する。コンピュータ本体11は、また、ディザパターンに関する情報、およびハフマン法による復元(復号)のためのテーブルであるデコード表DCを、プリンタ13に予め送信する。各領域における各画素の濃度を補間して求めるための上に述べた補間ルールについても、必要に応じてプリンタ13に予め送信する。なお、デコード表DCとして、低解像度領域、中解像度領域、および高解像度領域のそれぞれに対するデコード表DC1〜3が存在する。詳しくは後述する。   The computer main body 11 transmits the obtained compressed data D2 to the printer 13. The computer main body 11 also transmits in advance to the printer 13 information related to the dither pattern and a decoding table DC that is a table for restoration (decoding) by the Huffman method. The interpolation rule described above for interpolating the density of each pixel in each region is also transmitted in advance to the printer 13 as necessary. As the decoding table DC, there are decoding tables DC1 to DC3 for the low resolution area, the medium resolution area, and the high resolution area, respectively. Details will be described later.

プリンタ13では、コンピュータ本体11から送信された圧縮データD2から、各領域の代表値aを取得し、領域のうちの1つの領域である注目領域について、当該注目領域の代表値aおよび当該注目領域に隣接する1つまたは複数の領域の代表値aを用い、予め定められた補間ルールにしたがって、当該注目領域における各画素の濃度を補間して求め、これによって仮想階調画像を得て、さらに仮想階調画像に対して、ディザパターンを用いて擬似階調化を行って擬似階調画像を復元する。   In the printer 13, the representative value a of each area is acquired from the compressed data D2 transmitted from the computer main body 11, and for the attention area that is one of the areas, the representative value a of the attention area and the attention area. Is obtained by interpolating the density of each pixel in the region of interest according to a predetermined interpolation rule using a representative value a of one or a plurality of regions adjacent to, thereby obtaining a virtual gradation image, The pseudo gradation image is restored by performing pseudo gradation using the dither pattern for the virtual gradation image.

なお、先願方法においては、プリンタ13では、コンピュータ本体11から送信された圧縮データD2から、各領域の代表値aを取得し、取得した代表値aと該当するディザパターンとを比較し、元の2値画像データD1と同じドットパターン(ドットの配列パターン)を再現する。   In the prior application method, the printer 13 acquires the representative value a of each area from the compressed data D2 transmitted from the computer main body 11, compares the acquired representative value a with the corresponding dither pattern, The same dot pattern (dot arrangement pattern) as the binary image data D1 is reproduced.

そのような復元処理(復号処理)において、ハフマン法による復元のためにデコード表DCが用いられる。   In such restoration processing (decoding processing), the decoding table DC is used for restoration by the Huffman method.

コンピュータ本体11として、パーソナルコンピュータ、ワークステーション、その他の種々のコンピュータが用いられ、プリンタ13として、ラスタプリンタ、GDIプリンタ、その他の種々のプリンタが用いられる。
〔圧縮処理〕
次に、コンピュータ本体11における圧縮処理についてさらに詳しく説明する。
As the computer main body 11, a personal computer, a workstation, and other various computers are used. As the printer 13, a raster printer, a GDI printer, and other various printers are used.
[Compression processing]
Next, the compression process in the computer main body 11 will be described in more detail.

図2はコンピュータ本体11の機能的な構成を示すブロック図、図3はコンピュータ本体11の圧縮データ作成部100を機能的に示すブロック図、図4はプリンタ13の機能的な構成を示すブロック図、図5は区画された低解像度領域TLを説明するための図、図6は低解像度領域TLとディザパターンDPの例を示す図、図7は互いにサイズの異なる低解像度領域TLとディザパターンDPの例を示す図、図8は各低解像度領域TLにおける代表値aの位置を示す図、図9は低解像度領域TLにおける各画素の濃度を補間で求める際の補間ルールHRの例を説明するための図、図10は代表値aの求め方を説明するための図である。なお、画像データは2次元であり、各低解像度領域TLも2次元としているが、図10においては説明の簡便化のために1次元の領域を模式的に示した。   2 is a block diagram showing a functional configuration of the computer main body 11, FIG. 3 is a block diagram functionally showing the compressed data creating unit 100 of the computer main body 11, and FIG. 4 is a block diagram showing a functional configuration of the printer 13. 5 is a diagram for explaining the partitioned low resolution region TL, FIG. 6 is a diagram illustrating an example of the low resolution region TL and the dither pattern DP, and FIG. 7 is a diagram illustrating the low resolution region TL and the dither pattern DP having different sizes. FIG. 8 is a diagram showing the position of the representative value a in each low resolution region TL, and FIG. 9 is a diagram for explaining an example of the interpolation rule HR when the density of each pixel in the low resolution region TL is obtained by interpolation. FIG. 10 is a diagram for explaining how to obtain the representative value a. The image data is two-dimensional, and each low-resolution region TL is also two-dimensional. In FIG. 10, a one-dimensional region is schematically shown for the sake of simplicity of explanation.

図2に示すように、コンピュータ本体11は、画像データベース150、ディザパターン記憶部160、擬似階調化部170、および圧縮データ作成部100などから構成される。   As shown in FIG. 2, the computer main body 11 includes an image database 150, a dither pattern storage unit 160, a pseudo gradation unit 170, a compressed data creation unit 100, and the like.

画像データベース150は、階調性を有した多数の画像データ(原画像データ)FD1、FD2、…FDnを保持する。画像データFD1〜nの全部または一部を「画像データFD」と記載することがある。なお、画像データFDの多くはカラー画像であり、その場合に、1つの画像データFDが、C(シアン)、M(マジェンタ)、Y(イエロー)、K(ブラック)の各色の画像データによって構成される。画像データFDは、例えば、スキャナ、デジタルカメラ、その他外部から入力し、または内部で編集したり生成することによって得られる。   The image database 150 holds a large number of image data (original image data) FD1, FD2,. All or part of the image data FD1 to FD may be described as “image data FD”. Note that most of the image data FD is a color image. In this case, one image data FD is composed of image data of each color of C (cyan), M (magenta), Y (yellow), and K (black). Is done. The image data FD is obtained, for example, by inputting from a scanner, a digital camera, or other external source, or by editing or generating inside.

ディザパターン記憶部160は、複数種類のディザパターンDP11〜13、DP21〜23、DP31〜33、DP41〜43を保持する。これらの全部または一部を「ディザパターンDP」と記載することがある。   The dither pattern storage unit 160 holds a plurality of types of dither patterns DP11 to DP13, DP21 to 23, DP31 to 33, and DP41 to 43. All or part of these may be described as “dither pattern DP”.

ディザパターンDPは、C、M、Y、Kの各色について、文字領域用ディザパターンDP11、21、31、41、画像領域用ディザパターンDP12、22、32、42、およびチャート領域用ディザパターンDP13、23、33、43などがそれぞれ設けられている。   The dither pattern DP is a character area dither pattern DP11, 21, 31, 41, an image area dither pattern DP12, 22, 32, 42, and a chart area dither pattern DP13 for each color of C, M, Y, and K. 23, 33, 43, etc. are provided.

擬似階調化部170は、画像データベース150に格納された画像データFDに対し、ディザパターン記憶部160から選択したディザパターンDPを用いて2値化処理を行い、得られた2値画像データD1を圧縮データ作成部100に送る。2値画像データD1についても、C、M、Y、Kの各色の2値画像データによって構成される。   The pseudo gradation unit 170 performs binarization processing on the image data FD stored in the image database 150 using the dither pattern DP selected from the dither pattern storage unit 160, and the obtained binary image data D1. Is sent to the compressed data creation unit 100. The binary image data D1 is also composed of binary image data of C, M, Y, and K colors.

圧縮データ作成部100は、2値画像データD1を圧縮して圧縮データD2を生成するとともに、生成した圧縮データD2、ディザパターンDP、補間ルールHR、およびデコード表DCを出力してプリンタ13に送信する。但し、コンピュータ本体11とプリンタ13との間で補間ルールが予め決められている場合には、補間ルールHRを送信する必要はない。   The compressed data creation unit 100 compresses the binary image data D1 to generate compressed data D2, and outputs the generated compressed data D2, the dither pattern DP, the interpolation rule HR, and the decode table DC to be transmitted to the printer 13. To do. However, when an interpolation rule is predetermined between the computer main body 11 and the printer 13, it is not necessary to transmit the interpolation rule HR.

図3において、圧縮データ作成部100は、低解像度領域区画部101、低解像度代表値算出部103、中解像度領域区画部104、中解像度代表値算出部106、ドットパターン抽出部107、符号化部108、データ送信部109、および補間ルール保持部110などから構成される。
〔低解像度領域の処理〕
低解像度領域区画部101は、擬似階調化部170から送られてきた2値画像データD1を、多数の小さな領域である低解像度領域TLに区画する。低解像度領域TLは、例えば図5に示すように、96個(6×16個)の画素TPからなる矩形の領域である。図5の例では、2値画像データD1の全体の領域が、左上から右方へ順に、低解像度領域TL11、TL12、TL13、…というように、次の行についてTL21、TL22、TL23、…というように、TLmnまで、それぞれブロックに区画されている。
In FIG. 3, the compressed data creation unit 100 includes a low resolution region partition unit 101, a low resolution representative value calculation unit 103, a medium resolution region partition unit 104, a medium resolution representative value calculation unit 106, a dot pattern extraction unit 107, and an encoding unit. 108, a data transmission unit 109, an interpolation rule holding unit 110, and the like.
[Low-resolution area processing]
The low resolution area dividing unit 101 divides the binary image data D1 sent from the pseudo gradation unit 170 into a low resolution area TL, which is a large number of small areas. The low resolution region TL is a rectangular region including 96 (6 × 16) pixels TP as shown in FIG. 5, for example. In the example of FIG. 5, the entire area of the binary image data D1 is TL21, TL22, TL23,... For the next row, such as the low resolution areas TL11, TL12, TL13,. Thus, each block is divided up to TLmn.

図6(a)に示す低解像度領域TLにおいて、黒の画素が、ドットが打たれた画素である。画像データFDの各画素の濃度値が、図6(b)に示すディザパターンDPの対応する画素のしきい値以上であったときに、その画素にドットが打たれる。つまり、濃度値が大きいほど濃度が高いものとして扱う。   In the low resolution region TL shown in FIG. 6A, the black pixels are pixels on which dots are formed. When the density value of each pixel of the image data FD is equal to or greater than the threshold value of the corresponding pixel of the dither pattern DP shown in FIG. 6B, a dot is formed on that pixel. That is, the larger the density value, the higher the density.

なお、図6の例では、低解像度領域TLのサイズがディザパターンDPのサイズと同じとなるように区画した例を示したが、これらのサイズが互いに異なってもよい。   In the example of FIG. 6, an example in which the size of the low resolution region TL is divided so as to be the same as the size of the dither pattern DP is shown, but these sizes may be different from each other.

例えば、図7に示すように、低解像度領域TLbのサイズがディザパターンDPbのサイズよりも小さい場合でもよい。図7の例とは逆に、低解像度領域TLのサイズがディザパターンDPのサイズよりも大きい場合でもよい。   For example, as shown in FIG. 7, the size of the low resolution region TLb may be smaller than the size of the dither pattern DPb. Contrary to the example of FIG. 7, the size of the low resolution area TL may be larger than the size of the dither pattern DP.

低解像度代表値算出部103は、低解像度領域区画部101で区画された各低解像度領域TLについて、補間ルール保持部110に記憶された補間ルールHRを参照して代表値aを求める。代表値aの求め方は次のとおりである。
〔代表値の求め方〕
代表値aの求め方を説明するに際して、最初に代表値aの位置である代表値位置APについて説明する。
The low resolution representative value calculation unit 103 obtains a representative value a for each low resolution region TL partitioned by the low resolution region partition unit 101 with reference to the interpolation rule HR stored in the interpolation rule holding unit 110. The method for obtaining the representative value a is as follows.
[How to find representative values]
In describing how to obtain the representative value a, first, the representative value position AP, which is the position of the representative value a, will be described.

図8において、2値画像データD1の一部について、各低解像度領域TLにおける代表値aの位置である代表値位置APが示されている。図8に示すように、各低解像度領域TLmnの代表値位置APmnは、それぞれの低解像度領域TLmnにおける右下端に位置する。2値画像データD1の領域外においても、低解像度領域TLと同様な区画を行ったと仮定した場合のそれぞれの右下端に代表値位置APがある。なお、代表値aの値を代表値位置を示す符号である「APmn」で代用して示すことがある。   In FIG. 8, a representative value position AP, which is the position of the representative value a in each low resolution region TL, is shown for a part of the binary image data D1. As shown in FIG. 8, the representative value position APmn of each low resolution area TLmn is located at the lower right end of each low resolution area TLmn. Outside the area of the binary image data D1, there is a representative value position AP at the lower right corner when it is assumed that the same division as the low resolution area TL is performed. Note that the value of the representative value a may be indicated by “APmn” which is a code indicating the representative value position.

さて、代表値aの求め方について、低解像度領域TLが1次元であると仮定して説明する。
〔1次元の場合の代表値〕
図10において、2値画像データD1について、それぞれ5つの画素TPからなる1次元の低解像度領域TL1,2,3…が示されている。それぞれの画素TPは、2値であるため、白または黒で示されている。例えば低解像度領域TL1では、各画素TPの値は、白、白、白、黒、黒である。この2値画像データD1は、図に示す画像データ(原画像データ)FDを、同じく図に示すディザパターンDPを用いて2値化処理を行うことにより得られたものである。つまり、画像データFDがディザパターンDPのしきい値以下であれば「白」、しきい値を越えれば「黒」となる。
Now, how to obtain the representative value a will be described on the assumption that the low resolution region TL is one-dimensional.
[Representative value in the case of one dimension]
10, for the binary image data D1, one-dimensional low-resolution areas TL1, 2, 3,... Each including five pixels TP are shown. Since each pixel TP is binary, it is shown in white or black. For example, in the low resolution region TL1, the value of each pixel TP is white, white, white, black, black. The binary image data D1 is obtained by performing binarization processing on the image data (original image data) FD shown in the figure using the dither pattern DP shown in the figure. In other words, if the image data FD is less than or equal to the threshold value of the dither pattern DP, it is “white”, and if it exceeds the threshold value, it is “black”.

まず、最初の代表値AP0を決める。最初の代表値AP0は、2値画像データD1の領域外であるので、どのような値でもとり得るが、低解像度領域TL1の左端の画素TPの濃度値(ハーフトーンデータ)、ディザパターンDPのしきい値などに対応して適当な値とすればよい。例えば、濃度値としきい値とから算出される画像データの範囲の中間値としてもよい。   First, the first representative value AP0 is determined. Since the first representative value AP0 is outside the area of the binary image data D1, any value can be taken. However, the density value (halftone data) of the leftmost pixel TP in the low resolution area TL1, the dither pattern DP An appropriate value may be set corresponding to the threshold value. For example, it may be an intermediate value of the range of image data calculated from the density value and the threshold value.

そして、最初のブロックである低解像度領域TL1を注目領域とし、注目領域における白画素に着目する。最初の代表値AP0から、注目領域の各白画素のしきい値に向かって直線LG1、2、3を引く。そのうち最も低い位置にある直線LG3を選択し、直線LG3を延長して当該注目領域の最後の画素TPの位置との交点を上限位置とし、この上限位置における濃度値を注目領域における代表値上限APmaxとする。   Then, the low resolution region TL1, which is the first block, is set as the attention region, and attention is paid to white pixels in the attention region. From the first representative value AP0, straight lines LG1, 2, and 3 are drawn toward the threshold value of each white pixel in the region of interest. The straight line LG3 at the lowest position is selected, the straight line LG3 is extended, and the intersection with the position of the last pixel TP of the target area is set as the upper limit position. The density value at this upper limit position is set as the representative value upper limit APmax in the target area. And

白画素と同様の処理を黒画素についても行う。すなわち、最初の代表値AP0から、注目領域の各黒画素のしきい値に向かって直線LG4、5を引く。そのうち最も高い位置にある直線LG4を選択し、直線LG4を延長して当該注目領域の最後の画素TPの位置との交点を下限位置とし、この下限位置における濃度値を注目領域における代表値下限APminとする。   Processing similar to that for white pixels is also performed for black pixels. That is, straight lines LG4, LG4 are drawn from the first representative value AP0 toward the threshold value of each black pixel in the region of interest. The straight line LG4 at the highest position is selected, the straight line LG4 is extended, and the intersection with the position of the last pixel TP of the target area is set as the lower limit position. The density value at this lower limit position is set as the representative value lower limit APmin in the target area. And

このようにして求めた代表値上限APmaxが代表値下限APminより大きいとき、つまり次の(1)式、
APmax≧APmin ……(1)
が成り立つとき、代表値上限APmaxと代表値下限APminとの間(代表値範囲)の値を、当該注目領域の代表値として選択することが可能である。本実施形態では、これら代表値上限APmaxと代表値下限APminとの間の中央値を低解像度領域TL1の代表値AP1として決定する。
When the representative value upper limit APmax thus determined is larger than the representative value lower limit APmin, that is, the following equation (1):
APmax ≧ APmin (1)
Is established, the value between the representative value upper limit APmax and the representative value lower limit APmin (representative value range) can be selected as the representative value of the region of interest. In the present embodiment, the median value between the representative value upper limit APmax and the representative value lower limit APmin is determined as the representative value AP1 of the low resolution region TL1.

このようにして代表値AP1を決定しておくと、隣接する領域に相当する前回の代表値AP0と、注目領域に相当する今回の代表値AP1とを、直線LA1で結び、この直線LA1とディザパターンDPとを用いることによって、低解像度領域TL1における2値画像データD1を完全に再現することができる。   If the representative value AP1 is determined in this way, the previous representative value AP0 corresponding to the adjacent area and the current representative value AP1 corresponding to the attention area are connected by the straight line LA1, and the straight line LA1 and the dither are connected. By using the pattern DP, the binary image data D1 in the low resolution region TL1 can be completely reproduced.

すなわち、前回の代表値AP0と今回の代表値AP1とを結ぶ直線LA1によって、低解像度領域TL1の各画素TPの濃度を補間して求め、求めた各画素TPの濃度からなる仮想階調画像をディザパターンDPを用いて擬似階調化することによって、図10に示す再構成画像データFSが得られる。この再構成画像データFSは、低解像度領域TL1内において、元になった2値画像データD1と同一である。つまり、代表値AP0,1に基づいて2値画像データD1が再現されたのである。なお、各画素TPの濃度からなる仮想階調画像は、これを連続的に表した場合には直線LA1となる。したがって、仮想階調画像データを「LA」で示すことがある。   That is, by interpolating the density of each pixel TP in the low resolution region TL1 by a straight line LA1 connecting the previous representative value AP0 and the current representative value AP1, a virtual gradation image composed of the obtained density of each pixel TP is obtained. By performing pseudo gradation using the dither pattern DP, reconstructed image data FS shown in FIG. 10 is obtained. The reconstructed image data FS is the same as the original binary image data D1 in the low resolution area TL1. That is, the binary image data D1 is reproduced based on the representative values AP0,1. Note that the virtual gradation image composed of the density of each pixel TP is a straight line LA1 when this is represented continuously. Therefore, the virtual gradation image data may be indicated by “LA”.

したがって、この場合に、上のように求めた代表値AP1を当該低解像度領域TL1の代表値aとして決定する。この場合の補間ルールHRは、注目領域の代表値AP1および注目領域に隣接する領域の代表値AP0の合計2つの代表値で定義される直線LA1によって各画素TPの濃度を補間する、ということである。直線LA1は、通常、水平に対して傾きを持っている。しかし、実際には低解像度領域TLは2次元であることが多く、したがって、その場合には、直線LA1によって補間するのではなく、平面によって補間することとなる。これは、上に述べた補間ルールHRの例の(1)に相当する。   Therefore, in this case, the representative value AP1 obtained as described above is determined as the representative value a of the low resolution region TL1. The interpolation rule HR in this case is that the density of each pixel TP is interpolated by a straight line LA1 defined by a total of two representative values of the representative value AP1 of the attention area and the representative value AP0 of the area adjacent to the attention area. is there. The straight line LA1 usually has an inclination with respect to the horizontal. However, in reality, the low resolution region TL is often two-dimensional, and in this case, the interpolation is not performed by the straight line LA1 but by a plane. This corresponds to (1) in the example of the interpolation rule HR described above.

もし、上の(1)式が成り立たない場合には、つまり、
APmax<APmin
の場合には、前回の代表値AP0を、その代表値上限APmaxと代表値下限APminとの範囲内で修正する。修正した代表値AP0を用いて、再度、上のようにして当該注目領域の代表値AP1を求める。
If the above equation (1) does not hold,
APmax <APmin
In this case, the previous representative value AP0 is corrected within the range between the representative value upper limit APmax and the representative value lower limit APmin. Using the corrected representative value AP0, the representative value AP1 of the attention area is obtained again as described above.

それでも代表値APまたは代表値範囲が求まらない場合には、その旨を記録した上で、別途の処理を行う。別途の処理として、例えば、注目領域をさらに複数の小領域に区画し、各小領域内において上のような処理を行って代表値APSを決定する。小領域として、例えば注目領域の半分の領域、または4分の1の領域などとする。小領域とすることによって、多くの場合に代表値APSが求められる。   If the representative value AP or the representative value range still cannot be obtained, a separate process is performed after recording that fact. As a separate process, for example, the attention area is further divided into a plurality of small areas, and the above processing is performed in each small area to determine the representative value APS. The small area is, for example, a half area of the attention area or a quarter area. By using a small area, the representative value APS is obtained in many cases.

また、小領域において代表値APが求まらない場合に、代表値上限APmaxと代表値下限APminとを適当に仮に定め、その範囲内の中間値を代表値APとして決定する。このようにした場合には、その領域においては元の2値画像データD1を正確に再現することができないが、ある程度の誤差があった場合でも許容することは可能である。   Further, when the representative value AP cannot be obtained in the small region, the representative value upper limit APmax and the representative value lower limit APmin are appropriately determined, and an intermediate value within the range is determined as the representative value AP. In such a case, the original binary image data D1 cannot be accurately reproduced in that region, but it is possible to tolerate even if there is some error.

また、小領域内において代表値APSが決定できない場合に、当該小領域における画像データを、当該小領域の代替の代表値APDとして決定してもよい。また、小領域に区画することなく、当該注目領域における画像データを当該注目領域の代替の代表値APDとして決定してもよい。この場合に、当然ではあるが、代替の代表値APDおよび小領域の代表値APSは、注目領域全体の通常の代表値APとは復元方法が異なる。   When the representative value APS cannot be determined in the small area, the image data in the small area may be determined as an alternative representative value APD for the small area. Further, the image data in the region of interest may be determined as an alternative representative value APD of the region of interest without being divided into small regions. In this case, as a matter of course, the alternative representative value APD and the representative value APS of the small area are different in restoration method from the normal representative value AP of the entire attention area.

このようにして、1つの注目領域である低解像度領域TL1の代表値AP1が決定される。次には、それに隣接する低解像度領域TL2を注目領域とし、先に求めた代表値AP1を用いて、上と同様に代表値上限APmaxと代表値下限APminとを求め、その中央値を代表値AP2とする。このような処理を繰り返して順次代表値APを求め、全ての領域について代表値APを求める。   In this way, the representative value AP1 of the low resolution region TL1 that is one region of interest is determined. Next, the low resolution region TL2 adjacent thereto is set as a region of interest, the representative value upper limit APmax and the representative value lower limit APmin are obtained in the same manner as described above using the previously obtained representative value AP1, and the median value is used as the representative value. Let it be AP2. Such processing is repeated to sequentially obtain the representative value AP, and the representative value AP is obtained for all regions.

なお、図10の低解像度領域TL3については、通常の代表値APが求まらなかったので、低解像度領域TL2における代表値AP2をその代表値上限APmaxに修正し、且つ適当な代表値AP3を選択した例が示されている。この場合には、修正した代表値AP2および代表値AP3を用いて復元すると、図に示されるような再構成画像データFSが得られる。低解像度領域TL3についての再構成画像データFSは、2値画像データD1と一致しない。つまり、4番目と5番目の画素TPの値が互いに逆となっている。しかしこの程度の誤差があっても再現性において許容されることがある。   For the low resolution region TL3 in FIG. 10, since the normal representative value AP was not obtained, the representative value AP2 in the low resolution region TL2 is corrected to the representative value upper limit APmax, and an appropriate representative value AP3 is set. A selected example is shown. In this case, reconstruction using the corrected representative value AP2 and representative value AP3 provides reconstructed image data FS as shown in the figure. The reconstructed image data FS for the low resolution region TL3 does not match the binary image data D1. That is, the values of the fourth and fifth pixels TP are opposite to each other. However, even this level of error may be acceptable in reproducibility.

なお、注目領域または小領域における画像データを代替の代表値APDとする場合には、その代表値APD(画像データ)と元の2値画像データD1との差分をとり、差分を代表値APとしてもよい。   When the image data in the attention area or the small area is used as the alternative representative value APD, the difference between the representative value APD (image data) and the original binary image data D1 is taken, and the difference is used as the representative value AP. Also good.

また、代表値APは画像の濃度に関係する値であるので、隣接する領域との間で関連が深く、近隣の領域においては代表値APが互いに接近している。つまり、近隣の領域では濃度の差分が小さく、そのため代表値APの差が小さい、という性質がある。したがって、ある低解像度領域TLの代表値APについて、その直前に求めた低解像度領域TLの代表値APとの差をとると、多くの場合に差が「0」となり、差の統計的な頻度の偏りが大きくなる。つまり、代表値APそれ自体に代えて、代表値APの差分を用いることにより、ハフマン法の符号化において高い圧縮率で圧縮することが可能となる。逆に言えば、差分ができるだけ0に近くなるように、そのような代表値aを可能な範囲で選択することが望ましい。
〔2次元の場合の代表値〕
ところで、上の説明では、区画された低解像度領域TLが1次元であると仮定して代表値APの求め方を説明した。しかし、実際には、低解像度領域TLは図6〜図9に示すように2次元であることが多い。例えば、低解像度領域TLは、上に述べたように6×16画素または4×16画素であったり(2値の場合)、4×4画素であったりする(16値の場合)。このように低解像度領域TLが2次元である場合については、1次元の場合の補間ルールHRにおける「直線」を「平面」に置き換えればよい。次に、図9(A)(B)を参照して簡単に説明する。
Further, since the representative value AP is a value related to the image density, the relationship between the adjacent areas is deep and the representative values AP are close to each other in the adjacent areas. That is, there is a property that the density difference is small in the neighboring area, and therefore the difference in the representative value AP is small. Accordingly, when the difference between the representative value AP of a certain low resolution region TL and the representative value AP of the low resolution region TL obtained immediately before is taken, the difference is “0” in many cases, and the statistical frequency of the difference The bias becomes larger. That is, by using the difference between the representative values AP in place of the representative value AP itself, it is possible to perform compression at a high compression rate in the Huffman method encoding. In other words, it is desirable to select such a representative value a within a possible range so that the difference is as close to 0 as possible.
[Typical values for 2D]
By the way, in the above description, the method for obtaining the representative value AP has been described on the assumption that the divided low-resolution area TL is one-dimensional. However, in practice, the low resolution region TL is often two-dimensional as shown in FIGS. For example, the low resolution region TL may be 6 × 16 pixels or 4 × 16 pixels (in the case of binary) or 4 × 4 pixels (in the case of 16 values) as described above. As described above, when the low-resolution area TL is two-dimensional, the “straight line” in the interpolation rule HR in the one-dimensional case may be replaced with a “plane”. Next, a brief description will be given with reference to FIGS.

図9(A)(B)に示すように、まず、 最初の代表値AP00,10,01を決める。最初の代表値AP00,10,01は、2値画像データD1の領域外であるので、どのような値でもとり得るが、低解像度領域TL11の代表値位置APに最も近い画素TPについての濃度値(ハーフトーンデータ)と、それに対応するディザパターンDPのしきい値となどに基づいて算出される画像データの範囲の中間値とするのがよい。   First, as shown in FIGS. 9A and 9B, first representative values AP00, 10, 01 are determined. Since the first representative values AP00, 10, 01 are outside the area of the binary image data D1, any value can be taken, but the density value for the pixel TP closest to the representative value position AP in the low resolution area TL11. It is preferable to set the intermediate value of the range of image data calculated based on (halftone data) and the threshold value of the corresponding dither pattern DP.

そして、最初のブロックである低解像度領域TL11を注目領域とし、注目領域を図9に示すように2つの三角形PA1,2に分ける。一方の三角形PA1の領域について、領域内の白画素に着目する。最初の代表値AP00,10,01のうち、三角形PA1の頂点に近い2つの代表値位置AP00,10を通り、 かつ注目領域内の白画素に対応するしきい値を通る平面を求める。この平面は、図10における直線LGに相当する。   Then, the low resolution area TL11 which is the first block is set as the attention area, and the attention area is divided into two triangles PA1 and PA2 as shown in FIG. In the area of one triangle PA1, attention is paid to white pixels in the area. Of the first representative values AP00,10,01, a plane that passes through two representative value positions AP00,10 close to the apex of the triangle PA1 and passes through a threshold value corresponding to a white pixel in the attention area is obtained. This plane corresponds to the straight line LG in FIG.

それらの平面のうち最も低い位置にある平面を選択し、その平面を延長して当該注目領域の最後の画素TPの位置との交点を上限候補位置とする。他方の三角形PA2の領域についても、これと同様にして上限候補位置を求める。得られた2つの上限候補位置のうちの小さい方を、注目領域における代表値上限APmaxとする。   The plane at the lowest position among these planes is selected, the plane is extended, and the intersection with the position of the last pixel TP in the region of interest is set as the upper limit candidate position. The upper limit candidate position is obtained in the same manner for the area of the other triangle PA2. The smaller of the two obtained upper limit candidate positions is set as the representative value upper limit APmax in the attention area.

白画素と同様の処理を黒画素についても行い、注目領域における代表値下限APminを求める。なお、図9(B)において、TPは各画素に対応する位置を示している。   Processing similar to that for white pixels is also performed for black pixels, and a representative value lower limit APmin in the region of interest is obtained. In FIG. 9B, TP indicates a position corresponding to each pixel.

このようにして求めた代表値上限APmaxが代表値下限APminよりの大きいとき、つまり上の(1)式が成り立つとき、代表値上限APmaxと代表値下限APminとの間の値、例えばその中央値を、低解像度領域TL11の代表値AP11として決定する。   When the representative value upper limit APmax thus determined is larger than the representative value lower limit APmin, that is, when the above equation (1) holds, a value between the representative value upper limit APmax and the representative value lower limit APmin, for example, the median value thereof. Is determined as the representative value AP11 of the low resolution region TL11.

このようにして決定した代表値AP11を用いると、隣接する領域のそれぞれの代表値AP00,10または代表値AP00,01とで定義される三角形PA1,2と、ディザパターンDPとを用いることによって、低解像度領域TL11における2値画像データD1を完全に再現することができる。   By using the representative value AP11 determined in this way, by using the triangles PA1 and PA2 defined by the representative values AP00 and 10 or the representative values AP00 and 01 of the adjacent areas, and the dither pattern DP, The binary image data D1 in the low resolution region TL11 can be completely reproduced.

もし、上の(1)式が成り立たない場合には、前回の代表値AP00,10,01を修正する。修正した代表値APを用いて、再度、上のようにして当該注目領域の代表値AP11を求める。   If the above equation (1) does not hold, the previous representative values AP00, 10, 01 are corrected. Using the corrected representative value AP, the representative value AP11 of the attention area is obtained again as described above.

それでも代表値APが求まらない場合には、代表値APが決定できない旨を記録した上で、別途の処理を行う。別途の処理として、1次元の場合と同様に、例えば、注目領域を半分または4分の1の小領域に区画し、各小領域内において上のような処理を行って代表値APSを決定する。   If the representative value AP is still not obtained, a separate process is performed after recording that the representative value AP cannot be determined. As a separate process, as in the one-dimensional case, for example, the attention area is divided into half or quarter small areas, and the above processing is performed in each small area to determine the representative value APS. .

また、小領域において代表値APが求まらない場合に、代表値上限APmaxと代表値下限APminとを適当に仮に定め、その範囲内の中間値を代表値APとして決定する。   Further, when the representative value AP cannot be obtained in the small region, the representative value upper limit APmax and the representative value lower limit APmin are appropriately determined, and an intermediate value within the range is determined as the representative value AP.

また、小領域内において代表値APSが決定できない場合などの処理についても、1次元の場合と同様に考えればよい。   Further, the processing in the case where the representative value APS cannot be determined in the small region may be considered in the same manner as in the one-dimensional case.

このようにして、1つの注目領域である低解像度領域TL11の代表値AP11が決定される。次には、それに隣接する低解像度領域TL12またはTL21を注目領域とし、先に求めた代表値AP11などを用いて、上と同様の処理によって代表値AP12または代表値AP21を求める。このような処理を繰り返して順次代表値APを求め、全ての領域について代表値APを求める。   In this way, the representative value AP11 of the low resolution region TL11 that is one region of interest is determined. Next, using the low resolution region TL12 or TL21 adjacent thereto as a region of interest, the representative value AP12 or the representative value AP21 is obtained by the same processing as above using the representative value AP11 obtained previously. Such processing is repeated to sequentially obtain the representative value AP, and the representative value AP is obtained for all regions.

なお、2次元の場合の代表値APの求め方を上に説明したが、この方法以外に、代表値APから再構成される画像を、一方向にのみ傾斜する斜面であるとする方法としてもよい。すなわち、この方法では、1次元の場合において画素を結ぶ直線としたところを、画素を結ぶ平面と言い換えて行う。この場合に、代表値APが求まらなかった場合の領域の分割は2方向に行う。この方法によると、処理がシンプルで高速に処理できるが、上に述べた方法と比べて圧縮率が劣る。   Although the method for obtaining the representative value AP in the case of two dimensions has been described above, in addition to this method, an image reconstructed from the representative value AP may be a slope inclined only in one direction. Good. That is, in this method, a straight line connecting pixels in a one-dimensional case is referred to as a plane connecting pixels. In this case, the area is divided in two directions when the representative value AP is not obtained. According to this method, the processing is simple and can be performed at high speed, but the compression rate is inferior to the method described above.

なお、先願方法においては、注目領域内における画像データのドットの配列パターンがディザパターンDPと一致する場合に、その領域における画像データの濃度から代表値aを求めた。これは、注目領域の全ての画素がある1つの濃度値を有した均一な画像データであると仮定した場合に、仮定した画像データを当該ディザパターンDPによって2値化したときに得られるドットパターンが、注目領域のドットパターンと等しくなる場合に、その注目領域のドットパターンは当該ディザパターンDPと一致することになる。そのような判別に用いる濃度値としてはどの様な値であってもよい。つまり、換言すれば、ディザパターンDPを用いてドットパターンを生成したときにドットパターンが互いに等しくなるような濃度値が存在する場合に、一致すると判別する、といえる。したがって、そのような濃度値は特定の1つの値の場合もあり、またある範囲における複数の値をとり得る場合もある。この濃度値が先願方法における代表値aである。   In the prior application method, when the dot arrangement pattern of the image data in the attention area matches the dither pattern DP, the representative value a is obtained from the density of the image data in that area. This is a dot pattern obtained when the assumed image data is binarized by the dither pattern DP, assuming that all the pixels in the attention area are uniform image data having a certain density value. However, when it becomes equal to the dot pattern of the attention area, the dot pattern of the attention area coincides with the dither pattern DP. Any value may be used as the density value used for such determination. In other words, it can be said that when there is a density value such that the dot patterns are equal to each other when the dot pattern is generated using the dither pattern DP, it is determined that they match. Therefore, such a density value may be a specific value or may have a plurality of values in a certain range. This density value is the representative value a in the prior application method.

本実施形態における代表値aも先願方法における代表値aも、代表値aが分かればディザパターンDPから低解像度領域TLのドットパターンを復元できるという点で共通である。つまり、画像情報成分として各領域におけるただ1つの代表値aを求めるだけで、ディザパターンDPを用いてその領域の2値画像データD1を再現することが可能となるのである。   The representative value a in this embodiment and the representative value a in the prior application method are common in that the dot pattern of the low resolution region TL can be restored from the dither pattern DP if the representative value a is known. That is, it is possible to reproduce the binary image data D1 of the area by using the dither pattern DP by obtaining only one representative value a in each area as the image information component.

したがって、この代表値aをプリンタ13に伝えることによって、プリンタ13において、2値画像データD1を得たときと同じ適当なディザパターンDPを用いて、2値画像データD1のドットパターンを再現できるのである。   Therefore, by transmitting this representative value a to the printer 13, the printer 13 can reproduce the dot pattern of the binary image data D1 using the same appropriate dither pattern DP as when the binary image data D1 was obtained. is there.

なお、本実施形態における補間ルールHRは、上に述べたように複数の代表値aで定義される直線または平面で補間することであるが、先願方法においては、その補間に用いる直線または平面が1つの代表値aを高さ位置とした水平なつまり傾斜のない直線または平面であると見ることができる。   The interpolation rule HR in this embodiment is to interpolate with a straight line or a plane defined by a plurality of representative values a as described above, but in the prior application method, a straight line or a plane used for the interpolation is used. Can be viewed as a horizontal or flat line or plane with one representative value a as the height position.

さて、画像データFDが各色について256階調であるとすると、代表値aは、8ビットの情報量を持つことになる。本実施形態において、低解像度領域TLは6×16=96ビットの情報量を持っており、これを8ビットで表現できるので、情報量を概ね10分の1に圧縮できることになる。また、代表値aの差分を用いることにより、符号化において例えばさらに数分の1に圧縮することが可能である。   If the image data FD has 256 gradations for each color, the representative value a has an 8-bit information amount. In the present embodiment, the low resolution area TL has an information amount of 6 × 16 = 96 bits, and this can be expressed by 8 bits. Therefore, the information amount can be compressed to about 1/10. In addition, by using the difference of the representative value a, it is possible to further compress to, for example, a fraction in encoding.

ところで、代表値aの取り得る値の範囲は0〜255であるから、単純な引き算を行った場合には、差分の範囲は−255〜+255となり、これを表すのに必要な情報量は9ビットとなる。しかし、本実施形態では、差分を単純な引き算によって求めるのではなく、代表値aが0〜255の循環整数であるとして差分を求める。これによって、差分は、全て0〜255の整数で表され、これを表すのに必要な情報量は8ビットとなり、半分に減少する。   By the way, since the range of values that the representative value a can take is 0 to 255, when a simple subtraction is performed, the range of the difference is −255 to +255, and the amount of information necessary to express this is 9 A bit. However, in the present embodiment, the difference is not obtained by simple subtraction, but the difference is obtained assuming that the representative value a is a cyclic integer of 0 to 255. As a result, all the differences are represented by integers from 0 to 255, and the amount of information necessary to represent this is 8 bits, which is reduced to half.

次に、循環整数であるとして差分を求める方法について説明する。説明を簡単化するため、0〜8の循環整数について説明する。   Next, a method for obtaining the difference assuming that it is a cyclic integer is described. In order to simplify the description, a cyclic integer of 0 to 8 will be described.

図11は0〜8の循環整数を示す図である。   FIG. 11 is a diagram showing a cyclic integer of 0 to 8.

図11において、ある数Aを基準とし、これとある数Bとの差分Cを求めるには、循環整数の中の数Aの示す位置から、数Bに相当する位置数を左方向に回転し、止まった位置の数値を差分Cとする。例えば、「5」と「3」の差分は、循環整数の「5」の位置から3つ左方向に回転して得られる「2」が答である。他の例では、「0」と「8」の差分は、循環整数の「0」の位置から8つ左方向に回転して得られる「1」が答である。さらに他の例では、「3」と「5」の差分は、循環整数の「3」の位置から5つ左方向に回転して得られる「7」が答である。このようにして、差分が0〜8の範囲内の整数値として得られる。   In FIG. 11, in order to obtain a difference C between a certain number A and a certain number B, the position number corresponding to the number B is rotated leftward from the position indicated by the number A in the cyclic integer. The numerical value of the stopped position is defined as a difference C. For example, the difference between “5” and “3” is “2” obtained by rotating three rotations from the position of the cyclic integer “5” to the left. In another example, the difference between “0” and “8” is “1”, which is obtained by rotating eight leftward from the position of the cyclic integer “0”. In yet another example, the difference between “3” and “5” is “7”, which is obtained by rotating left by five from the position of the cyclic integer “3”. In this way, the difference is obtained as an integer value in the range of 0-8.

また、ある数Bに差分Cを加算することによってある数Aが求まる。この場合には、循環整数のある数Bの示す位置から、差分Cに相当する位置数を右方向に回転し、止まった位置の数値を数Aとする。このようにして完全に復元することができる。   Further, a certain number A is obtained by adding the difference C to the certain number B. In this case, the number of positions corresponding to the difference C is rotated to the right from the position indicated by the number B having the cyclic integer, and the numerical value of the stopped position is set to the number A. In this way, it can be completely restored.

図12は画像における代表値aの差分の出現頻度の分布を表す図である。   FIG. 12 is a diagram showing the distribution of the appearance frequency of the difference of the representative value a in the image.

図12に示すように、差分が「0」〜「20」程度および「230」〜「255」程度の範囲で出現頻度が高い。このような分布は、画像の種類によらずほぼ同じであり、且つ偏りが非常に大きいので、差分を用いることによって大抵の画像をハフマン法によって大幅に圧縮することができる。   As shown in FIG. 12, the appearance frequency is high in the range where the difference is about “0” to “20” and about “230” to “255”. Such a distribution is almost the same regardless of the type of image, and the deviation is very large, so that most images can be greatly compressed by the Huffman method by using the difference.

画像にもよるが、1つの低解像度領域TLをl〜2ビット程度に圧縮できる。また、6×16画素の低解像度領域TLのドットパターンがディザパターンDPと一致する確率は、大抵の画像において95%程度になる。つまり、画像全体の概ね95%の領域で、元々96ビットであったデータが1〜2ビットで表現できることとなり、この時点において数十倍という高い圧縮率で圧縮を行えることとなる。   Depending on the image, one low resolution area TL can be compressed to about 1 to 2 bits. The probability that the dot pattern of the 6 × 16 pixel low-resolution area TL matches the dither pattern DP is about 95% in most images. That is, in an area of approximately 95% of the entire image, data originally 96 bits can be expressed by 1 to 2 bits, and compression can be performed at a compression rate as high as several tens of times at this point.

なお、図12において、代表値aの差分である0〜255の後に、「256」「257」「258」の3つの値についての出現頻度が示されている。これは、所定の状態が生じたときにその状態を特定の3つの数値で示し、これによって情報量をさらに低減し、圧縮率をさらに高めるためのものである。   In FIG. 12, the appearance frequency for three values “256”, “257”, and “258” is shown after 0 to 255, which is the difference of the representative value a. This is to indicate the state with a specific three numerical values when a predetermined state occurs, thereby further reducing the amount of information and further increasing the compression rate.

例えば、画像において同じ濃度の画素が長く続くことも頻繁に起こるので、後述するように同じ濃度が50領域にわたって続いた場合、つまり差分「0」が50回続いた場合に、それを「257」という1つの属性コードで表すのである。「256」は、ある低解像度領域TLで代表値aが決定できなかったことを表す属性コード、「258」は、ディザパターンDPの切り換えを行ったこと、つまりある低解像度領域TLにおいて切り換えられた他のディザパターンDPによって代表値aが決定されたことを表す属性コードである。2回切り換えられたときは、「258」が2回出力される。   For example, since pixels with the same density frequently continue in the image for a long time, as described later, when the same density continues over 50 regions, that is, when the difference “0” continues 50 times, it is set to “257”. It is expressed by one attribute code. “256” is an attribute code indicating that the representative value a could not be determined in a certain low resolution region TL, and “258” indicates that the dither pattern DP was switched, that is, switched in a certain low resolution region TL. This is an attribute code indicating that the representative value a is determined by another dither pattern DP. When switched twice, “258” is output twice.

上に述べたように、低解像度代表値算出部103においては、低解像度領域TLについて、順に代表値aが求められ、隣合う領域との間の差分が求められる。差分および属性値などによって、符号化部108に送るデータが作成される。   As described above, in the low resolution representative value calculation unit 103, the representative value a is obtained in order for the low resolution region TL, and a difference between adjacent regions is obtained. Data to be sent to the encoding unit 108 is created based on the difference and the attribute value.

例えば、差分として「0」が50回連続した場合に、属性値「257」が符号化部108に出力される。差分「0」の値は出力されない。差分「0」が50回連続しなかった場合は、それまで連続していた個数だけ「0」が出力され、その後に、「0」でない差分が出力される。ディザパターンDPの切り換えが行われた場合には、属性コード「258」が切り換え回数分出力される。代表値aが決定されなかった場合には、属性コード「256」が出力される。この場合には、その低解像度領域TLは、次に説明する中解像度領域区画部104によって処理される。
〔中解像度領域および高解像度領域の処理〕
図13は低解像度領域TLおよび中解像度領域TMを示す図、図14はドットパターンの数値化を説明するための図、図15は各ドットパターンの出現頻度の分布を表す図である。
For example, when “0” continues as the difference 50 times, the attribute value “257” is output to the encoding unit 108. The value of the difference “0” is not output. If the difference “0” has not been repeated 50 times, “0” is output for the number that has been continued until then, and then a difference that is not “0” is output. When the dither pattern DP is switched, the attribute code “258” is output for the number of times of switching. If the representative value a is not determined, the attribute code “256” is output. In this case, the low resolution area TL is processed by the medium resolution area dividing unit 104 described below.
[Processing of medium resolution area and high resolution area]
13 is a diagram showing the low resolution region TL and the medium resolution region TM, FIG. 14 is a diagram for explaining the digitization of the dot pattern, and FIG. 15 is a diagram showing the distribution of the appearance frequency of each dot pattern.

中解像度領域区画部104では、低解像度領域TLを、さらに図13に示すような3×8画素の4つの中解像度領域TMに区画する。   In the medium resolution area dividing unit 104, the low resolution area TL is further divided into four medium resolution areas TM of 3 × 8 pixels as shown in FIG.

中解像度代表値算出部106では、中解像度領域TMにおいて、上に述べたと同様な処理によって代表値aを求める。そして、得られた代表値に基づいて、隣合う中解像度領域TMの間の代表値の差分が、上に述べた低解像度領域TLの場合と同様にして算出される。ここでの差分は、上に述べた循環整数を用いるので、0〜255の範囲となる。   The medium resolution representative value calculation unit 106 obtains the representative value a in the medium resolution region TM by the same process as described above. Then, based on the obtained representative value, the difference in the representative value between the adjacent medium resolution areas TM is calculated in the same manner as in the case of the low resolution area TL described above. The difference here is in the range of 0 to 255 because the cyclic integer described above is used.

なお、1つの低解像度領域TLについての4つの中解像度領域TMの処理が終わると、再度、低解像度領域TLについての処理に戻る。   When the processing of the four medium resolution areas TM for one low resolution area TL is completed, the process returns to the processing for the low resolution area TL again.

ドットパターン抽出部107は、中解像度領域TMにおいても代表値aが求まらなかった場合に、中解像度領域TMをさらに8画素の3つの高解像度領域TSに区画し、この高解像度領域TSのドットパターンを数値化する。ドットパターンの数値化においては、例えば、図14に示すように、ドットの打たれている画素を「1」、打たれていない画素を「0」として2進数で表し、これを10進数に変換し、これを属性コードとして出力する。   When the representative value a is not found in the medium resolution area TM, the dot pattern extraction unit 107 further divides the medium resolution area TM into three high resolution areas TS of 8 pixels. Digitize the dot pattern. In the digitization of the dot pattern, for example, as shown in FIG. 14, the doted pixel is represented by a binary number “1”, and the non-printed pixel is represented by “0”, which is converted into a decimal number. This is output as an attribute code.

図15に示すように、特定の値に集中するかなり偏った分布であることが分かる。したがって、この場合においても、ハフマン法の符号化によって高い圧縮率を得ることができる。例えば2倍程度の圧縮率を得ることができる。   As shown in FIG. 15, it can be seen that the distribution is considerably biased and concentrated on a specific value. Accordingly, even in this case, a high compression rate can be obtained by encoding using the Huffman method. For example, a compression ratio of about twice can be obtained.

なお、1つの中解像度領域TMについての3つの高解像度領域TSの処理が終わると、再度、中解像度領域TMについての処理に戻る。   When the processing of the three high resolution areas TS for one medium resolution area TM is completed, the process returns to the process for the medium resolution area TM again.

符号化部108では、入力されるデータ、つまり、代表値aの差分、ドット数の差分、および属性コードなどを、ハフマン法によって符号化する。ハフマン法による圧縮は、信号の頻度分布が大きく変化しない対象に対して非常に有効である。ハフマン法それ自体については公知であるのでここでの詳しい説明は省略する。
〔ハフマンコード表の説明〕
本実施形態においては、低解像度領域TLについての代表値aの差分および属性コード、中解像度領域TMについてのドット数の差分および属性コード、高解像度領域TSについての属性コードを、それぞれ別個独立したコード1〜3によって符号化する。そのために、それぞれに専用の3つのハフマンコード表FH1〜3が設けられている。
The encoding unit 108 encodes input data, that is, a difference in the representative value a, a difference in the number of dots, an attribute code, and the like by the Huffman method. The compression by the Huffman method is very effective for an object whose signal frequency distribution does not change greatly. Since the Huffman method itself is publicly known, detailed description thereof is omitted here.
[Explanation of Huffman code table]
In this embodiment, the difference and attribute code of the representative value a for the low resolution area TL, the difference and attribute code of the number of dots for the medium resolution area TM, and the attribute code for the high resolution area TS are respectively independent codes. 1 to 3 are encoded. Therefore, three dedicated Huffman code tables FH1 to FH3 are provided for each.

図16はハフマンコード表FH1〜3の例を示す図である。図16(a)は低解像度領域用であるコード1のハフマンコード表FH1、図16(b)は中解像度領域用であるコード2のハフマンコード表FH2、図16(c)は高解像度領域用であるコード3のハフマンコード表FH3をそれぞれ示す。これらについて簡単に説明する。   FIG. 16 is a diagram showing an example of the Huffman code tables FH1 to FH3. FIG. 16A shows the Huffman code table FH1 for code 1 for the low resolution area, FIG. 16B shows the Huffman code table FH2 for code 2 for the medium resolution area, and FIG. 16C for the high resolution area. A Huffman code table FH3 for code 3 is shown. These will be briefly described.

図16(a)において、ハフマンコード表FH1には、入力、出力コード、出力桁数などの項目が設けられている。入力と出力コードとの関係は、各データの出現頻度に基づき、ハフマン法による符号化によって予め決められている。出力コードは、実際には、例えば4バイトのデータとしてメモリに格納されており、実質上4バイトに満たない符号は、上位の桁が「0」で埋まっている。   In FIG. 16A, the Huffman code table FH1 includes items such as an input, an output code, and the number of output digits. The relationship between the input and the output code is determined in advance by encoding by the Huffman method based on the appearance frequency of each data. The output code is actually stored in the memory as, for example, 4 bytes of data, and a code that is substantially less than 4 bytes is padded with “0” in the upper digit.

入力されたデータに対して、それに一致する入力の項に対応する出力コードの項のデータを、その最下位桁から出力桁数の項で示される桁数分を読み出す。例えば、入力が「3」のときには、出力コード「…0001000100」の7桁分である「1000100」が読み出される。読み出された「1000100」が圧縮データD2となる。   For the input data, the data of the term of the output code corresponding to the input term corresponding to the input data is read from the least significant digit by the number of digits indicated by the term of the number of output digits. For example, when the input is “3”, “1000100” which is 7 digits of the output code “. The read “1000100” becomes the compressed data D2.

図16(b)(c)に示すハフマンコード表FH2,3についても、同様に、入力、出力コード、出力桁数などの項目が設けられている。これら入力と出力コードとの関係は、3つのハフマンコード表FH1〜3について互いに独立して、ハフマン法による符号化によって予め決められている。   Similarly, the Huffman code tables FH2 and 3 shown in FIGS. 16B and 16C are also provided with items such as input, output code, and number of output digits. The relationship between these input and output codes is determined in advance by encoding by the Huffman method for the three Huffman code tables FH1 to FH3.

例えば、ハフマンコード表FH2において、入力が「1」のときには、出力コード「…0001010」の4桁分である「1010」が読み出される。ハフマンコード表FH3において、入力が「1」のときには、出力コード「…0001010」の4桁分である「1010」が読み出される。   For example, in the Huffman code table FH2, when the input is “1”, “1010” that is four digits of the output code “. In the Huffman code table FH3, when the input is “1”, “1010”, which is the four digits of the output code “.

なお、これらのハフマンコード表FH1〜3によって同じ符号に変換される場合があるが、いずれのコード1〜3に対応して変換されたか、つまり高中低のいずれの解像度領域に対して圧縮が行われたかが認識可能になっているので、それに応じたデコード表DCが選択されることとなり、完全な復元が可能である。   Although these Huffman code tables FH1 to 3 may be converted into the same code, compression is performed on which code area corresponds to which code 1 to 3 is converted. Since it can be recognized, the decoding table DC corresponding to it is selected, and complete restoration is possible.

例えば、符号化に際しては、データに「256」が現れるまでは、低解像度領域用のハフマンコード表FH1を用いたコード1の符号化が行われる。「256」が現れると、「256」がコード1で符号化された後、中解像度領域用のハフマンコード表FH2に切り換えられ、4つの中解像度領域TMの符号化が完了するまでコード2の符号化が続行される。コード2の符号化を行っているときに「25」が現れると、「25」がコード2で符号化された後、高解像度領域用のハフマンコード表FH3に切り換えられ、3つの高解像度領域TSの符号化が完了するまでコード3の符号化が続行される。3つの高解像度領域TSの符号化が完了すれば、コード2の符号化に戻り、4つの中解像度領域TMの符号化が完了すれば、再びコード1の符号化に戻る。以下、このルールにしたがって、入力されるデータが順次符号化され、圧縮データD2が作成される。   For example, in encoding, code 1 is encoded using the Huffman code table FH1 for the low resolution area until “256” appears in the data. When “256” appears, after “256” is encoded with code 1, it is switched to the Huffman code table FH2 for the medium resolution area, and the code of code 2 is encoded until encoding of the four medium resolution areas TM is completed. Will continue. If “25” appears during encoding of code 2, “25” is encoded with code 2 and then switched to the Huffman code table FH3 for the high-resolution area, and the three high-resolution areas TS The encoding of code 3 is continued until the encoding of is completed. When the encoding of the three high resolution areas TS is completed, the process returns to the encoding of the code 2, and when the encoding of the four medium resolution areas TM is completed, the process returns to the encoding of the code 1 again. Thereafter, the input data is sequentially encoded according to this rule, and the compressed data D2 is created.

また、圧縮データ作成部100において、ハフマンコード表FH1〜3で符号化した圧縮データD2を復元するためのデコード表DC1〜3が作成される。   Further, the compressed data creation unit 100 creates decode tables DC1 to DC3 for restoring the compressed data D2 encoded by the Huffman code tables FH1 to FH3.

データ送信部109は、符号化部108で作成した圧縮データD2をプリンタ13に送信する。また、データ送信部109は、全てのディザパターンDPおよびデコード表DCをプリンタ13に予め送信する。   The data transmission unit 109 transmits the compressed data D2 created by the encoding unit 108 to the printer 13. In addition, the data transmission unit 109 transmits all the dither patterns DP and the decode table DC to the printer 13 in advance.

なお、デコード表DCは、データの出現頻度に基づいて作成される。各データの出現頻度は、本実施形態におけるアルゴリズムを実際に実行して求めることも可能である。例えば、そのような頻度表として、CMYKの各色ごとに、文字領域用、画像領域用、およびチャート領域用の各ディザパターンDPについて求めた各頻度を全て合計して作成した表を用いることができる。頻度表は、圧縮する画像それぞれについて求めるのが理想的であるが、そのようにしなくとも、上記のように合計して作成した頻度表に基づいて、十分な圧縮性能を得ることができる。同様の理由で、CMYKの各色に対して、文字領域、画像領域、チャート領域などの各領域に対しても、上記のようにして作成した同じ頻度表を用いることができる。
〔復元処理〕
次に、プリンタ13における復元処理について説明する。
The decoding table DC is created based on the appearance frequency of data. The appearance frequency of each data can also be obtained by actually executing the algorithm in this embodiment. For example, as such a frequency table, a table created by summing all the frequencies obtained for the dither patterns DP for the character area, the image area, and the chart area for each color of CMYK can be used. . Ideally, the frequency table should be obtained for each image to be compressed, but even if it is not done, sufficient compression performance can be obtained on the basis of the frequency table created as a sum as described above. For the same reason, the same frequency table created as described above can be used for each region such as a character region, an image region, and a chart region for each color of CMYK.
[Restore processing]
Next, restoration processing in the printer 13 will be described.

図4において、プリンタ13は、ディザパターン記憶部360、データ復元部300、デコード表記憶部370、およびラインバッファ380などから構成される。   4, the printer 13 includes a dither pattern storage unit 360, a data restoration unit 300, a decode table storage unit 370, a line buffer 380, and the like.

ディザパターン記憶部360は、コンピュータ本体11のディザパターン記憶部160に記憶されているディザパターンDPと同様のものを保持している。このディザパターンDPは、コンピュータ本体11から予め送信されたものであるが、同じディザパターンDPを適当なメモリに格納したものを予めプリンタ13に内蔵しておいてもよい。   The dither pattern storage unit 360 holds the same dither pattern DP stored in the dither pattern storage unit 160 of the computer main body 11. The dither pattern DP is transmitted from the computer main body 11 in advance, but the same dither pattern DP stored in an appropriate memory may be built in the printer 13 in advance.

デコード表記憶部370は、コンピュータ11から送信されたデコード表DCを格納する。   The decode table storage unit 370 stores the decode table DC transmitted from the computer 11.

データ復元部300は、所定のディザパターンDP、デコード表DC、および補間ルールHRを参照して、コンピュータ11から受信した圧縮データD2を復元し、ドットパターンを再現する。圧縮データD2の復元に際して、最初に低解像度領域用のデコード表DC1を用いてデコード1による復元処理が行われ、条件に応じて、中解像度領域用のデコード表DC2を用いたデコード2による復元処理、または高解像度領域用のデコード表DC3を用いたデコード3による復元処理がそれぞれ行われる。つまり、コード1,2,3で符号化した圧縮データD2に対して、それぞれ、デコード1,2,3で復元することとなる。なお、データ復元部300には、圧縮データ作成部100で用いる補間ルールHRと同じ補間ルールHRが、それを実行する処理回路やプログラムなどとして設けられている。   The data restoration unit 300 refers to a predetermined dither pattern DP, decode table DC, and interpolation rule HR, restores the compressed data D2 received from the computer 11, and reproduces a dot pattern. At the time of decompression of the compressed data D2, first, the decompression process by the decode 1 is performed using the decode table DC1 for the low resolution area, and the decompression process by the decode 2 using the decode table DC2 for the medium resolution area according to the conditions. Alternatively, the restoration process by the decode 3 using the decode table DC3 for the high resolution area is performed. That is, the compressed data D2 encoded by the codes 1, 2, and 3 are restored by the decodes 1, 2, and 3, respectively. In the data restoration unit 300, the same interpolation rule HR as the interpolation rule HR used in the compressed data creation unit 100 is provided as a processing circuit or a program for executing the same.

図17はデコード表DC2の例を示す図である。   FIG. 17 is a diagram showing an example of the decode table DC2.

図17において、デコード表DC2は、記号数、Root、子0、子1などの項目を有する。入力されるデータをもとに、Root=24の位置から表を順にたどることで元のデータを得ることができる。例えば、入力されたデータが「011011」であった場合に、データの先頭が「0」であるから、まず、Root=24の子0より始める。Root=24の子0の値が「23」であり、データの次の値が「1」であるので、次は、Root=23の子1を見る。Root=23の子1の値が「22」であり、データの次の値が「1」であるので、次は、Root=22の子1を見る。以下同様の作業を繰り返し、子0または子1の値が負になった時点で終了する。最後に得られた値(負の値)と記号数(この場合「26」)との和が、元のデータである。以下、データの次の値から同様の処理を行い、データの展開が完了するまで繰り返す。   In FIG. 17, the decode table DC2 has items such as the number of symbols, Root, child 0, child 1 and the like. Based on the input data, the original data can be obtained by sequentially tracing the table from the position of Root = 24. For example, if the input data is “011011”, the top of the data is “0”, so the process starts with the child 0 of Root = 24. Since the value of the child 0 of Root = 24 is “23” and the next value of the data is “1”, next, the child 1 of Root = 23 is seen. Since the value of the child 1 of Root = 23 is “22” and the next value of the data is “1”, the child 1 of Root = 22 is seen next. Thereafter, the same operation is repeated, and the process ends when the value of child 0 or child 1 becomes negative. The sum of the last obtained value (negative value) and the number of symbols (in this case “26”) is the original data. Thereafter, the same processing is performed from the next value of the data, and it is repeated until the data expansion is completed.

ドットパターンの再現においては、まずデコード1によって復元処理が行われる。デコード表DC1によって復元された値が「258」であった場合は、ディザパターンDPが切り換えられたことを示している。「258」が複数続く場合は、続いた回数分だけディザパターンDPが順に切り換えられ、切り換えた後のディザパターンDPが、以降使用するディザパターン(カレントディザパターン)DPとして設定される。   In the reproduction of the dot pattern, the restoration process is first performed by the decode 1. When the value restored by the decoding table DC1 is “258”, it indicates that the dither pattern DP has been switched. When a plurality of “258” continues, the dither pattern DP is sequentially switched as many times as the number of times followed, and the dither pattern DP after the switching is set as a dither pattern (current dither pattern) DP to be used thereafter.

復元した値が「256」であった場合は、以降の処理が中解像度領域用のデコード表DC2を用いたデコード2による復元処理に切り換えられる。復元した値が「257」であった場合は、代表値の差分について「0」が50回続いたことを表しているので、カレントディザパターンDPにより、50領域分、前回算出した低解像度領域TLの代表値と同じ値を用いてドットパターンが再現され、ラインバッファ380に送られる。50領域分の処理が完了する前に行末に達したときは、その残りが次の行のデータとしてラインバッファ380に送られる。復元した値がこれいずれでもない場合は、その値は代表値の差分である。この場合は、前回算出した低解像度領域TLの代表値aを初期値とし、初期値に差分を加算することによって今回の代表値aを得る。このように、差分を累計することによって全ての低解像度領域TLの代表値aが得られる。今回が初回であった場合は、初期値を「0」として代表値aを得る。そして、得られた代表値a、カレントディザパターンDP、および補間ルールHRとからドットパターンが再現され、ラインバッファ380に送られる。   When the restored value is “256”, the subsequent processing is switched to the restoration processing by decoding 2 using the decoding table DC2 for the medium resolution area. If the restored value is “257”, it means that “0” has continued 50 times for the difference between the representative values, and therefore, the low-resolution area TL previously calculated for 50 areas by the current dither pattern DP. A dot pattern is reproduced by using the same value as the representative value of, and sent to the line buffer 380. When the end of the line is reached before the processing for 50 areas is completed, the rest is sent to the line buffer 380 as data of the next line. If the restored value is none of these, the value is a difference between representative values. In this case, the representative value a of the low resolution region TL calculated last time is set as an initial value, and the current representative value a is obtained by adding the difference to the initial value. In this manner, the representative values a of all the low resolution areas TL are obtained by accumulating the differences. If this is the first time, the initial value is set to “0” to obtain the representative value a. Then, a dot pattern is reproduced from the obtained representative value a, current dither pattern DP, and interpolation rule HR, and sent to the line buffer 380.

デコード2による復元処理では、中解像度領域用のデコード表DC2によって復元が行われる。デコード2によって復元された値が「256」であった場合は、以降の処理が高解像度領域用のデコード3の復元処理に切り換えられる。復元した値が「256」でない場合は、その値は中解像度領域TMの代表値の差分である。この場合は、低解像度領域の場合と同様に累計によって代表値を求める。得られた代表値とカレントディザパターンDPとから、中解像度領域TMのドットパターンが再現される。4つの中解像度領域TMについての処理が終わると、デコード1に戻る。   In the restoration process by the decode 2, the restoration is performed by the decode table DC2 for the medium resolution area. When the value restored by the decode 2 is “256”, the subsequent processing is switched to the restoration processing of the decode 3 for the high resolution area. When the restored value is not “256”, the value is the difference between the representative values of the medium resolution area TM. In this case, the representative value is obtained by accumulation as in the case of the low resolution region. From the obtained representative value and the current dither pattern DP, the dot pattern of the medium resolution region TM is reproduced. When the processing for the four medium resolution areas TM is completed, the process returns to the decode 1.

デコード3による復元処理では、高解像度領域用のデコード表DC3によって復元が行われる。デコード3によって復元された結果は、8画素分のドットの並びを表わしている。3つの高解像度領域TSについての復元が繰り返され、これによって1つの中解像度領域TMのドットパターンが再現される。これにより、中解像度領域TMの復元処理が1つ完了したことがカウントされ、呼び出し元の処理のデコード2へ戻る。   In the restoration process by the decode 3, the restoration is performed by the decode table DC3 for the high resolution area. The result restored by the decode 3 represents an array of dots for 8 pixels. The restoration for the three high resolution areas TS is repeated, thereby reproducing the dot pattern of one medium resolution area TM. Thereby, it is counted that one restoration process of the medium resolution area TM is completed, and the process returns to the decoding 2 of the calling process.

このように、属性コード「256」は、領域間におけるコード切り換え信号として機能し、これらの属性コードが現れることによって、間違いなくコード1からコード2へまたはコード2からコード3へ切り換えることができる。   As described above, the attribute code “256” functions as a code switching signal between areas, and when these attribute codes appear, it is possible to switch from the code 1 to the code 2 or from the code 2 to the code 3 without fail.

ラインバッファ380では、データ復元部300より送られた2値画像データが一時的に格納される。ラインバッファ380に格納された2値画像データは、例えば6行分ごとに出力され、用紙にプリントアウトされる。
〔フローチャートによる説明〕
次に、コンピュータ本体11およびプリンタ13における処理について、フローチャートを参照して説明する。
In the line buffer 380, the binary image data sent from the data restoration unit 300 is temporarily stored. The binary image data stored in the line buffer 380 is output every six lines, for example, and printed out on paper.
[Explanation by flowchart]
Next, processing in the computer main body 11 and the printer 13 will be described with reference to flowcharts.

図17はコンピュータ本体11における圧縮処理の大まかな流れを示すフローチャート、図18はプリンタ13における復元処理の大まかな流れを示すフローチャートである。   FIG. 17 is a flowchart showing a general flow of the compression processing in the computer main body 11, and FIG. 18 is a flowchart showing a general flow of the decompression processing in the printer 13.

図17において、準備としてディザパターンDPを読み込んだ後(#11)、2値画像データD1を読み込む(#12)。2値画像データD1を低解像度領域TLに区画し(#13)、1つの低解像度領域TLについて、代表値として選択することの可能な範囲(代表値範囲)があるか否かを判別する(#14)。   In FIG. 17, after reading the dither pattern DP as a preparation (# 11), the binary image data D1 is read (# 12). The binary image data D1 is divided into low resolution areas TL (# 13), and it is determined whether or not there is a range (representative value range) that can be selected as a representative value for one low resolution area TL ( # 14).

このステップ#14において、上に述べたように、注目領域に隣接する領域の代表値APおよびディザパターンDPのしきい値に基づいて、注目領域における代表値上限APmaxおよび代表値下限APminを求め、これらから代表値範囲が存在するか否かを判断し、存在する場合にその代表値範囲を取得する。   In step # 14, as described above, the representative value upper limit APmax and the representative value lower limit APmin in the attention area are obtained based on the representative value AP of the area adjacent to the attention area and the threshold value of the dither pattern DP. From these, it is determined whether or not a representative value range exists, and if it exists, the representative value range is acquired.

ディザパターンDPが複数ある場合には、代表値範囲が見つかるまでディザパターンDPを切り換える。代表値範囲が見つかれば(#14でイエス)、代表値範囲内で代表値aを求める(#15)。この場合に、例えば、代表値範囲の中央値を代表値aとして決定する。そして、ここで決定した代表値aと先に求めた代表値aとの差分をとり(#16)、符号化する(#17)。   When there are a plurality of dither patterns DP, the dither pattern DP is switched until a representative value range is found. If the representative value range is found (Yes in # 14), the representative value a is obtained within the representative value range (# 15). In this case, for example, the median value of the representative value range is determined as the representative value a. Then, the difference between the representative value a determined here and the previously obtained representative value a is taken (# 16) and encoded (# 17).

ステップ#14で代表値範囲がない場合は、中解像度領域TMに区画し(#19)、1つの中解像度領域TMについて、代表値範囲があるか否かを判別する(#20)。代表値範囲があれば、ドットの個数を求め(#21)、その差分をとり(#22)、符号化する(#23)。ステップ#20で代表値範囲が見つからない場合は、高解像度領域TSに区画し(#25)、1つの高解像度領域TSについて、ドット配列を得て(#26)、それを符号化する(#27)。   If there is no representative value range in step # 14, it is divided into medium resolution areas TM (# 19), and it is determined whether or not there is a representative value range for one medium resolution area TM (# 20). If there is a representative value range, the number of dots is obtained (# 21), the difference is taken (# 22), and encoding is performed (# 23). If the representative value range is not found in step # 20, it is partitioned into high-resolution areas TS (# 25), and a dot array is obtained for one high-resolution area TS (# 26) and encoded (##). 27).

このような処理を、読み込まれた2値画像データD1の全部について終了するまで行う(#18、24、28)。   Such a process is performed until all of the read binary image data D1 is completed (# 18, 24, 28).

図19において、準備としてディザパターンDPおよびデコード表DCを読み込む(#31、32)。圧縮データD2を読み込んで(#33)、代表値aを取得し(#34)、補間ルールHRを用いて各画素の濃度を算出し、ディザパターンDPを参照してドットパターンを得る(#35、36)。なお、中解像度領域TMおよび高解像度領域TSの復元処理については説明を省略した。   In FIG. 19, the dither pattern DP and the decode table DC are read as preparation (# 31, 32). The compressed data D2 is read (# 33), the representative value a is obtained (# 34), the density of each pixel is calculated using the interpolation rule HR, and the dot pattern is obtained by referring to the dither pattern DP (# 35). 36). Note that the description of the restoration processing of the medium resolution area TM and the high resolution area TS is omitted.

次に、さらに詳しいフローチャートを用いて説明する。   Next, it demonstrates using a more detailed flowchart.

図20および図21は圧縮データ作成部100における圧縮処理のフローチャート、図22は代表値範囲の確定処理の例を示すフローチャート、図23および図24はデータ復元部300における復元処理のフローチャートである。なお、これらのフローチャートは、CMYKの内の1つの色成分についての処理を示す。   20 and 21 are flowcharts of the compression process in the compressed data creation unit 100, FIG. 22 is a flowchart showing an example of the representative value range determination process, and FIGS. 23 and 24 are flowcharts of the decompression process in the data restoration unit 300. Note that these flowcharts show processing for one color component in CMYK.

図20および図21において、まず、ディザパターンDPおよびデコード表DCを読み込む(#101,102)。また、これらディザパターンDPおよびデコード表DCをプリンタ13に送信しておく。2値画像データD1の内の6ライン分を入力し(#104)、その左端から1つの低解像度領域TLの分について、隣接する代表値aを用いて、当該領域において代表値範囲があるか否かを判別する(#105)。代表値範囲がある場合に、代表値範囲内で代表値aを決定し(#106)、代表値差分を算出する(#107)。   20 and 21, first, the dither pattern DP and the decode table DC are read (# 101, 102). Further, the dither pattern DP and the decode table DC are transmitted to the printer 13 in advance. Input 6 lines of the binary image data D1 (# 104), and use the adjacent representative value a for the one low-resolution area TL from the left end to determine whether there is a representative value range in that area. It is determined whether or not (# 105). When there is a representative value range, a representative value a is determined within the representative value range (# 106), and a representative value difference is calculated (# 107).

代表値差分が「0」であれば(#108でイエス)、連続回数を示す変数nを1つ加算する(#109)。変数nが「50」になった場合に(#110でイエス)、代表値差分「0」が50回続いたことを示す属性コード「257」をコード1で符号化して圧縮データD2として出力し(#111)、変数nを「0」に初期化する(#112)。   If the representative value difference is “0” (Yes in # 108), one variable n indicating the number of consecutive times is added (# 109). When the variable n becomes “50” (Yes in # 110), the attribute code “257” indicating that the representative value difference “0” has continued 50 times is encoded with the code 1 and output as the compressed data D2. (# 111), variable n is initialized to “0” (# 112).

ステップ#105でノーの場合、つまり代表値範囲がない場合には、代表値差分「0」をコード1でそれまでの回数分符号化して出力し(#120)、変数nを「0」に初期化する(#121)。そして、他のディザパターンDPの場合に代表値範囲があるか否かをチェックする(#122)。代表値範囲の得られるディザパターンDPがあれば(#122でイエス)、そのディザパターンDPに切り換え(#123)、ディザパターンDPを切り換えたことを示す属性コード「258」をコード1で切り換え回数分符号化して出力し(#124)、代表値aを決定し(#225)、ステップ#107に移行する。   If no in step # 105, that is, if there is no representative value range, the representative value difference “0” is encoded and output by the number of times up to that time with code 1 (# 120), and the variable n is set to “0”. Initialization is performed (# 121). Then, it is checked whether or not there is a representative value range in the case of another dither pattern DP (# 122). If there is a dither pattern DP in which the representative value range can be obtained (Yes in # 122), switching to that dither pattern DP (# 123), the attribute code "258" indicating that the dither pattern DP has been switched is switched by code 1 The partial encoding is performed (# 124), the representative value a is determined (# 225), and the process proceeds to step # 107.

ステップ#108でノーの場合、つまり代表値差分が「0」でなければ(#108でノー)、代表値差分「0」をコード1でそれまでの回数分符号化して出力し(#126)、変数nを「0」に初期化する(#127)。そして、その代表値差分をコード1で符号化して出力し(#128)、ステップ#113に戻る。   If NO in step # 108, that is, if the representative value difference is not "0" (NO in # 108), the representative value difference "0" is encoded with code 1 for the number of times so far and output (# 126). The variable n is initialized to “0” (# 127). The representative value difference is encoded with code 1 and output (# 128), and the process returns to step # 113.

入力した6ラインの右端まで処理が済んでいなければ(#113でノー)、同じ6ラインについて順次右隣の低解像度領域TLの処理を行うために、ステップ#105以降を繰り返す。6ラインについての処理が終わり(#113でイエス)、未処理のラインがあれば(#114でノー)、2値画像データD1の次の6ライン分を入力し(#104)、これを2値画像データD1の全部の処理が終了するまで繰り返す(#114)。   If the processing has not been completed up to the right end of the inputted 6 lines (No in # 113), step # 105 and the subsequent steps are repeated in order to sequentially process the low resolution region TL on the right for the same 6 lines. When the processing for 6 lines is completed (Yes in # 113), if there is an unprocessed line (No in # 114), the next 6 lines of the binary image data D1 are input (# 104). The process is repeated until the entire processing of the value image data D1 is completed (# 114).

ステップ#122でノー、つまり代表値範囲の得られるディザパターンDPがない場合には、低解像度領域TLがいずれのディザパターンDPでも代表値範囲が得られなかったことを示す属性コード「256」をコード1で符号化して出力し(#129)、中解像度領域TMの処理であるステップ#131以降に移行する。   If NO in step # 122, that is, if there is no dither pattern DP from which the representative value range is obtained, the attribute code “256” indicating that the low resolution area TL has not obtained the representative value range in any dither pattern DP is displayed. The code 1 is encoded and output (# 129), and the process proceeds to step # 131 and subsequent steps, which are the processing of the medium resolution area TM.

中解像度領域TMの処理では、低解像度領域TLを4つに区画した1つの中解像度領域TMについて、いずれかのディザパターンDPで代表値範囲が得られるか否かを判別する(#131)。代表値範囲が得られる場合は(#131でイエス)、その中解像度領域TMのドット数を取得してその差分を算出し(#132)、ドット数差分をコード2で符号化して出力する(#133)。これを4回繰り返してステップ#113の低解像度領域TLの処理に戻る。   In the process of the medium resolution area TM, it is determined whether or not a representative value range can be obtained with any dither pattern DP for one medium resolution area TM obtained by dividing the low resolution area TL into four (# 131). When the representative value range is obtained (Yes in # 131), the number of dots in the medium resolution area TM is acquired and the difference is calculated (# 132), and the dot number difference is encoded with code 2 and output ( # 133). This is repeated four times to return to the processing of the low resolution area TL in step # 113.

ステップ#131でノー、つまり中解像度領域TMがいずれのディザパターンDPでも代表値範囲が得られなかった場合には、得られなかったことを表す属性コード「25」をコード2で符号化して出力し(#135)、高解像度領域TSの処理であるステップ#141以降に移行する。   If NO in step # 131, that is, if the representative value range is not obtained for any dither pattern DP in the medium resolution area TM, the attribute code “25” indicating that it was not obtained is encoded with code 2 and output. However, the process proceeds to step # 141 and subsequent steps, which are the processing of the high resolution area TS.

高解像度領域TSの処理では、中解像度領域TMを3つに区画した1つの高解像度領域TSについて、そのドットパターンを数値化し(#141)、その数値をコード3で符号化して出力する(#142)。これを3回繰り返し(#143)、ステップ#134の中解像度領域TMの処理に戻る。   In the processing of the high-resolution area TS, the dot pattern is digitized for one high-resolution area TS obtained by dividing the medium-resolution area TM into three (# 141), and the numerical value is encoded with code 3 and output (#). 142). This is repeated three times (# 143), and the process returns to the process of the medium resolution area TM in step # 134.

図22において、1つの注目領域について、それに隣接する領域の代表値aを取得する(#151)。当該注目領域における仮代表値を設定する(#152)。仮代表値は、2値画像データD1およびディザパターンDPを参照して設定してもよいし、代表値aの取り得る値の範囲である階調値、上の例では0〜255の値を順に設定していくことでもよい。隣接する領域の代表値および仮代表値を用い、補間ルールHRを適用して注目領域の各画素の濃度を求め、仮想階調画像を生成する(#153)。生成した仮想階調画像を、ディザパターンDPを用いて擬似階調化し、再構成画像(上の例では再構成画像データFS)を生成する(#154)。再構成画像と元の擬似階調画像(上の例では2値画像データD1)とを比較し(#155)、それらの一致度合いから再現性が良好であるか否かを判断する(#156)。   In FIG. 22, the representative value a of the area adjacent to one attention area is acquired (# 151). A temporary representative value in the attention area is set (# 152). The temporary representative value may be set with reference to the binary image data D1 and the dither pattern DP, or a gradation value that is a range of values that the representative value a can take, in the above example, a value from 0 to 255. It may be set in order. Using the representative value and the temporary representative value of the adjacent region, the interpolation rule HR is applied to determine the density of each pixel in the region of interest, and a virtual gradation image is generated (# 153). The generated virtual gradation image is converted into pseudo gradation using the dither pattern DP, and a reconstructed image (reconstructed image data FS in the above example) is generated (# 154). The reconstructed image is compared with the original pseudo gradation image (binary image data D1 in the above example) (# 155), and it is determined from the degree of coincidence whether the reproducibility is good (# 156). ).

再現性が良好であるか否かの判断に際しては、例えば、再構成画像のドットの配列パターンと2値画像データD1のドットの配列パターンとが一致しているか、または所定の誤差範囲内に納まっているか、という点を判断する。一致している場合にのみ再現性が良好であると判断してもよい。または、所定の誤差範囲内に納まっているときには再現性が良好であると判断してもよい。所定の誤差範囲としては、例えば、当該注目領域において一致していない画素の総画素数に対する割合、または一致していない画素の個数などを判断のしきい値として用いることが可能である。一致していない画素の総画素数に対する割合のしきい値としては、例えば、写真画像の場合に15〜50%程度、文字画像の場合に5〜15%程度である。   When determining whether or not the reproducibility is good, for example, the dot arrangement pattern of the reconstructed image matches the dot arrangement pattern of the binary image data D1, or falls within a predetermined error range. Judge whether or not. You may judge that reproducibility is favorable only when it corresponds. Alternatively, it may be determined that the reproducibility is good when it is within a predetermined error range. As the predetermined error range, for example, the ratio of the number of pixels that do not match in the region of interest to the total number of pixels or the number of pixels that do not match can be used as a threshold value for determination. The threshold value of the ratio of the mismatched pixels to the total number of pixels is, for example, about 15 to 50% for a photographic image and about 5 to 15% for a character image.

再現性が良好であれば(#156でイエス)、その仮代表値を代表値範囲の中に入れる(#157)。再現性が良好でなければ(#156でノー)、その仮代表値は捨てる。   If the reproducibility is good (Yes in # 156), the temporary representative value is put in the representative value range (# 157). If the reproducibility is not good (No in # 156), the temporary representative value is discarded.

そして、予定した全ての仮代表値についての処理が終われば(#158でイエス)、それまでに得られた代表値範囲を確定する(#159)。その後においては、例えば図20のステップ#106において、代表値範囲の中から1つの代表値aを決定する。なお、図23に示す処理は、代表値範囲を確定するための処理の一例を示したに過ぎないものであり、他の種々の処理方法を適用することが可能である。   When the processing for all scheduled temporary representative values is completed (Yes in # 158), the representative value range obtained so far is determined (# 159). Thereafter, for example, in step # 106 of FIG. 20, one representative value a is determined from the representative value range. Note that the processing shown in FIG. 23 is merely an example of processing for determining the representative value range, and various other processing methods can be applied.

図23および図24において、まず、ディザパターンDPおよびデコード表DCを読み込む(#201,202)。そして、コンピュータ本体11から送信されてきた圧縮データD2を受信し、その先頭から順に復元のための処理を行う。最初はデコード1によって復元する(#203)。   23 and 24, first, the dither pattern DP and the decode table DC are read (# 201, 202). Then, the compressed data D2 transmitted from the computer main body 11 is received, and processing for restoration is performed in order from the head. Initially, it is restored by decode 1 (# 203).

復元によって得られた値dc1が属性コード「258」「256」「257」でない場合には(#204〜206でノー)、値dc1は代表値aの差分であるので、それまでの累計値k1に値dc1を加算し、得られた値を新たな累計値k1とする(#206)。累計値k1が「255」を超えた場合には(#208でイエス)、代表値aの最大値を超えているので、累計値k1から「256」を差し引く(#209)。そして、累計値k1を代表値aとして、所定の補間ルールHRを適用して各画素の濃度値を求め、パターン番号pnで特定されるディザパターンDPを用いてドットパターンを復元する(#210)。そのドットパターンをラインバッファに転送し(#211)、領域番号nbに1を加算する(#212)。なお、領域番号nbは、処理対象の低解像度領域TLの6ライン内における位置を示す番号である。   When the value dc1 obtained by the restoration is not the attribute codes “258”, “256”, and “257” (No in # 204 to 206), the value dc1 is the difference of the representative value a, and thus the cumulative value k1 so far The value dc1 is added to the value, and the obtained value is set as a new cumulative value k1 (# 206). If the cumulative value k1 exceeds “255” (Yes in # 208), since it exceeds the maximum value of the representative value a, “256” is subtracted from the cumulative value k1 (# 209). Then, with the cumulative value k1 as the representative value a, a predetermined interpolation rule HR is applied to determine the density value of each pixel, and the dot pattern is restored using the dither pattern DP specified by the pattern number pn (# 210). . The dot pattern is transferred to the line buffer (# 211), and 1 is added to the area number nb (# 212). The area number nb is a number indicating the position in the 6 lines of the low resolution area TL to be processed.

同じ6ライン分についての展開が終了するまで(#213でノー)、ステップ#203以降を繰り返す。6ライン分についての展開が終了すると(#213でイエス)、領域番号nbを「0」に初期化し(#214)、展開した6ライン分のデータ(2値画像データ)をプリントアウトする(#215)。全ての圧縮データD2についての処理が済むまで繰り返す(#216)。   Step # 203 and subsequent steps are repeated until the development for the same six lines is completed (No in # 213). When the development for 6 lines is completed (Yes in # 213), the area number nb is initialized to "0" (# 214), and the developed data for 6 lines (binary image data) is printed out (# 215). The process is repeated until all the compressed data D2 is processed (# 216).

ステップ#204でイエス、つまり復元によって得られた値dc1が「258」である場合には、パターン番号pnに「1」を加算する(#221)。パターン番号pnが「3」であった場合は(#222でイエス)、パターン番号pnから「3」を差し引く。つまり、パターン番号pnは、「0」「1」「2」のいずれかの値となり、これによって3種類のディザパターンDPのいずれかが特定される。   If yes in step # 204, that is, if the value dc1 obtained by restoration is “258”, “1” is added to the pattern number pn (# 221). If the pattern number pn is “3” (Yes in # 222), “3” is subtracted from the pattern number pn. That is, the pattern number pn is any one of “0”, “1”, and “2”, and this specifies one of the three types of dither patterns DP.

ステップ#206でイエス、つまり値dc1が「257」である場合には、累計値k1を代表値aとして、補間ルールHRを適用して各画素の濃度値を求め、パターン番号pnで特定されるディザパターンDPを用いてドットパターンを復元する(#231)。そのドットパターンをラインバッファに転送し(#232)、領域番号nbに1を加算する(#233)。これを50回繰り返す(#234)。これによって、差分「0」が50回続いたときの代表値aに基づいて50個の低解像度領域TLの2値画像データが再現される。なお、この処理中においてラインの右端まできたときは、一旦処理を中断し、ステップ#214以降の処理を行い、新たに次のラインの先頭からドットパターンを書き込むようにする。   If YES in step # 206, that is, if the value dc1 is “257”, the density value of each pixel is obtained by applying the interpolation rule HR using the cumulative value k1 as the representative value a, and is specified by the pattern number pn. The dot pattern is restored using the dither pattern DP (# 231). The dot pattern is transferred to the line buffer (# 232), and 1 is added to the area number nb (# 233). This is repeated 50 times (# 234). Accordingly, the binary image data of 50 low resolution areas TL are reproduced based on the representative value a when the difference “0” continues 50 times. When the right end of the line is reached during this process, the process is temporarily interrupted, the process from step # 214 is performed, and a new dot pattern is written from the beginning of the next line.

ステップ#205でイエス、つまり値dc1が「256」である場合には、中解像度領域TMの処理であるステップ#251に移行する。ステップ#251において、データをデコード2によって復元する。デコード2によって得られた値dc2が「25」でなければ(#252でノー)、値dc2はドット数の差分であるので、それまでの累計値k2に値dc2を加算し、得られた値を新たな累計値k2とする(#253)。累計値k2が「24」を超えた場合には(#254でイエス)、ドット数の最大値を超えているので、累計値k2から「25」を差し引く(#255)。そして、累計値k2をドット数として、パターン番号pnで特定されるディザパターンDPを用いてドットパターンを再現する(#256)。これを4回繰り返す(#257)。4回分のドットパターンをラインバッファに転送し(#258)、領域番号nbに1を加算する(#259)。   If YES in step # 205, that is, if the value dc1 is "256", the process proceeds to step # 251 which is the process for the medium resolution area TM. In step # 251, the data is restored by the decode 2. If the value dc2 obtained by decoding 2 is not “25” (No in # 252), the value dc2 is the difference in the number of dots, so the value dc2 is added to the cumulative value k2 so far, and the obtained value Is set as a new accumulated value k2 (# 253). If the cumulative value k2 exceeds “24” (Yes in # 254), the maximum value of the number of dots is exceeded, so “25” is subtracted from the cumulative value k2 (# 255). Then, using the accumulated value k2 as the number of dots, the dot pattern is reproduced using the dither pattern DP specified by the pattern number pn (# 256). This is repeated four times (# 257). The dot pattern for four times is transferred to the line buffer (# 258), and 1 is added to the area number nb (# 259).

ステップ#252でイエス、つまり値dc2が「25」である場合には、高解像度領域TSの処理であるステップ#261に移行する。ステップ#261において、データをデコード3によって復元する(#261)。復元された値から、高解像度領域TSの8ドットのパターンを再現する(#262)。これを3回繰り返す(#263)。   If YES in step # 252, that is, if the value dc2 is "25", the process proceeds to step # 261, which is processing of the high resolution area TS. In step # 261, the data is restored by decoding 3 (# 261). From the restored value, an 8-dot pattern of the high-resolution area TS is reproduced (# 262). This is repeated three times (# 263).

上に述べたように、圧縮処理に際して、2値画像データD1をディザパターン情報成分と画像情報成分とに分離する。そして、画像情報成分のみを取り出し、ハフマン法による符号化の処理を行って圧縮データD2とする。圧縮データD2にはディザパターン情報成分を含めないので、高い圧縮率と高速処理を実現することができる。   As described above, during the compression process, the binary image data D1 is separated into a dither pattern information component and an image information component. Then, only the image information component is extracted and subjected to encoding processing by the Huffman method to obtain compressed data D2. Since the dither pattern information component is not included in the compressed data D2, a high compression rate and high speed processing can be realized.

また、高解像度領域TSの処理においては、8画素の画像データを1つの数値で読み替えるので、アドレス指示が速い。これによっても全体の処理時間の短縮が図られる。   Further, in the processing of the high resolution region TS, since the image data of 8 pixels is read with one numerical value, the address instruction is fast. This also shortens the overall processing time.

プリンタ13において、圧縮データD2の復元のために用いるASICのコストは、オンチップメモリーの作業領域の大きさによって大きく左右される。データの展開処理を行うための作業領域としては、読み込んだディザパターンDPおよびデコード表DCの格納領域、処理対象領域のデータの格納領域が必要である。これらのデータ量は、例えば、ディザパターンDPが数百バイト〜数Kバイト程度、デコード表DCが2Kバイト程度であり、その他のバッファなどを含めても全体で3〜4Kバイト程度あれば十分である。したがって、3〜4Kバイト程度の小規模なASICをプリンタ13に備えることによって、圧縮データD2の復元処理を高速で行うことができる。また、デコード表DCをROMに格納することにより、さらに容量を小さくすることができる。このように、プリンタ13において、小規模なハードウェアで圧縮データD2を高速に展開することができる。これにより、安価なプリンタ13を使用しつつ、全体の処理を短時間で行うことが可能となる。   In the printer 13, the cost of the ASIC used for restoring the compressed data D2 is greatly influenced by the size of the work area of the on-chip memory. As a work area for performing the data expansion process, a storage area for the read dither pattern DP and decode table DC and a data storage area for the processing target area are required. For example, the dither pattern DP is about several hundred bytes to several kilobytes, the decoding table DC is about 2 kilobytes, and the total amount of data is about 3 to 4 kilobytes including other buffers. is there. Therefore, by providing the printer 13 with a small ASIC of about 3 to 4 Kbytes, the decompression process of the compressed data D2 can be performed at high speed. Further, the capacity can be further reduced by storing the decode table DC in the ROM. In this manner, the printer 13 can expand the compressed data D2 at high speed with small hardware. Thus, the entire process can be performed in a short time while using an inexpensive printer 13.

上に述べた実施形態において、図3に示す低解像度領域区画部101は、2値画像データD1を低解像度領域TLに区画するものであるが、その区画の仕方については、種々の方法を採用することが可能である。つまり、区画は仮想的なものでもよいので、2値画像データD1を領域ごとに実際に分割する必要はない。例えば、低解像度比較部102が比較すべき位置を指し示すためのアドレス指定を行うことでもよい。図3に示す圧縮データ作成部100の構成は一例であり、種々の構成によって上に述べた機能を実現することが可能である。   In the embodiment described above, the low-resolution area dividing unit 101 shown in FIG. 3 divides the binary image data D1 into the low-resolution area TL. Various methods are used for the dividing method. Is possible. That is, since the partition may be virtual, it is not necessary to actually divide the binary image data D1 for each region. For example, the low resolution comparison unit 102 may specify an address for indicating a position to be compared. The configuration of the compressed data creation unit 100 shown in FIG. 3 is an example, and the functions described above can be realized by various configurations.

上に述べた実施形態においては、コンピュータ本体11に擬似階調化部170が設けられ、ここで画像データFDの2値化処理を行ったが、コンピュータ本体11の内部で2値化処理を行うことなく、外部から2値画像データD1を入力するようにしてもよい。その場合に、2値化処理に用いられたディザパターンDPなどの情報を取得しておけばよい。   In the embodiment described above, the computer main body 11 is provided with the pseudo gradation unit 170, and the binarization processing of the image data FD is performed here, but the binarization processing is performed inside the computer main body 11. Alternatively, the binary image data D1 may be input from the outside. In this case, information such as the dither pattern DP used for the binarization process may be acquired.

上に述べた実施形態において、2値画像データD1は、それを構成する各画素にドットを打つか打たないかをフラグのあるなしで表現することが可能である。濃度の高い画素に対してドットを打つようにしてもよいし、濃度の低い画素に対してドットを打つようにしてもよい。
〔第2〕
4値の画像データを圧縮する場合についての実施形態
次に、擬似階調画像が多値である4値の画像データである場合について説明する。この場合においても2値の画像データを圧縮する場合と基本的には同じである。したがって、第1での説明および図面は、第2において対してもほぼ同様に適用することができ、多くの部分について、第1での説明における「2値」を第2では「4値」に読み替えることによって適用できる。ここでは主な相違点についてのみ説明する。
In the above-described embodiment, the binary image data D1 can express whether or not a dot is applied to each pixel constituting the image without a flag. Dots may be applied to pixels with high density, or dots may be applied to pixels with low density.
[Second]
Embodiment for Compressing 4-Level Image Data Next, a case where the pseudo gradation image is multi-level 4-level image data will be described. This case is basically the same as the case of compressing binary image data. Therefore, the description and drawings in the first can be applied to the second in substantially the same manner, and for many parts, the “two values” in the first description are changed to “four values” in the second. It can be applied by replacing. Only the main differences will be described here.

図25は区画された低解像度領域TLを説明するための図、図26は低解像度領域TLとディザパターンDPの例を示す図、図27は4値の画像データ(4値画像データ)D5 を説明するための図、図28は2値の画像データ(2値画像データ)D1を説明するための図である。
〔4値画像データの説明〕
図25の例では、4値画像データD5の全体の領域が、左上から順に、低解像度領域TL1、TL2、TL3、…というようにTLmまで区画されている。図26において、1つの低解像度領域TLは、48個(6×8個)の画素TPからなる矩形の領域である。
FIG. 25 is a diagram for explaining the partitioned low-resolution area TL, FIG. 26 is a diagram showing an example of the low-resolution area TL and the dither pattern DP, and FIG. 27 shows four-value image data (four-value image data) D5. FIG. 28 is a diagram for explaining binary image data (binary image data) D1.
[Explanation of quaternary image data]
In the example of FIG. 25, the entire area of the quaternary image data D5 is partitioned from the upper left to TLm, such as low resolution areas TL1, TL2, TL3,. In FIG. 26, one low-resolution area TL is a rectangular area composed of 48 (6 × 8) pixels TP.

図26(a)に示す低解像度領域TLにおいて、黒の画素が、ドットが打たれた画素である。ドットの大きさは、画素値に応じて3段階に変化する。つまり、ドットが打たれていない状態を「0」とすると、1画素における約3分の1の領域にドットが打たれた状態を「1」、約3分の2の領域にドットが打たれた状態を「2」、1画素の全領域にドットが打たれた状態を「3」と表すことができる。   In the low resolution region TL shown in FIG. 26A, the black pixel is a pixel on which a dot is formed. The size of the dot changes in three steps according to the pixel value. In other words, if the state where dots are not applied is “0”, the state where dots are applied to about one third of the area of one pixel is “1”, and dots are applied to about two thirds of the area. The state in which the dots are applied to the entire area of one pixel can be represented as “3”.

図27に示すように、各状態「0」「1」「2」「3」に対応して、例えばプリンタのレーザの発光時間を制御(パルス幅制御)することによって、画素の濃度を4段階に変化させることができる。このように、これらの状態「0」「1」「2」「3」は、階調値に対応している。   As shown in FIG. 27, in correspondence with each state “0”, “1”, “2”, “3”, for example, by controlling the laser light emission time (pulse width control) of the printer, the pixel density is set in four levels. Can be changed. Thus, these states “0”, “1”, “2”, and “3” correspond to the gradation values.

すなわち、状態「0」では、レーザが発光せず、その画素は「白」となる。状態「1」では、レーザ光は画素幅の約3分の1の時間だけ発光し、画素の約3分の1の領域が「黒」となる。同様に、状態「2」または「3」では、それぞれ、レーザ光は画素幅の約3分の2または約3分の3の時間だけ発光し、画素の約3分の2の領域または全体が「黒」となる。つまり、状態の値に対応して4階調の濃度が得られる。4階調を表す4つの状態は、2ビットで表すことができる。したがって、8ビットによって、4階調の画素を4個表すことができる。   That is, in the state “0”, the laser does not emit light, and the pixel is “white”. In the state “1”, the laser light is emitted for about one third of the pixel width, and the region of about one third of the pixel is “black”. Similarly, in state “2” or “3”, the laser light is emitted for a period of about two-thirds or about three-thirds of the pixel width, respectively, and about two-thirds of the pixel area or the entire region is exposed. “Black”. That is, a density of 4 gradations is obtained corresponding to the state value. Four states representing four gradations can be represented by 2 bits. Therefore, four pixels of four gradations can be represented by 8 bits.

なお、レーザの発光時間、それによって打たれるドットの大きさ、および、それをマクロ的に見た濃度について、これらの相互関係は複雑であり、上に述べた例は説明のための一例にすぎない。   The relationship between the laser emission time, the size of the dots hit by the laser, and the density at which it is viewed macroscopically is complex, and the above example is an example for explanation. Only.

ディザパターンDPのしきい値は、0〜255の範囲の値であり、各画素に対して3つのしきい値が設定されている。各画素において、3つのしきい値に対して、低い順に、「1」「2」「3」のインデックス(番号)がそれぞれ与えられている。インデックスが「1」である最も低いしきい値よりも小さい濃度の画像データFDは、状態「0」となる。インデックス「1」のしきい値とインデックス「2」のしきい値との間の濃度の画像データFDは、状態「1」となる。インデックス「2」のしきい値とインデックス「3」のしきい値との間の濃度の画像データFDは、状態「2」となる。インデックスが「3」である最も高いしきい値よりも大きい濃度の画像データFDは、状態「3」となる。通常、画素が異なれば、同じインデックスに対するしきい値も異なる。   The threshold value of the dither pattern DP is a value in the range of 0 to 255, and three threshold values are set for each pixel. In each pixel, indexes (numbers) “1”, “2”, and “3” are given to the three threshold values in ascending order. The image data FD having a density smaller than the lowest threshold value with the index “1” is in the state “0”. The image data FD having a density between the threshold value of the index “1” and the threshold value of the index “2” is in the state “1”. Image data FD having a density between the threshold value of the index “2” and the threshold value of the index “3” is in the state “2”. The image data FD having a density larger than the highest threshold value whose index is “3” is in the state “3”. Usually, different pixels have different thresholds for the same index.

なお、図27において、仮想階調画像データLAがほぼ水平な直線で示されている。この仮想階調画像データLAが、擬似階調画像を再構成する際に原画像データFDに代えて用いられるのであり、代表値aを用いて再現されるものである。   In FIG. 27, the virtual gradation image data LA is indicated by a substantially horizontal straight line. The virtual gradation image data LA is used in place of the original image data FD when reconstructing the pseudo gradation image, and is reproduced using the representative value a.

なお、先願方法においては、この仮想階調画像データLAは、当該領域における代表値aそれ自体である。   In the prior application method, the virtual gradation image data LA is the representative value a itself in the area.

ここで、比較のために2値画像データについても説明する。   Here, binary image data is also described for comparison.

図28に示すように、2値画像データでは、各状態「0」「1」に対応して、例えばプリンタのレーザをオンオフ制御することによって、画素の濃度を白黒2段階に変化させることができる。   As shown in FIG. 28, in the binary image data, the pixel density can be changed in two stages of black and white by controlling on / off the laser of the printer, for example, corresponding to each state “0” “1”. .

すなわち、状態「0」では、レーザが発光せず、その画素は「白」となる。状態「1」では、レーザ光が発光し、その画素は「黒」となる。つまり、状態の値に対応して2階調の濃度が得られる。   That is, in the state “0”, the laser does not emit light, and the pixel is “white”. In the state “1”, laser light is emitted, and the pixel is “black”. That is, a density of two gradations is obtained corresponding to the state value.

図28においても、図27の場合と同様な仮想階調画像データLAがほぼ水平な直線で示されている。
〔代表値aの求め方〕
図29は代表値aの求め方を説明するための図である。なお、第1の場合と同様に、ここでも低解像度領域TLが1次元の領域であるとする。
Also in FIG. 28, the virtual gradation image data LA similar to the case of FIG. 27 is shown by a substantially horizontal straight line.
[How to find representative value a]
FIG. 29 is a diagram for explaining how to obtain the representative value a. As in the first case, it is assumed here that the low resolution region TL is a one-dimensional region.

代表値aは、多値の場合でも2値の場合とほとんど同じ処理で求めることができる。但し、多値の場合には、擬似階調画像の画像データによってそれぞれの画素TPについて上限および下限がある点が異なる。   The representative value a can be obtained by almost the same processing as in the case of binary even in the case of multivalue. However, in the case of multi-value, there is a difference in that there is an upper limit and a lower limit for each pixel TP depending on the image data of the pseudo gradation image.

図29において、4値画像データD5について、4画素TPからなる1次元の低解像度領域TL1が示されている。図におけるそれぞれの画素TPの階調値は、左の画素TPから順に、「1」「2」「3」「3」である。この4値画像データD5は、図に示す画像データFDを、同じく図に示すディザパターンDPを用いて4値化処理を行うことにより得られたものである。つまり、各インデックスに対して、画像データFDがディザパターンDPのしきい値以下であれば「白」、しきい値を越えれば「黒」となり、黒の個数によってその画素TPの階調値が決まる。   In FIG. 29, a one-dimensional low-resolution region TL1 composed of four pixels TP is shown for the four-value image data D5. The gradation values of the respective pixels TP in the figure are “1”, “2”, “3”, and “3” in order from the left pixel TP. This quaternary image data D5 is obtained by subjecting the image data FD shown in the figure to a quaternary process using the dither pattern DP shown in the figure. That is, for each index, if the image data FD is less than or equal to the threshold value of the dither pattern DP, “white” is obtained, and if the image data FD exceeds the threshold value, “black” is obtained. Determined.

まず、最初の代表値AP0を決める。最初の代表値AP0は、4値画像データD5の領域外であるので、どのような値でもとり得るが、2値の場合と同様に適当な値とすればよい。   First, the first representative value AP0 is determined. Since the first representative value AP0 is outside the region of the quaternary image data D5, any value can be taken, but it may be an appropriate value as in the case of the binary value.

そして、最初のブロックである低解像度領域TL1を注目領域とし、最初の代表値AP0から注目領域の各白インデックスのしきい値に向かって直線LG1、2、3、4を引く。そのうち最も低い位置にある直線LG4を選択し、直線LG4を延長して当該注目領域の最後の画素TPの位置との交点を上限位置とし、この上限位置における濃度値を注目領域における代表値上限APmaxとする。   Then, the low resolution region TL1, which is the first block, is set as the attention region, and straight lines LG1, 2, 3, 4 are drawn from the first representative value AP0 toward the threshold value of each white index of the attention region. The straight line LG4 at the lowest position is selected, the straight line LG4 is extended, and the intersection with the position of the last pixel TP of the target area is set as the upper limit position, and the density value at this upper limit position is set as the representative value upper limit APmax in the target area. And

白インデックスと同様の処理を黒インデックスについても行う。すなわち、最初の代表値AP0から、注目領域の各黒インデックスのしきい値に向かって直線LG5、6を引く。そのうち最も高い位置にある直線LG5を選択し、直線LG5を延長して当該注目領域の最後の画素TPの位置との交点を下限位置とし、この下限位置における濃度値を注目領域における代表値下限APminとする。   The same processing as for the white index is performed for the black index. That is, straight lines LG5 and LG6 are drawn from the first representative value AP0 toward the threshold value of each black index in the region of interest. The straight line LG5 at the highest position is selected, the straight line LG5 is extended, and the intersection with the position of the last pixel TP of the target area is set as the lower limit position. The density value at this lower limit position is set as the representative value lower limit APmin in the target area. And

このようにして求めた代表値上限APmaxが代表値下限APminより大きいとき、つまり上の(1)式が成り立つとき、代表値上限APmaxと代表値下限APminとの間を代表値範囲とする。そして、代表値範囲内の値を、当該注目領域の代表値aとして決定する。
〔低解像度領域、中解像度領域、高解像度領域〕
図30は低解像度領域TL、中解像度領域TM、および高解像度領域TSを示す図である。
When the representative value upper limit APmax thus obtained is larger than the representative value lower limit APmin, that is, when the above equation (1) is satisfied, the range between the representative value upper limit APmax and the representative value lower limit APmin is set as the representative value range. Then, a value within the representative value range is determined as the representative value a of the attention area.
[Low resolution area, medium resolution area, high resolution area]
FIG. 30 is a diagram showing a low resolution area TL, a medium resolution area TM, and a high resolution area TS.

図30に示すように、低解像度領域TLは6×8画素の領域である。低解像度領域TLは、中解像度領域区画部104によって、3×4画素の4つの中解像度領域TMに区画される。中解像度領域TMは、必要に応じて、さらに4画素の3つの高解像度領域TSに区画される。
〔中解像度領域の処理〕
図31は画像におけるドット数の差分の出現頻度の分布を表す図である。
As shown in FIG. 30, the low resolution area TL is an area of 6 × 8 pixels. The low resolution area TL is divided into four medium resolution areas TM of 3 × 4 pixels by the medium resolution area dividing section 104. The medium resolution area TM is further divided into three high resolution areas TS of 4 pixels as necessary.
[Medium resolution area processing]
FIG. 31 is a diagram showing the distribution of the appearance frequency of the difference in the number of dots in an image.

中解像度代表値算出部106では、中解像度領域TMにおいて、上に述べたと同様な処理によって代表値aを求める。   The medium resolution representative value calculation unit 106 obtains the representative value a in the medium resolution region TM by the same process as described above.

そして、得られた代表値aに基づいて、隣合う中解像度領域TMの間の代表値の差分が、低解像度領域TLの場合と同様にして算出される。ここでの差分は、上に述べた循環整数を用いて、0〜255の範囲となる。   Then, based on the obtained representative value a, the difference between the representative values between the adjacent medium resolution areas TM is calculated in the same manner as in the low resolution area TL. The difference here is in the range of 0 to 255 using the cyclic integer described above.

図31に示すように、差分が「0」〜「30」程度および「200」〜「255」程度の範囲で出現頻度が高い。差分である0〜255の後に、「256」の値についての出現頻度が示されている。これの趣旨は低解像度領域TLの場合の属性コードと同様であり、「256」は、ある中解像度領域TMで代表値aを決定できないことを表す属性コードである。その場合に、コード2で「256」を出力し、領域をさらに高解像度領域TSに区画する。   As shown in FIG. 31, the appearance frequency is high in the range where the difference is about “0” to “30” and “200” to “255”. After the difference of 0 to 255, the appearance frequency for the value “256” is shown. The meaning of this is the same as the attribute code in the case of the low resolution area TL, and “256” is an attribute code indicating that the representative value a cannot be determined in a certain medium resolution area TM. In this case, “256” is output with the code 2, and the region is further divided into high-resolution regions TS.

なお、第1に示す2値の場合には、中解像度領域TMは24画素であり、最大で24個のドットであったので、領域のドットの数を数えて代表値とした。しかし、第2に示す4値の場合では、共通化と処理の速さとを優先させ、上に述べたように濃度値を代表値とした。
〔フローチャートによる説明〕
次に、第2における処理について、フローチャートを参照して説明する。
In the case of the binary value shown in the first example, the medium resolution area TM has 24 pixels, and the maximum number of dots is 24. Therefore, the number of dots in the area is counted as a representative value. However, in the case of the four values shown in the second example, priority is given to the sharing and the processing speed, and the density value is used as the representative value as described above.
[Explanation by flowchart]
Next, the second process will be described with reference to a flowchart.

図32はコンピュータ本体11における圧縮処理の大まかな流れを示すフローチャートである。なお、図32は第1の図18に対応し、ステップ#21Bのみが異なる。   FIG. 32 is a flowchart showing a rough flow of compression processing in the computer main body 11. Note that FIG. 32 corresponds to FIG. 18 and only step # 21B is different.

つまり、図32において、1つの中解像度領域TMについて代表値範囲がある場合には(#20でイエス)、ステップ#15と同様にして代表値aを求める(#21B)。そして、その差分をとり(#22)、符号化する(#23)。   That is, in FIG. 32, when there is a representative value range for one medium resolution area TM (Yes in # 20), the representative value a is obtained in the same manner as in Step # 15 (# 21B). Then, the difference is taken (# 22) and encoded (# 23).

図33および図34は圧縮データ作成部100における圧縮処理のフローチャート、図35および図36はデータ復元部300における復元処理のフローチャートである。なお、図33〜36は、第1の図20、21、23、24に対応する。   33 and 34 are flowcharts of the compression processing in the compressed data creation unit 100, and FIGS. 35 and 36 are flowcharts of the decompression processing in the data restoration unit 300. 33 to 36 correspond to the first FIGS. 20, 21, 23, and 24.

図34において、いずれかのディザパターンDPで代表値範囲が得られる場合に(#131でイエス)、その中解像度領域TMにおいて代表値aを取得してその差分を算出し(#132B)、代表値差分をコード2で符号化して出力する(#133B)。これを4回繰り返し、図33のステップ#113の低解像度領域TLの処理に戻る。   In FIG. 34, when the representative value range is obtained with any dither pattern DP (Yes in # 131), the representative value a is obtained in the medium resolution region TM and the difference is calculated (# 132B). The value difference is encoded with code 2 and output (# 133B). This is repeated four times, and the process returns to the processing of the low resolution region TL in step # 113 in FIG.

ステップ#131でノー、つまり中解像度領域TMがいずれのディザパターンDPでも代表値範囲が得られなかった場合には、得られなかったことを表す属性コード「256」をコード2で符号化して出力し(#135B)、高解像度領域TSの処理であるステップ#141以降に移行する。   If NO in step # 131, that is, if no representative value range is obtained for any dither pattern DP in the medium resolution area TM, the attribute code “256” indicating that it was not obtained is encoded with code 2 and output. (# 135B), the process proceeds to step # 141 and subsequent steps, which are the processing of the high resolution area TS.

図36において、ステップ#252Bにおいて、デコード2によって得られた値dc2が「256」でなければ、値dc2は代表値の差分であるので、それまでの累計値k2に値dc2を加算し、得られた値を新たな累計値k2とする(#253)。累計値k2が「255」を超えた場合には(#254Bでイエス)、代表値の最大値を超えているので、累計値k2から「256」を差し引く(#255B)。そして、累計値k2を代表値として、パターン番号pnで特定されるディザパターンDPを用いてドットパターンを再現する(#256)。   In FIG. 36, if the value dc2 obtained by decoding 2 is not “256” in step # 252B, the value dc2 is the difference between the representative values, so the value dc2 is added to the cumulative value k2 obtained so far. The obtained value is set as a new cumulative value k2 (# 253). If the cumulative value k2 exceeds “255” (Yes in # 254B), the maximum value of the representative value is exceeded, so “256” is subtracted from the cumulative value k2 (# 255B). Then, using the accumulated value k2 as a representative value, the dot pattern is reproduced using the dither pattern DP specified by the pattern number pn (# 256).

ステップ#252Bでイエス、つまり値dc2が「256」である場合には、高解像度領域TSの処理であるステップ#261に移行する。   If YES in step # 252B, that is, if the value dc2 is "256", the process proceeds to step # 261, which is processing of the high resolution area TS.

なお、復元処理において、圧縮データD2のヘッダー部に添付されたディザパターンDPを用いてディザ処理が行われる。   In the decompression process, the dither process is performed using the dither pattern DP attached to the header portion of the compressed data D2.

上の実施形態において、擬似階調化として2値化および4値化を行ったが、3値化、8値化、16値化など、種々の値の多値化を行うことも可能である。各領域における代表値位置APは、上に述べた以外の位置、例えば領域の中央、領域の他の頂点などとすることも可能である。   In the above embodiment, binarization and quaternarization have been performed as pseudo-gradation, but various values such as ternarization, 8-level conversion, and 16-level conversion can also be performed. . The representative value position AP in each region may be a position other than those described above, for example, the center of the region, another vertex of the region, or the like.

その他、コンピュータ本体11、プリンタ13、およびプリントシステム1の全体または各部の構成、機能、個数、ビット数、処理の内容または順序などは、本発明の趣旨に沿って適宜変更することができる。   In addition, the configuration, function, number, number of bits, processing contents or order of the entire computer main body 11, printer 13, and printing system 1 or each part can be appropriately changed in accordance with the spirit of the present invention.

本発明は、ラスタプリンタやGDIプリンタなどを含んだプリントシステムに利用され、擬似階調化された画像データの圧縮方法として利用可能である。   The present invention is used in a printing system including a raster printer, a GDI printer, and the like, and can be used as a method for compressing pseudo gradation image data.

本発明に係るプリントシステムの全体構成を示す図である。1 is a diagram illustrating an overall configuration of a print system according to the present invention. コンピュータ本体の機能的な構成を示すブロック図である。It is a block diagram which shows the functional structure of a computer main body. コンピュータ本体の圧縮データ作成部を機能的に示すブロック図である。It is a block diagram which shows the compressed data production part of a computer main body functionally. プリンタの機能的な構成を示すブロック図である。FIG. 2 is a block diagram illustrating a functional configuration of a printer. 区画された低解像度領域を説明するための図である。It is a figure for demonstrating the divided low resolution area | region. 低解像度領域とディザパターンの例を示す図である。It is a figure which shows the example of a low-resolution area | region and a dither pattern. サイズの異なる低解像度領域とディザパターンの例を示す図である。It is a figure which shows the example of the low resolution area | region and dither pattern from which size differs. 各低解像度領域における代表値の位置を示す図である。It is a figure which shows the position of the representative value in each low-resolution area | region. 低解像度領域における補間ルールの例を説明するための図である。It is a figure for demonstrating the example of the interpolation rule in a low-resolution area | region. 代表値の求め方を説明するための図である。It is a figure for demonstrating how to obtain | require a representative value. 循環整数の例を示す図である。It is a figure which shows the example of a cyclic integer. 画像における代表値の差分の出現頻度の分布を表す図である。It is a figure showing distribution of the appearance frequency of the difference of the representative value in an image. 低解像度領域および中解像度領域を示す図である。It is a figure which shows a low-resolution area | region and a medium-resolution area | region. ドットパターンの数値化を説明するための図である。It is a figure for demonstrating the digitization of a dot pattern. 各ドットパターンの出現頻度の分布を表す図である。It is a figure showing distribution of the appearance frequency of each dot pattern. ハフマンコード表の例を示す図である。It is a figure which shows the example of a Huffman code table. デコード表の例を示す図である。It is a figure which shows the example of a decoding table. 圧縮処理の大まかな流れを示すフローチャートである。It is a flowchart which shows the rough flow of a compression process. 復元処理の大まかな流れを示すフローチャートである。It is a flowchart which shows the rough flow of a decompression | restoration process. 圧縮データ作成部における圧縮処理のフローチャートである。It is a flowchart of the compression process in a compression data creation part. 圧縮データ作成部における圧縮処理のフローチャートである。It is a flowchart of the compression process in a compression data creation part. 代表値範囲の確定処理の例を示すフローチャートである。It is a flowchart which shows the example of the determination process of a representative value range. データ復元部における復元処理のフローチャートである。It is a flowchart of the decompression | restoration process in a data decompression | restoration part. データ復元部における復元処理のフローチャートである。It is a flowchart of the decompression | restoration process in a data decompression | restoration part. 区画された低解像度領域を説明するための図である。It is a figure for demonstrating the divided low resolution area | region. 低解像度領域とディザパターンの例を示す図である。It is a figure which shows the example of a low-resolution area | region and a dither pattern. 4値の画像データを説明するための図である。It is a figure for demonstrating 4 value image data. 2値の画像データを説明するための図である。It is a figure for demonstrating binary image data. 代表値の求め方を説明するための図である。It is a figure for demonstrating how to obtain | require a representative value. 低解像度領域および中解像度領域を示す図である。It is a figure which shows a low resolution area | region and a medium resolution area | region. 画像におけるドット数の差分の出現頻度の分布を表す図である。It is a figure showing distribution of the appearance frequency of the difference of the number of dots in an image. 圧縮処理の大まかな流れを示すフローチャートである。It is a flowchart which shows the rough flow of a compression process. 圧縮データ作成部における圧縮処理のフローチャートである。It is a flowchart of the compression process in a compression data creation part. 圧縮データ作成部における圧縮処理のフローチャートである。It is a flowchart of the compression process in a compression data creation part. データ復元部における復元処理のフローチャートである。It is a flowchart of the decompression | restoration process in a data decompression | restoration part. データ復元部における復元処理のフローチャートである。It is a flowchart of the restoration process in a data restoration part.

符号の説明Explanation of symbols

1 プリントシステム
11 コンピュータ本体(画像データの圧縮装置)
13 プリンタ
100 圧縮データ作成部
101 低解像度領域区画部(第1の手段)
103 低解像度代表値算出部(第2の手段)
104 中解像度領域区画部(小領域に区画する手段)
106 中解像度代表値算出部
107 ドットパターン抽出部
108 符号化部(第3の手段)
109 データ送信部
300 データ復元部
D1 2値画像データ(擬似階調画像のデータ、画像データ)
D2 圧縮データ
D5 4値画像データ(擬似階調画像のデータ、画像データ)
DP ディザパターン
TL 低解像度領域(所定の領域)
TM 中解像度領域(所定の領域)
TS 高解像度領域(所定の領域)
a 代表値
AP 代表値
HR 補間ルール
AL 直線(擬似階調画像)
PA 三角形(平面)
FS 再構成画像データ(擬似階調画像、擬似階調化を行って得られる画像データ)
1 Print System 11 Computer Body (Image Data Compression Device)
13 Printer 100 Compressed data creation unit 101 Low resolution area partition unit (first means)
103 Low resolution representative value calculation unit (second means)
104 Medium resolution area section (means to divide into small areas)
106 Medium Resolution Representative Value Calculation Unit 107 Dot Pattern Extraction Unit 108 Encoding Unit (Third Means)
109 Data transmission unit 300 Data restoration unit D1 Binary image data (pseudo gradation image data, image data)
D2 Compressed data D5 Four-value image data (pseudo gradation image data, image data)
DP dither pattern TL Low resolution area (predetermined area)
TM Medium resolution area (predetermined area)
TS High resolution area (predetermined area)
a Representative value AP Representative value HR Interpolation rule AL Straight line (pseudo gradation image)
PA triangle (plane)
FS reconstruction image data (pseudo gradation image, image data obtained by performing pseudo gradation process)

Claims (11)

ディザパターンを用いて擬似階調化された画像である擬似階調画像のデータを圧縮する方法であって、
前記擬似階調画像を所定の領域ごとに区画する第1のステップと、
前記各領域の代表値を決定する第2のステップと、
決定した代表値を用いて圧縮データを作成する第3のステップとを有してなり、
前記第2のステップにおいて、
前記領域のうちの1つの領域である注目領域について、当該注目領域の代表値および当該注目領域に隣接する1つまたは複数の領域の代表値を用い予め定められた補間ルールにしたがって当該注目領域における各画素の濃度を補間して求めさらに前記ディザパターンを用いて擬似階調化を行った場合に当該注目領域における前記擬似階調画像が再現されるような、そのような代表値を求めて当該注目領域の代表値として決定する、
ことを特徴とする画像データの圧縮方法。
A method of compressing pseudo-gradation image data, which is a pseudo-gradation image using a dither pattern,
A first step of dividing the pseudo gradation image into predetermined regions;
A second step of determining a representative value for each region;
And a third step of creating compressed data using the determined representative value,
In the second step,
For a region of interest that is one of the regions, a representative value of the region of interest and a representative value of one or a plurality of regions adjacent to the region of interest are used according to a predetermined interpolation rule. Such a representative value is obtained by interpolating the density of each pixel and further reproducing the pseudo gradation image in the region of interest when pseudo gradation is performed using the dither pattern. Determine as the representative value of the region of interest,
A method for compressing image data.
ディザパターンを用いて擬似階調化された画像である擬似階調画像のデータを圧縮する方法であって、
前記擬似階調画像を所定の領域ごとに区画する第1のステップと、
前記各領域の代表値を決定する第2のステップと、
決定した代表値を用いて圧縮データを作成する第3のステップとを有してなり、
前記第2のステップにおいて、
前記領域のうちの1つの領域である注目領域について、当該注目領域の代表値および当該注目領域に隣接する1つまたは複数の領域の代表値を用い予め定められた補間ルールにしたがって当該注目領域における各画素の濃度を補間して求めさらに前記ディザパターンを用いて擬似階調化を行って得られる画像データのドットの配列パターンと当該注目領域内の画像データのドットの配列パターンとが所定の誤差範囲内で一致するような、そのような代表値を求めて当該注目領域の代表値として決定する、
ことを特徴とする画像データの圧縮方法。
A method of compressing pseudo-gradation image data, which is a pseudo-gradation image using a dither pattern,
A first step of dividing the pseudo gradation image into predetermined regions;
A second step of determining a representative value for each region;
And a third step of creating compressed data using the determined representative value,
In the second step,
For a region of interest that is one of the regions, a representative value of the region of interest and a representative value of one or a plurality of regions adjacent to the region of interest are used according to a predetermined interpolation rule. Interpolation of the density of each pixel and the pseudo-gradation using the dither pattern, and the dot arrangement pattern of the image data obtained by performing pseudo gradation processing and the dot arrangement pattern of the image data in the region of interest have a predetermined error. Find such a representative value that matches within the range and determine it as the representative value of the region of interest,
A method for compressing image data.
前記第2のステップにおいて、前記代表値を、前記各領域の端部に位置する画素の濃度値に対応する値とする、
請求項1または2記載の画像データの圧縮方法。
In the second step, the representative value is set to a value corresponding to a density value of a pixel located at an end of each region.
The image data compression method according to claim 1 or 2.
前記第2のステップにおいて、前記代表値として選択することの可能な値が所定の範囲を持っている場合に、その範囲における中央値を前記代表値として決定する、
請求項1ないし3のいずれかに記載の画像データの圧縮方法。
In the second step, when a value that can be selected as the representative value has a predetermined range, a median value in the range is determined as the representative value.
The image data compression method according to claim 1.
前記補間ルールは、当該注目領域の代表値および当該注目領域に隣接する2つの領域のそれぞれの代表値の合計3つの代表値で定義される平面によって各画素の濃度を補間するものである、
請求項1ないし4のいずれかに記載の画像データの圧縮方法。
The interpolation rule interpolates the density of each pixel by a plane defined by a total of three representative values of the representative value of the region of interest and the representative values of two regions adjacent to the region of interest.
5. A method for compressing image data according to claim 1.
前記第2のステップにおいて、前記注目領域内において代表値が決定できない場合に、当該注目領域における画像データを、当該注目領域の代替の代表値として決定する、
請求項1ないし5のいずれかに記載の画像データの圧縮方法。
In the second step, when a representative value cannot be determined in the attention area, image data in the attention area is determined as an alternative representative value of the attention area.
6. A method for compressing image data according to claim 1.
前記第2のステップにおいて、前記注目領域内において代表値が決定できない場合に、当該注目領域をさらに複数の小領域に区画し、各小領域内において代表値を決定する、
請求項1ないし5のいずれかに記載の画像データの圧縮方法。
In the second step, when a representative value cannot be determined in the attention area, the attention area is further divided into a plurality of small areas, and a representative value is determined in each small area.
6. A method for compressing image data according to claim 1.
前記第2のステップにおいて、前記小領域内において代表値が決定できない場合に、当該小領域における画像データを、当該小領域の代替の代表値として決定する、
請求項7記載の画像データの圧縮方法。
In the second step, when the representative value cannot be determined in the small area, the image data in the small area is determined as an alternative representative value of the small area.
The image data compression method according to claim 7.
請求項1ないし8のいずれかに記載の方法によって圧縮されたデータを復元する方法であって、
圧縮されたデータから各領域の代表値を取得し、前記領域のうちの1つの領域である注目領域について、当該注目領域の代表値および当該注目領域に隣接する1つまたは複数の領域の代表値を用い予め定められた前記補間ルールにしたがって当該注目領域における各画素の濃度を補間して求めさらに前記ディザパターンを用いて擬似階調化を行って擬似階調画像を復元する、
ことを特徴とする擬似階調画像の復元方法。
A method for decompressing data compressed by the method according to claim 1, comprising:
A representative value of each area is obtained from the compressed data, and for the attention area that is one of the areas, the representative value of the attention area and the representative value of one or more areas adjacent to the attention area Using a predetermined interpolation rule to interpolate the density of each pixel in the region of interest to obtain a pseudo-gradation using the dither pattern to restore a pseudo-gradation image,
A pseudo gradation image restoration method characterized by the above.
ディザパターンを用いて擬似階調化された画像である擬似階調画像のデータを圧縮する装置であって、
前記擬似階調画像を所定の領域ごとに区画する第1の手段と、
前記各領域の代表値を決定する第2の手段と、
決定した前記代表値を用いて圧縮データを作成する第3の手段とを有してなり、
前記第2の手段は、
前記領域のうちの1つの領域である注目領域について、当該注目領域の代表値および当該注目領域に隣接する1つまたは複数の領域の代表値を用い予め定められた補間ルールにしたがって当該注目領域における各画素の濃度を補間して求めさらに前記ディザパターンを用いて擬似階調化を行った場合に当該注目領域における前記擬似階調画像が再現されるような、そのような代表値を求めて当該注目領域の代表値として決定する、
ことを特徴とする画像データの圧縮装置。
An apparatus for compressing pseudo gradation image data, which is an image that has been pseudo gradation using a dither pattern,
First means for dividing the pseudo gradation image into predetermined regions;
A second means for determining a representative value of each region;
And a third means for creating compressed data using the determined representative value,
The second means includes
For a region of interest that is one of the regions, a representative value of the region of interest and a representative value of one or a plurality of regions adjacent to the region of interest are used according to a predetermined interpolation rule. Such a representative value is obtained by interpolating the density of each pixel and further reproducing the pseudo gradation image in the region of interest when pseudo gradation is performed using the dither pattern. Determine as the representative value of the region of interest,
A compression apparatus for image data.
前記第2の手段において前記注目領域内において代表値が決定できない場合に、当該注目領域をさらに複数の小領域に区画する手段を有し、前記第2の手段は、各小領域において代表値を決定する、
請求項10記載の画像データの圧縮装置。
In the case where the representative value cannot be determined in the attention area in the second means, the second means further includes means for dividing the attention area into a plurality of small areas, and the second means determines the representative value in each small area. decide,
The image data compression apparatus according to claim 10.
JP2005204843A 2005-07-13 2005-07-13 Image data compression method and apparatus, and pseudo gradation image restoration method Expired - Fee Related JP4696738B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2005204843A JP4696738B2 (en) 2005-07-13 2005-07-13 Image data compression method and apparatus, and pseudo gradation image restoration method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2005204843A JP4696738B2 (en) 2005-07-13 2005-07-13 Image data compression method and apparatus, and pseudo gradation image restoration method

Publications (2)

Publication Number Publication Date
JP2007028006A JP2007028006A (en) 2007-02-01
JP4696738B2 true JP4696738B2 (en) 2011-06-08

Family

ID=37788203

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2005204843A Expired - Fee Related JP4696738B2 (en) 2005-07-13 2005-07-13 Image data compression method and apparatus, and pseudo gradation image restoration method

Country Status (1)

Country Link
JP (1) JP4696738B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101404714B (en) * 2008-10-17 2010-09-22 北大方正集团有限公司 Image processing method and device

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS62199172A (en) * 1986-02-27 1987-09-02 Matsushita Graphic Commun Syst Inc Half tone picture processing method
JP2729279B2 (en) * 1989-06-20 1998-03-18 株式会社鷹山 Image thresholding method
JPH1021386A (en) * 1996-07-02 1998-01-23 Fuji Xerox Co Ltd Image processor

Also Published As

Publication number Publication date
JP2007028006A (en) 2007-02-01

Similar Documents

Publication Publication Date Title
US7844120B2 (en) Method and device for compressing image data
CN102577345B (en) Image processing apparatus and processing method therefor
JP4418762B2 (en) Image encoding apparatus, image decoding apparatus, control method thereof, computer program, and computer-readable storage medium
US5729663A (en) Method and apparatus for gray screening
US8213727B2 (en) Image encoding apparatus and image decoding apparatus, and control method thereof
JP4844331B2 (en) Image data processing method and apparatus
JPWO2004068844A1 (en) Image compression method, image restoration method, program, and apparatus
US7710605B2 (en) Print system and printer
JP3923796B2 (en) Two-dimensional code, two-dimensional code creation method, two-dimensional code decoding method, apparatus for executing the method, program for executing the method on a computer, and computer-readable recording medium recording the program
US7746501B2 (en) Method and device for compressing image data
JP3957734B1 (en) Program, information storage medium, 2D code generation system, 2D code
JP4696738B2 (en) Image data compression method and apparatus, and pseudo gradation image restoration method
US6154569A (en) System and method for coding and/or decoding image including bit-map of different levels
JP4588916B2 (en) Two-dimensional code reading device, two-dimensional code reading method, two-dimensional code reading program, and computer-readable recording medium
US7586649B2 (en) Method and device for compressing image data
JP4529681B2 (en) Image data compression method and apparatus
JP2000332995A (en) Method for generating image data and recording medium
KR20090072903A (en) Method and apparatus for encoding/decoding halftone image
JPH1127540A (en) Image coding/decoding method and its system
JP3481644B2 (en) Image compression device
JP4741317B2 (en) Data compression apparatus and data compression program
JP4971880B2 (en) Image encoding apparatus, image decoding apparatus, and control method thereof
JP4633577B2 (en) Data compression apparatus and data compression program
JP2020043461A (en) Image processing system and image processing method, and program
JPH11331621A (en) Device for processing picture and its method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20080424

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20110118

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: 20110201

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20110214

R150 Certificate of patent or registration of utility model

Ref document number: 4696738

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313111

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

LAPS Cancellation because of no payment of annual fees