JP2006129413A - Method and apparatus for compressing image data - Google Patents

Method and apparatus for compressing image data Download PDF

Info

Publication number
JP2006129413A
JP2006129413A JP2004377575A JP2004377575A JP2006129413A JP 2006129413 A JP2006129413 A JP 2006129413A JP 2004377575 A JP2004377575 A JP 2004377575A JP 2004377575 A JP2004377575 A JP 2004377575A JP 2006129413 A JP2006129413 A JP 2006129413A
Authority
JP
Japan
Prior art keywords
image data
value
area
pixel
pattern
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.)
Granted
Application number
JP2004377575A
Other languages
Japanese (ja)
Other versions
JP4529681B2 (en
Inventor
Toshitsugu Yamamoto
敏嗣 山本
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 JP2004377575A priority Critical patent/JP4529681B2/en
Priority to US11/318,046 priority patent/US7586649B2/en
Publication of JP2006129413A publication Critical patent/JP2006129413A/en
Application granted granted Critical
Publication of JP4529681B2 publication Critical patent/JP4529681B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

<P>PROBLEM TO BE SOLVED: To compress pseudo gradation image data at high speed with high compressibility using a dither pattern and further to develop the image data at high speed using small-scaled hardware. <P>SOLUTION: A method for compressing pseudo gradation image data using a dither pattern includes: partitioning the image data for each of predetermined regions; determining whether an array pattern of dots of the image data in each region is matched with the dither pattern used for pseudo gradation; finding a representative value for a density of the image data in that region if matched; and creating compressed data using the found representative value. <P>COPYRIGHT: (C)2006,JPO&NCIPI

Description

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

一般に、コンピュータとプリンタなどから構成されるプリントシステムが用いられている。このようなプリントシステムにおいては、プリントすべき画像データに対して、擬似階調化などの画像処理をコンピュータ側で行い、プリンタ側ではコンピュータから送信される画像データに対して特別な処理を行うことなく、そのまま出力して用紙にプリントするという方式がある。   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, when character data is included in image data, the resolution must be increased in order to print characters clearly, and as a result, the amount of data transmitted to the printer is further increased. 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.

ディザパターンに着目した圧縮技術として、特許文献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 that has been accepted for adoption by the 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. .

これに対して、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 also be performed at high speed with small hardware. It is an object of the present invention to provide a compression method, a decompression method, and a compression apparatus that can be restored by the above-described method.

本発明に係る圧縮方法は、ディザパターンを用いて擬似階調化された画像データを圧縮する方法であって、前記画像データを所定の領域ごとに区画し、各領域内における画像データのドットの配列パターンが擬似階調化に用いられたディザパターンと一致するか否かを判別し、一致する場合にその領域における画像データの濃度に関する代表値を求め、求めた代表値を用いて圧縮データを作成する。   A compression method according to the present invention is a method of compressing pseudo-gradated image data using a dither pattern, and divides the image data into predetermined regions, and dot of image data in each region. It is determined whether or not the array pattern matches the dither pattern used for pseudo-gradation, and if it matches, a representative value related to the density of the image data in that area is obtained, and the compressed data is obtained using the obtained representative value. create.

画像データを所定の領域ごとに区画するに当たっては、例えば、数10〜100画素の領域に区画する。その場合に、24画素、48画素、96画素などのように8の倍数の画素数にすると処理が効率的に行われる。   In dividing the image data into predetermined areas, for example, the image data is divided into areas of several 10 to 100 pixels. In that case, if the number of pixels is a multiple of 8, such as 24 pixels, 48 pixels, 96 pixels, etc., the processing is performed efficiently.

ドットの配列パターン(ドットパターン)がディザパターンと一致するか否かの判別は、例えば次のようにして行う。すなわち、全ての画素がある1つの濃度値(または階調値)を有した均一な画像データを仮想する。仮想した画像データを当該ディザパターンによって2値化したときに得られるドットパターンの全体または一部が、区画された1つの領域のドットパターンと等しい場合に、その領域のドットパターンは当該ディザパターンと一致すると判別する。換言すれば、ある濃度値に対してディザパターンを用いてドットパターンを生成したときに、生成されたドットパターンと領域のドットパターンとが互いに等しくなるような、そのような濃度値が存在する場合に、一致する、ということになる。そのような濃度値は特定の1つの値の場合もあり、またある範囲(レンジ)における複数の値をとり得る場合もある。この濃度値が代表値である。   Whether or not the dot arrangement pattern (dot pattern) matches the dither pattern is determined as follows, for example. That is, uniform image data having a certain density value (or gradation value) for all pixels is assumed. When the entire or part of the dot pattern obtained when the virtual image data is binarized by the dither pattern is equal to the dot pattern of one partitioned area, the dot pattern of the area is the same as the dither pattern. It is determined that they match. In other words, when a dot pattern is generated using a dither pattern for a certain density value, such a density value exists so that the generated dot pattern and the dot pattern of the area are equal to each other. It will be in agreement. Such a density value may be a specific value, or may take a plurality of values in a certain range. This density value is a representative value.

したがって、上に述べた解決手段については、次のように言い換えることも可能である。つまり、前記画像データを所定の領域ごとに区画し、各領域内における画像データのドットの配列パターンが擬似階調化に用いられたディザパターンの少なくとも一部に対応したものであるか否かを判別し、対応したものである場合にその領域における画像データの濃度に関する代表値を求め、求めた代表値を用いて圧縮データを作成する。   Therefore, the above-described solution can be paraphrased as follows. That is, the image data is divided into predetermined areas, and whether or not the dot arrangement pattern of the image data in each area corresponds to at least a part of the dither pattern used for pseudo gradation processing. If it is discriminated and corresponds, a representative value relating to the density of the image data in that region is obtained, and compressed data is created using the obtained representative value.

好ましくは、前記代表値として、前記領域内における画像データの各画素の濃度値と前記ディザパターンの対応する部分の各画素の濃度値とをそれぞれ比較して前記画像データの各画素の濃度値が小さい場合に予め用意されたパターン領域にドットを打った場合に、前記領域内において打たれたドットに対応する前記ディザパターンの画素の濃度値の最小値Jと打たれなかったドットに対応する前記ディザパターンの画素の濃度値の最大値Kとの間で
J≧a≧K
の条件を満たすように求められる値aを用いる。
Preferably, as the representative value, the density value of each pixel of the image data is compared by comparing the density value of each pixel of the image data in the region with the density value of each pixel of the corresponding portion of the dither pattern. When a dot is hit in a pattern area prepared in advance when it is small, the minimum value J of the density value of the pixel of the dither pattern corresponding to the dot hit in the area and the dot corresponding to the dot not hit J ≧ a ≧ K with the maximum density value K of the dither pattern pixels
The value a obtained so as to satisfy the following condition is used.

ここで、ディザパターンの濃度値は、通常、ディザパターンのしきい値によって提供される。したがって、「ディザパターンの対応する部分の各画素の濃度値」は、「ディザパターンの対応する部分の各画素のしきい値」と言い替えることも可能である。   Here, the density value of the dither pattern is usually provided by a threshold value of the dither pattern. Therefore, “the density value of each pixel in the corresponding portion of the dither pattern” can be rephrased as “the threshold value of each pixel in the corresponding portion of the dither pattern”.

なお、前記画像データの各画素の濃度値が大きい場合にドットを打った場合には、前記領域内において打たれなかったドットに対応する前記ディザパターンの画素の濃度値の最小値Jと打たれたドットに対応する前記ディザパターンの画素の濃度値の最大値Kとの間で条件を満たすように代表値aを求めればよい。このように、本発明においては、階調性、濃度、および、それらとドットを打つ打たないこととの関係などは、種々の組み合わせを行って適用することが可能である。   In addition, when a dot is shot when the density value of each pixel of the image data is large, the dot is printed with the minimum value J of the density value of the pixel of the dither pattern corresponding to the dot that has not been shot in the area. The representative value a may be obtained so as to satisfy the condition with the maximum density value K of the pixels of the dither pattern corresponding to the dots. Thus, in the present invention, the gradation, density, and the relationship between them and the absence of hitting dots can be applied in various combinations.

また、前記代表値として、前記領域内における画像データの各画素の濃度値と前記ディザパターンの各画素の濃度値とをそれぞれ比較して前記画像データの各画素の濃度値が小さい場合に予め用意されたパターン領域にドットを打った場合に、前記領域内において打たれたまたは打たれなかったドットの個数を用いる。   The representative value is prepared in advance when the density value of each pixel of the image data is small by comparing the density value of each pixel of the image data in the region with the density value of each pixel of the dither pattern. When dots are hit in the pattern area, the number of dots hit or not hit in the area is used.

また、前記代表値として、各領域のレンジの中において、隣り合う領域との代表値の差分が最小となる値を用いる。   In addition, as the representative value, a value that minimizes the difference between the representative values of adjacent regions in the range of each region is used.

また、前記圧縮データを作成する際に、各領域において他の領域との代表値の差分を求め、求めた差分を符号化する。   Further, when creating the compressed data, the difference between the representative values of each area and the other area is obtained, and the obtained difference is encoded.

また、擬似階調化に用いられたディザパターンが複数ある場合に、それら複数のディザパターンを切り換えて前記各領域内における画像データのドットの配列パターンと一致するか否かを判別する。   When there are a plurality of dither patterns used for pseudo gradation processing, the plurality of dither patterns are switched to determine whether or not they match the dot arrangement pattern of the image data in each area.

また、前記領域内における画像データのドットの配列パターンが擬似階調化に用いられたディザパターンと一致しない場合に、当該領域をさらに複数の小領域に区画し、各小領域内における画像データのドットの配列パターンが前記ディザパターンと一致するか否かを判別する。   Further, when the dot arrangement pattern of the image data in the area does not match the dither pattern used for pseudo gradation processing, the area is further divided into a plurality of small areas, and the image data in each small area is divided. It is determined whether or not the dot arrangement pattern matches the dither pattern.

また、前記代表値として、前記最小値Jと前記最大値Kとの間で
J≧a≧K
の条件を満たす値aを用い、前記小領域における代表値として、前記領域内において打たれたまたは打たれなかったドットの個数を用いる。この場合に、小領域における代表値として、前記領域における場合と同じ方法で求めた代表値aを用いてもよい。
Further, as the representative value, J ≧ a ≧ K between the minimum value J and the maximum value K.
The value a satisfying the above condition is used, and the number of dots hit or not hit in the area is used as the representative value in the small area. In this case, as the representative value in the small region, the representative value a obtained by the same method as that in the region may be used.

また、前記領域内または前記小領域内における画像データのドットの配列パターンが擬似階調化に用いられたディザパターンと一致しない場合に、当該領域内または前記小領域内において打たれたまたは打たれなかったドットの配列を符号化することによって前記圧縮データを作成する。   In addition, when the dot arrangement pattern of the image data in the area or the small area does not match the dither pattern used for pseudo gradation processing, the pattern is hit or hit in the area or the small area. The compressed data is created by encoding an array of missing dots.

また、本発明の他の形態によると、画像データを所定の領域ごとに区画する第1のステップと、各領域内における画像データのドットの配列パターンが擬似階調化に用いられたディザパターンと一致するか否かを判別する第2のステップと、前記第2のステップにおける判別の結果が一致する場合に、当該領域における画像データの濃度に関する代表値を、前記最小値Jと前記最大値Kとの間で
J≧a≧K
の条件を満たす値aとして求める第3のステップと、前記第2のステップにおける判別の結果が一致しない場合に、当該領域をさらに複数の小領域に区画し、各小領域内における画像データのドットの配列パターンが前記ディザパターンと一致するか否かを判別する第4のステップと、前記第4のステップにおける判別の結果が一致する場合に、前記小領域における代表値として、前記領域内において打たれたまたは打たれなかったドットの個数を求める第5のステップと、前記第4のステップにおける判別の結果が一致しない場合に、当該小領域におけるドットの配列を符号化する第6のステップと、前記第2のステップまたは前記第4のステップにおける判別の結果が一致する場合に、求めた代表値に基づいて符号化を行う第7のステップとを有する。
According to another aspect of the present invention, a first step of partitioning image data into predetermined areas, a dither pattern in which an array pattern of dots of image data in each area is used for pseudo gradation processing, and When the second step for determining whether or not they match and the result of the determination in the second step match, the representative values relating to the density of the image data in the region are represented by the minimum value J and the maximum value K. J ≧ a ≧ K
If the result of determination in the third step that satisfies the condition a and the determination in the second step do not match, the area is further divided into a plurality of small areas, and image data dots in each small area When the fourth step for determining whether or not the array pattern matches the dither pattern and the result of determination in the fourth step match, the representative value in the small region is entered in the region. A fifth step of determining the number of dots that have been struck or not struck, and a sixth step of encoding the arrangement of dots in the small region when the result of determination in the fourth step does not match; A seventh step of performing encoding based on the obtained representative value when the determination results in the second step or the fourth step match. With the door.

本発明に係る復元方法では、圧縮された画像データから各領域の代表値を取得し、取得した代表値と前記ディザパターンとを比較してドットパターンを再現する。   In the restoration method according to the present invention, the representative value of each area is acquired from the compressed image data, and the acquired representative value is compared with the dither pattern to reproduce the dot pattern.

本発明に係る圧縮装置は、ディザパターンを用いて擬似階調化された画像データを圧縮する装置であって、前記画像データを所定の領域ごとに区画する手段と、各領域内における画像データのドットの配列パターンが擬似階調化に用いられたディザパターンと一致するか否かを判別する手段と、一致する場合にその領域における画像データの濃度に関する代表値を求める手段と、求めた代表値を用いて圧縮データを作成する手段とを有してなる。   A compression device according to the present invention is a device for compressing pseudo-gradated image data using a dither pattern, and means for partitioning the image data into predetermined regions, and image data in each region. Means for determining whether or not the dot arrangement pattern matches the dither pattern used for pseudo-gradation, means for determining a representative value for the density of the image data in that area, and a representative value obtained And means for creating compressed data using.

本発明において、前記擬似階調化された画像データは、2値の画像データであってもよく、また、4値、8値、16値などの多値の画像データであってもよい。   In the present invention, the pseudo gradation image data may be binary image data, or multi-value image data such as 4-value, 8-value, and 16-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 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. explain. 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は、外部から入力された画像データまたは内部で生成した画像データなど(原画像データ)を、ディザ法によりディザパターンを用いて擬似階調化する。擬似階調化は、ハーフトーン化と呼称されることもある。本実施形態においては、擬似階調化として2値化を行い、2値画像データD1を生成する。そして、生成した2値画像データD1を圧縮して圧縮データD2を生成し、生成した圧縮データD2をプリンタ13に送信する。プリンタ13は、受信した圧縮データD2について、2値化に用いたディザパターンなどを参照して2値画像データ(ハーフトーン画像)を復元し、用紙などにプリントアウトする。   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. Pseudo gradation is sometimes called halftoning. 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.

本実施形態において、圧縮処理に際しては、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)ごとに区画し、各領域内における画像データのドットの配列パターンが2値化に用いられたディザパターンと一致するか否かを判別し、一致する場合にその領域における画像データの濃度に関する代表値aを求める。そして、隣り合う領域間の代表値aの差分情報を求め、求めた差分情報をハフマン法で符号化することによって圧縮データD2を得る。2値化に用いられたディザパターンがディザパターン情報成分であり、代表値aが画像情報成分である。   More specifically, in the course of the compression processing of the present embodiment, the binary image data D1 is divided into predetermined regions (low-resolution regions TL described later), and the dot pattern of the image data in each region is binary. It is determined whether or not it matches the dither pattern used for conversion, and if it matches, a representative value a regarding the density of the image data in that area is obtained. Then, difference information of the representative value a between adjacent areas 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 depending on the type of area such as a character area or an image area. Therefore, even during the compression process, the plurality of dither patterns are switched and used in each area. It is determined whether or not it matches the dot arrangement pattern of the image data.

いずれのディザパターンにも一致しない場合には、その領域をさらに複数の小領域(後述する中解像度領域TM)に区画し、各小領域内における画像データのドットの配列パターンがディザパターンと一致するか否かを判別する。ここで一致した場合は、小領域に打たれたドット数を代表値とする。ここでも一致しなかった場合には、それら領域または小領域のドットの配列を符号化して圧縮データD2を得る。   If it does not match any dither pattern, the area is further divided into a plurality of small areas (medium resolution area TM to be described later), and the dot pattern of the image data in each small area matches the dither pattern. It is determined 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に予め送信する。なお、デコード表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 on the dither pattern and a decoding table DC that is a table for restoration (decoding) by the Huffman method. 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を取得し、取得した代表値aと該当するディザパターンとを比較し、元の2値画像データD1と同じドットパターン(ドットの配列パターン)を再現する。そのような復元処理(復号処理)において、ハフマン法による復元のためにデコード表DCが用いられる。   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, and is the same as the original binary image data D1. Reproduce the dot pattern (dot arrangement pattern). 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の例を示す図である。   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. It is a figure which shows the example of.

図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、およびデコード表DCを出力してプリンタ13に送信する。   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, and the decode table DC to be transmitted to the printer 13.

図3において、圧縮データ作成部100は、低解像度領域区画部101、低解像度比較部102、低解像度代表値算出部103、中解像度領域区画部104、中解像度比較部105、中解像度代表値算出部106、ドットパターン抽出部107、符号化部108、およびデータ送信部109などから構成される。
〔低解像度領域の処理〕
低解像度領域区画部101は、擬似階調化部170から送られてきた2値画像データD1を、多数の小さな領域である低解像度領域TLに区画する。低解像度領域TLは、例えば図5に示すように、96個(6×16個)の画素TPからなる矩形の領域である。図5の例では、2値画像データD1の全体の領域が、左上から順に、低解像度領域TL1、TL2、TL3、…というようにTLnまで区画されている。
In FIG. 3, the compressed data creation unit 100 includes a low resolution region partition unit 101, a low resolution comparison unit 102, a low resolution representative value calculation unit 103, a medium resolution region partition unit 104, a medium resolution comparison unit 105, and a medium resolution representative value calculation. Unit 106, dot pattern extraction unit 107, encoding unit 108, and data transmission unit 109.
[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 partitioned up to TLn in order from the upper left, such as low resolution areas TL1, TL2, TL3,.

低解像度比較部102は、各低解像度領域TLのドットパターンとディザパターンDPとを比較し、これらが互いに一致しているか否かを判別する。一致しているか否かの判別は次のようにして行う。   The low resolution comparison unit 102 compares the dot pattern of each low resolution region TL with the dither pattern DP and determines whether or not they match each other. Whether or not they match is determined as follows.

すなわち、全ての画素がある1つの濃度値(または階調値)を有した均一な画像データを仮想する。仮想した画像データを当該ディザパターンDPによって2値化したときに得られるドットパターンが、低解像度領域TLのドットパターンと等しい場合に、その低解像度領域TLのドットパターンは当該ディザパターンDPと一致すると判別する。判別に用いる濃度値としてはどの様な値であってもよい。つまり、換言すれば、ディザパターンDPを用いてドットパターンを生成したときにドットパターンが互いに等しくなるような濃度値が存在する場合に、一致すると判別する、といえる。したがって、そのような濃度値は特定の1つの値の場合もあり、またある範囲における複数の値をとり得る場合もある。この濃度値が、上に述べた代表値aである。これらの関係について、後においても説明する。   That is, uniform image data having a certain density value (or gradation value) for all pixels is assumed. When the dot pattern obtained when the virtual image data is binarized by the dither pattern DP is equal to the dot pattern of the low resolution area TL, the dot pattern of the low resolution area TL matches the dither pattern DP. Determine. Any value may be used as the density value used for discrimination. 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 described above. These relationships will be described later.

低解像度比較部102において、低解像度領域TLのドットパターンとディザパターンDPとの比較は、2値画像データD1について、その左からにかつ上から下に、1つの領域ごとに順番に行われる。例えば、上にある複数の単位行(ライン)について、左端から右方向にむかって1つの領域ごとに行われ、1つの単位行が終わればその下にある単位行の左端に戻り、再度右方向に1つの領域ごとに順番に行われ、右下端の領域で終わる。   In the low resolution comparison unit 102, the dot pattern in the low resolution region TL and the dither pattern DP are compared with each other in order from the left and from the top to the bottom for the binary image data D1. For example, for a plurality of unit lines (lines) above, the process is performed for each region from the left end toward the right, and when one unit line ends, the unit line returns to the left end of the unit line below and returns to the right. Are performed in turn for each region, and end in the lower right region.

比較に用いられるディザパターンDPは、2値画像データD1の各色に対応したディザパターンDPが用いられる。そして、各色に対応して、最初に文字領域用ディザパターンDPが用いられる。文字領域用ディザパターンDPが一致しなかった場合に、次に画像領域用ディザパターンDPが用いられ、これも一致しなかった場合にチャート領域用ディザパターンDPが用いられる。このように、一致しなかった場合に、ディザパターンDPが順に切り換えられる。ディザパターンDPの切り換えを行ったという情報は、用いたディザパターンDPを特定するための情報として符号化の際に用いられる。いずれのディザパターンDPでも一致しなかった場合には、「一致しない」という判別結果を出力する。   As the dither pattern DP used for comparison, a dither pattern DP corresponding to each color of the binary image data D1 is used. The character area dither pattern DP is first used corresponding to each color. When the character area dither pattern DP does not match, the image area dither pattern DP is used next. When the character area dither pattern DP also does not match, the chart area dither pattern DP is used. Thus, when they do not match, the dither pattern DP is sequentially switched. Information indicating that the dither pattern DP has been switched is used in encoding as information for specifying the used dither pattern DP. If none of the dither patterns DP match, a discrimination result “not matched” is output.

低解像度代表値算出部103は、低解像度比較部102での判別結果が一致した場合に、代表値aを求める。代表値aの求め方は次のとおりである。
〔代表値aの求め方〕
図6(a)に示す低解像度領域TLにおいて、黒の画素が、ドットが打たれた画素である。ここで、2値化が行われる前の階調性のある画像データFDのうち、低解像度領域TLに対応する領域の画像データFDについて考える。そのような画像データFDを、ここでは「画像データFDL」とする。そして、画像データFDLの各画素の濃度値が、図6(b)に示すディザパターンDPの対応する画素のしきい値未満であったときに、その画素にドットが打たれたものとする。つまり、ここでは濃度値が小さいほど濃度が高いものと仮定する。
The low resolution representative value calculation unit 103 obtains the representative value a when the discrimination results in the low resolution comparison unit 102 match. The method for obtaining the representative value a is as follows.
[How to find representative value a]
In the low resolution region TL shown in FIG. 6A, the black pixels are pixels on which dots are formed. Here, image data FD in a region corresponding to the low resolution region TL among the image data FD having gradation before binarization is considered. Such image data FD is referred to herein as “image data FDL”. Then, when the density value of each pixel of the image data FDL is less than the threshold value of the corresponding pixel of the dither pattern DP shown in FIG. That is, here, it is assumed that the smaller the density value, the higher the density.

その場合に、ある画素でドットが打たれているときは、その画素の濃度値がディザパターンDPの対応する画素のしきい値未満であったということができる。これは、その画素の濃度の上限値が、ディザパターンDPの対応する画素のしきい値より「1」だけ小さい値であった、と言い換えることができる。逆に、ドットが打たれていないときは、その画素の濃度値はディザパターンDPの対応する画素のしきい値以上であったということになる。これは、その画素の濃度の下限値が、ディザパターンDPの対応する画素のしきい値であったと言い換えることができる。   In that case, when a dot is formed in a certain pixel, it can be said that the density value of the pixel is less than the threshold value of the corresponding pixel of the dither pattern DP. In other words, the upper limit value of the density of the pixel is “1” smaller than the threshold value of the corresponding pixel of the dither pattern DP. On the other hand, when the dot is not printed, it means that the density value of the pixel is equal to or higher than the threshold value of the corresponding pixel of the dither pattern DP. In other words, the lower limit value of the density of the pixel is the threshold value of the corresponding pixel of the dither pattern DP.

そこで、低解像度領域TLとディザパターンDPとにおいて、各画素の上限値および下限値を集計し、上限値の最小値Jおよび下限値の最大値Kを求める。これら上限値の最小値Jと下限値の最大値Kについて、
J≧K ……(1)
の関係が成り立つならば、
J≧a≧K ……(2)
を満たす「a」が存在する。この「a」が代表値aである。換言すれば、上の(1)式が成り立つときには、低解像度領域TLのドットパターンとディザパターンDPとが一致し、代表値aが存在する。代表値aが分かれば、ディザパターンDPから低解像度領域TLのドットパターンを復元することが可能である。つまり、画像情報成分として各領域におけるただ1つの代表値aを求めるだけで、当該低解像度領域TLに一致するディザパターンDPを用いてその領域の2値画像データD1を再現することが可能となるのである。
Therefore, in the low resolution region TL and the dither pattern DP, the upper limit value and the lower limit value of each pixel are totaled to obtain the minimum value J of the upper limit value and the maximum value K of the lower limit value. About the minimum value J of these upper limits and the maximum value K of the lower limits,
J ≧ K (1)
If the relationship of
J ≧ a ≧ K (2)
There exists “a” that satisfies the above. This “a” is the representative value a. In other words, when the above equation (1) holds, the dot pattern in the low resolution region TL and the dither pattern DP match and there is a representative value a. If the representative value a is known, the dot pattern of the low resolution area TL can be restored from the dither pattern DP. That is, by obtaining only one representative value a in each region as an image information component, it is possible to reproduce the binary image data D1 in that region using the dither pattern DP that matches the low resolution region TL. It is.

したがって、この代表値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.

なお、図6の例では、画像データFDLの各画素の濃度値がディザパターンDPのしきい値未満であったときにドットが打たれたものとしたが、これとは逆に、図24に示すように、画像データFDLの各画素の濃度値がディザパターンDP5のしきい値以上であったときにドットが打たれるものとしてもよい。つまり、濃度値が大きいほど濃度が高いものとしてもよい。この場合には、ある画素でドットが打たれているときは、その画素の濃度値がディザパターンDP5の対応する画素のしきい値以上であったということ、つまり、その画素の濃度の下限値はディザパターンDP5の対応する画素のしきい値であった、ということになる。そして、ドットが打たれていないときは、その画素の濃度値はディザパターンDP5の対応する画素のしきい値未満であったということ、つまり、ディザパターンDP5の対応する画素のしきい値より「1」だけ小さい値であった、ということになる。そして、この場合に、上と同様に、(2)式を満たす「a」を代表値とする。   In the example of FIG. 6, it is assumed that dots are formed when the density value of each pixel of the image data FDL is less than the threshold value of the dither pattern DP. As shown, a dot may be formed when the density value of each pixel of the image data FDL is equal to or greater than the threshold value of the dither pattern DP5. That is, the higher the density value, the higher the density. In this case, when a dot is shot at a certain pixel, the density value of the pixel is equal to or greater than the threshold value of the corresponding pixel of the dither pattern DP5, that is, the lower limit value of the density of the pixel. Is the threshold value of the corresponding pixel of the dither pattern DP5. When the dot is not printed, the density value of the pixel is less than the threshold value of the corresponding pixel of the dither pattern DP5, that is, the threshold value of the corresponding pixel of the dither pattern DP5 is “ It means that the value was smaller by 1 ”. In this case, similarly to the above, “a” satisfying the expression (2) is set as the representative value.

さて、画像データFDが各色について256階調であるとすると、代表値aは、8ビットの情報量を持つことになる。本実施形態において、低解像度領域TLは6×16=96ビットの情報量を持っており、これを8ビットで表現できるので、情報量を概ね10分の1に圧縮できることになる。また、ほとんどの画像データFDについて、近隣の低解像度領域TLにおいては代表値aが互いに接近している。つまり、近隣の領域では濃度の差分が小さく、そのため代表値aの差が小さい、という性質がある。したがって、ある低解像度領域TLの代表値aについて、その直前に求めた低解像度領域TLの代表値aとの差をとると、多くの場合に差が「0」となり、差の統計的な頻度の偏りが大きくなる。つまり、代表値aそれ自体に代えて、代表値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. For most image data FD, the representative values a are close to each other in the adjacent low resolution region TL. That is, there is a property that a difference in density is small in a neighboring region, and therefore a difference in representative value a is small. Therefore, if the difference between the representative value a of a certain low resolution area TL and the representative value a of the low resolution area TL obtained immediately before is taken, the difference is often “0”, and the statistical frequency of the difference The bias becomes larger. That is, by using the difference of the representative value a instead of the representative value a itself, it is possible to compress at a higher compression rate by the Huffman method encoding. As a result, it is possible to further compress the signal into, for example, a fraction in encoding.

なお、図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のサイズよりも小さい場合でもよい。この場合に、複数の低解像度領域TLbn 、TLbn+1 が、ディザパターンDPbにおけるそれぞれ異なる部分と比較される。この場合に、2値画像データD1の最初の低解像度領域TLbに対して適用するディザパターンDPbの座標位置を決めておき、後はディザパターンDPbを順にずらせることにより、全ての低解像度領域TLbに対して、適用すべきディザパターンDPbの座標位置は一意に決定される。 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. In this case, the plurality of low resolution regions TLb n and TLb n + 1 are compared with different portions in the dither pattern DPb. In this case, the coordinate position of the dither pattern DPb to be applied to the first low-resolution area TLb of the binary image data D1 is determined, and then the dither pattern DPb is sequentially shifted so that all the low-resolution areas TLb On the other hand, the coordinate position of the dither pattern DPb to be applied is uniquely determined.

図7の例とは逆に、低解像度領域TLのサイズがディザパターンDPのサイズよりも大きい場合でもよい。   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.

さて、上に述べた代表値aは、上の説明で明らかなように、種々の方法で求めることが可能である。次に、その1つの例として、予め作成したテーブルを参照して代表値aを求める方法について説明する。   The representative value a described above can be obtained by various methods as is apparent from the above description. Next, as one example, a method for obtaining the representative value a with reference to a table created in advance will be described.

上に述べたように、代表値aを求めるのに必要なものは、ある領域のドットパターンに対応する各画素値の上限値の最小値Jと下限値の最大値Kである。これらは、ディザパターンDPが与えられると、そのディザパターンDP内における位置と領域のドットパターンとによって決まってくる。ディザパターンDP内の位置は、領域の先頭画素の座標として2変数で表すことができる。ドットパターンは、8画素ごとに1つのブロックと考えてこれを数値化すると、1ブロック当たり0〜255の整数値で表すことができる(図14参照)。この場合に、8画素のドットパターンをそのまま数値と解釈するだけで整数値が得られるので、何らの変換も不要である。したがって、ディザパターンDPの各画素について、それぞれ0〜255の256個のドットパターンに対応して上限値の最小値Jと下限値の最大値Kとを記述したテーブルがあればよい。つまり、ディザパターンDPの画素数×256個のデータを変換するテーブルがあれば全てを記述することができる。そのようなテーブルがあれば、ディザパターンDP内の位置座標とドットパターンの整数値とから、その位置に記述された値(最小値Jおよび最大値K)を容易に高速で取り出すことができる。本実施形態では、そのようなテーブルを上下限テーブルTJKとして作成しておく。   As described above, what is necessary for obtaining the representative value a is the minimum value J of the upper limit value and the maximum value K of the lower limit value of each pixel value corresponding to the dot pattern of a certain region. When the dither pattern DP is given, these are determined by the position in the dither pattern DP and the dot pattern of the area. The position in the dither pattern DP can be represented by two variables as the coordinates of the first pixel of the area. The dot pattern can be represented by an integer value of 0 to 255 per block when it is considered as one block every 8 pixels (see FIG. 14). In this case, since an integer value can be obtained simply by interpreting the dot pattern of 8 pixels as a numerical value, no conversion is necessary. Therefore, for each pixel of the dither pattern DP, there may be a table in which the minimum value J of the upper limit value and the maximum value K of the lower limit value are described corresponding to 256 dot patterns of 0 to 255, respectively. That is, if there is a table for converting data of the number of pixels of the dither pattern DP × 256, all can be described. With such a table, the values (minimum value J and maximum value K) described at the position can be easily extracted at high speed from the position coordinates in the dither pattern DP and the integer value of the dot pattern. In this embodiment, such a table is created as an upper / lower limit table TJK.

図8は上下限テーブルTJKの例を示す図である。   FIG. 8 shows an example of the upper / lower limit table TJK.

図8に示す上下限テーブルTJKには、あるディザパターンDPについて、そのディザパターンDP内の座標およびドットパターンと、上限値の最小値Jと下限値の最大値Kとの対応関係が示されている。   The upper and lower limit table TJK shown in FIG. 8 shows the correspondence between the coordinates and dot pattern in a dither pattern DP and the minimum value J of the upper limit value and the maximum value K of the lower limit value for a dither pattern DP. Yes.

そこで、上に述べた低解像度領域TLを、8画素ごとの12のブロックに区画し、各ブロックごとに最小値Jと最大値Kを求める。例えば、あるブロックのディザパターンDP内の座標が(0,2)であり、ドットパターンの整数値が「0」である場合には、上下限テーブルTJKから、最小値Jが「255」、最大値Kが「141」であることが分かる。   Therefore, the above-described low resolution region TL is divided into 12 blocks of 8 pixels, and the minimum value J and the maximum value K are obtained for each block. For example, when the coordinate in the dither pattern DP of a certain block is (0, 2) and the integer value of the dot pattern is “0”, the minimum value J is “255” and the maximum value from the upper / lower limit table TJK. It can be seen that the value K is “141”.

このようにして得られた12個のブロックの最小値Jと最大値Kに基づいて、低解像度領域TLの全体の最小値Jと最大値Kを求める。つまり、低解像度領域TLの最小値Jは、12個の最小値Jの内の最も小さいものであり、低解像度領域TLの最大値Kは、12個の最大値Kの内の最も大きなものである。   Based on the minimum value J and maximum value K of the 12 blocks obtained in this way, the entire minimum value J and maximum value K of the low resolution region TL are obtained. That is, the minimum value J of the low resolution area TL is the smallest of the 12 minimum values J, and the maximum value K of the low resolution area TL is the largest of the 12 maximum values K. is there.

このように、上下限テーブルTJKを用いることによって、代表値aの算出のための処理を、高々2Mバイト程度の上下限テーブルTJKからデータを読み出す作業によって実現することができる。テーブルからの読み出しは高速で行えるので、代表値aを高速に求めることができ、しかも、この処理は圧縮処理全体の中でも大きな負荷であるので、全体の処理時間を大幅に短縮することができる。   Thus, by using the upper / lower limit table TJK, the processing for calculating the representative value a can be realized by the operation of reading data from the upper / lower limit table TJK of about 2 Mbytes at most. Since reading from the table can be performed at a high speed, the representative value a can be obtained at a high speed. Moreover, since this processing is a heavy load in the entire compression processing, the entire processing time can be greatly shortened.

なお、上下限テーブルTJKは、8画素のブロックがディザパターンDPと一致しているか否かを判別するためにも用いることができる。   Note that the upper / lower limit table TJK can also be used to determine whether an 8-pixel block matches the dither pattern DP.

上に述べたように、得られた最小値Jと最大値Kから代表値aが得られる。代表値aは、特定の1つの値の場合もあり、ある範囲に広がった複数の値をとり得る場合もある。しかし、プリンタ13において2値画像データD1のドットパターンを再現するには、代表値aは1つの値のみで十分である。そこで、得られた代表値aがある範囲に広がった場合に、それを特定の1つの値に絞り込む方法について説明する。   As described above, the representative value a is obtained from the obtained minimum value J and maximum value K. The representative value a may be a specific value, or may take a plurality of values spread over a certain range. However, for the printer 13 to reproduce the dot pattern of the binary image data D1, only one representative value a is sufficient. Therefore, a method for narrowing the obtained representative value a to a specific value when the representative value a spreads over a certain range will be described.

図9は複数の低解像度領域TLについての代表値の推移の例を示す図である。   FIG. 9 is a diagram showing an example of transition of representative values for a plurality of low resolution regions TL.

図9において、横軸は低解像度領域TLの番号、縦軸は代表値を示す。図9に示すように、代表値はある範囲ETを持っている。そこで、代表値aの変化ができるだけ少なくなるように、つまり隣合う低解像度領域TLの代表値aの差分ができるだけ「0」となるように、代表値aを決める。   In FIG. 9, the horizontal axis indicates the number of the low resolution region TL, and the vertical axis indicates the representative value. As shown in FIG. 9, the representative value has a certain range ET. Therefore, the representative value a is determined so that the change of the representative value a is as small as possible, that is, the difference between the representative values a of the adjacent low resolution regions TL is “0” as much as possible.

すなわち、図9の最も左側である最初の低解像度領域TLの代表値aを、その範囲内における中央の値と決め、その右隣である2番目の低解像度領域TLの代表値aを、最初の代表値aと同じ値とする。3番目の低解像度領域TLの代表値aは、2番目の代表値aと同じ値とすると範囲から出てしまうので、範囲内に入るように代表値aを決める。4番目についても、3番目と同様に、範囲内に入るように代表値aを決める。5番目の代表値aは、4番目の代表値aと同じ値とする。このようにして決めた代表値aについて、その差分が図の下方に示されている。代表値aの差分として「0」が多くなることで、頻度の偏りが大きくなり、ハフマン法の符号化において高い圧縮率が得られる。   That is, the representative value a of the first low-resolution area TL that is the leftmost side in FIG. 9 is determined as the center value in the range, and the representative value a of the second low-resolution area TL that is adjacent to the right is the first representative value a. The same value as the representative value a. If the representative value a of the third low-resolution area TL is the same value as the second representative value a, the representative value a is determined so as to fall within the range. For the fourth, as in the third, the representative value a is determined so as to fall within the range. The fifth representative value a is the same value as the fourth representative value a. The difference of the representative value a determined in this way is shown in the lower part of the figure. By increasing “0” as the difference of the representative value a, the frequency deviation becomes large, and a high compression rate is obtained in the Huffman method 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 will be described. In order to simplify the description, a cyclic integer of 0 to 8 will be described.

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

図10において、ある数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. 10, 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.

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

図11に示すように、差分が「0」〜「20」程度および「230」〜「255」程度の範囲で出現頻度が高い。このような分布は、画像の種類によらずほぼ同じであり、且つ偏りが非常に大きいので、差分を用いることによって大抵の画像をハフマン法によって大幅に圧縮することができる。   As shown in FIG. 11, the appearance frequency is high in the ranges 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.

なお、図11において、代表値aの差分である0〜255の後に、「256」「257」「258」の3つの値についての出現頻度が示されている。これは、所定の状態が生じたときにその状態を特定の3つの数値で示し、これによって情報量をさらに低減し、圧縮率をさらに高めるためのものである。   In FIG. 11, the appearance frequencies of three values “256”, “257”, and “258” are shown after 0 to 255, which are the differences 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がいずれのディザパターンDPとも一致しなかったことを表す属性コード、「258」は、ディザパターンDPの切り換えを行ったこと、つまりある低解像度領域TLが切り換えられた他のディザパターンDPに一致したことを表す属性コードである。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 a certain low resolution area TL does not match any dither pattern DP, and “258” indicates that the dither pattern DP is switched, that is, a certain low resolution area TL is switched. This is an attribute code indicating that it matches the other 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」が切り換え回数分出力される。低解像度領域TLがいずれのディザパターンDPとも一致しなかった場合には、属性コード「256」が出力される。この場合には、その低解像度領域TLは、次に説明する中解像度領域区画部104によって処理される。
〔中解像度領域および高解像度領域の処理〕
図12は低解像度領域TLおよび中解像度領域TMを示す図、図13は画像におけるドット数の差分の出現頻度の分布を表す図、図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 low resolution area TL does not match any dither pattern DP, 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]
12 is a diagram showing the low resolution region TL and the medium resolution region TM, FIG. 13 is a diagram showing the distribution of the appearance frequency of the difference in the number of dots in the image, and FIG. 14 is a diagram for explaining the digitization of the dot pattern. 15 is a diagram showing the distribution of the appearance frequency of each dot pattern.

中解像度領域区画部104では、低解像度領域TLを、さらに図12に示すような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.

中解像度比較部105では、各中解像度領域TMにおいて、それぞれのドットパターンがディザパターンDPの一部と一致するか否かを、低解像度領域TLの場合と同様な方法で判別する。つまり、中解像度領域TMは、8画素の3つの高解像度領域TSから構成されているので、上に述べた上下限テーブルTJKから最小値Jおよび最大値Kを3回読み出して集計することによって、ディザパターンDPと一致するか否かを判別することができる。なお、ディザパターンDPと一致するか否かの判別を中解像度領域TMで行うのは、領域が小さくなれば一致の頻度が高くなるからである。   The medium resolution comparison unit 105 determines whether or not each dot pattern matches a part of the dither pattern DP in each medium resolution region TM by the same method as in the low resolution region TL. That is, since the medium resolution area TM is composed of three high resolution areas TS of 8 pixels, the minimum value J and the maximum value K are read out from the upper / lower limit table TJK described above three times and totalized. It can be determined whether or not it matches the dither pattern DP. The reason for determining whether or not the pattern matches the dither pattern DP is that the medium resolution area TM is used because the frequency of matching increases as the area becomes smaller.

中解像度代表値算出部106では、中解像度領域TMがディザパターンDPと一致した場合に、中解像度領域TMに打たれているドットの個数、例えば黒ドットの個数を、代表値として求める。中解像度領域TMでは、全部で24ドットであるので、ドット数を代表値としても情報量はそれほど多くなく、またドット数をカウントする処理も速い。ドット数から元のドットパターンを復元することが可能である。そして、得られた代表値に基づいて、隣合う中解像度領域TMの間の代表値の差分が、上に述べた低解像度領域TLの場合と同様にして算出される。ここでの差分は、上に述べた循環整数を用いるので、0〜24の範囲となる。   In the middle resolution representative value calculation unit 106, when the middle resolution area TM matches the dither pattern DP, the number of dots applied to the middle resolution area TM, for example, the number of black dots, is obtained as a representative value. Since the total number of dots in the medium resolution area TM is 24, the amount of information is not so large even if the number of dots is a representative value, and the process of counting the number of dots is fast. It is possible to restore the original dot pattern from the number of dots. 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 24 because the cyclic integer described above is used.

図13に示すように、差分が「0」〜「3」程度および「21」〜「24」程度の範囲で出現頻度が高い。このような分布は、画像の種類よらずほぼ同じであり、且つ偏りが非常に大きいので、差分を用いることによって高い圧縮率を得ることができる。例えば十倍程度の圧縮率を得ることができる。   As shown in FIG. 13, the appearance frequency is high in the range where the difference is about “0” to “3” and “21” to “24”. Such a distribution is almost the same regardless of the type of image, and the deviation is very large. Therefore, a high compression ratio can be obtained by using the difference. For example, a compression ratio of about ten times can be obtained.

なお、図13において、差分である0〜24の後に、「25」の値についての出現頻度が示されている。これの趣旨は低解像度領域TLの場合の属性コードと同様であり、「25」は、ある中解像度領域TMがいずれのディザパターンDPとも一致しなかったことを表す属性コードである。   In FIG. 13, the appearance frequency for the value “25” is shown after 0 to 24 as the difference. The meaning of this is the same as the attribute code in the case of the low resolution area TL, and “25” is an attribute code indicating that a certain medium resolution area TM does not match any dither pattern DP.

なお、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においても一致しなかった場合に、中解像度領域TMをさらに8画素の3つの高解像度領域TSに区画し、この高解像度領域TSのドットパターンを数値化する。ドットパターンの数値化においては、例えば、図14に示すように、ドットの打たれている画素を「1」、打たれていない画素を「0」として2進数で表し、これを10進数に変換し、これを属性コードとして出力する。   The dot pattern extraction unit 107 further divides the medium resolution area TM into three high resolution areas TS of 8 pixels and quantifies the dot pattern of the high resolution area TS when the medium resolution area TM does not match. To do. 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.

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

データ復元部300は、所定のディザパターンDPおよびデコード表DCを参照して、コンピュータ11から受信した圧縮データD2を復元し、ドットパターンを再現する。圧縮データD2の復元に際して、最初に低解像度領域用のデコード表DC1を用いてデコード1による復元処理が行われ、条件に応じて、中解像度領域用のデコード表DC2を用いたデコード2による復元処理、または高解像度領域用のデコード表DC3を用いたデコード3による復元処理がそれぞれ行われる。つまり、コード1,2,3で符号化した圧縮データD2に対して、それぞれ、デコード1,2,3で復元することとなる。   The data restoring unit 300 restores the compressed data D2 received from the computer 11 with reference to a predetermined dither pattern DP and the decoding table DC, 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.

図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とからドットパターンが再現され、ラインバッファ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. The dot pattern is reproduced with 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 and the current dither pattern DP and sent to the line buffer 380.

デコード2による復元処理では、中解像度領域用のデコード表DC2によって復元が行われる。デコード2によって復元された値が「25」であった場合は、以降の処理が高解像度領域用のデコード3の復元処理に切り換えられる。復元した値が「25」でない場合は、その値は中解像度領域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 “25”, the subsequent processing is switched to the restoration processing of the decode 3 for the high resolution area. If the restored value is not “25”, the value is the difference between the representative values (number of dots) 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」「25」は、領域間におけるコード切り換え信号として機能し、これらの属性コードが現れることによって、間違いなくコード1からコード2へまたはコード2からコード3へ切り換えることができる。   As described above, the attribute codes “256” and “25” function as code switching signals between areas, and when these attribute codes appear, switching from code 1 to code 2 or from code 2 to code 3 is definitely performed. Can do.

ラインバッファ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.

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

図18において、準備としてディザパターンDPを読み込んだ後(#11)、2値画像データD1を読み込む(#12)。2値画像データD1を低解像度領域TLに区画し(#13)、1つの低解像度領域TLについて、ディザパターンDPと一致するか否かを判別する(#14)。ディザパターンDPが複数ある場合には、一致するまでディザパターンDPを切り換える。一致すれば(#14でイエス)、代表値aを求め(#15)、その差分をとり(#16)、符号化する(#17)。   In FIG. 18, after the dither pattern DP is read as 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 one low resolution area TL matches the dither pattern DP (# 14). When there are a plurality of dither patterns DP, the dither patterns DP are switched until they match. If they match (Yes in # 14), the representative value a is obtained (# 15), the difference is taken (# 16), and encoding is performed (# 17).

ステップ#14でパターンが一致しない場合は、中解像度領域TMに区画し(#19)、1つの中解像度領域TMについて、ディザパターンDPと一致するか否かを判別する(#20)。一致すれば、ドットの個数を求め(#21)、その差分をとり(#22)、符号化する(#23)。ステップ#20でパターンが一致しない場合は、高解像度領域TSに区画し(#25)、1つの高解像度領域TSについて、ドット配列を得て(#26)、それを符号化する(#27)。   If the pattern does not match in step # 14, it is divided into medium resolution areas TM (# 19), and it is determined whether one medium resolution area TM matches the dither pattern DP (# 20). If they match, the number of dots is obtained (# 21), the difference is taken (# 22), and encoding is performed (# 23). If the patterns do not match in step # 20, the pattern is divided into high resolution areas TS (# 25), and a dot arrangement 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)、ディザパターン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), 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はデータ復元部300における復元処理のフローチャートである。なお、これらのフローチャートは、CMYKの内の1つの色成分についての処理を示す。   20 and 21 are flowcharts of compression processing in the compressed data creation unit 100, and FIGS. 22 and 23 are flowcharts of decompression processing 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に送信しておく。上下限テーブルTJKを作成する(#103)。2値画像データD1の内の6ライン分を入力し(#104)、その左端から1つの低解像度領域TLの分についてディザパターンDPと一致するか否かを判別する(#105)。一致する場合に、上下限テーブルTJKを参照して代表値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. An upper / lower limit table TJK is created (# 103). Six lines of the binary image data D1 are input (# 104), and it is determined from the left end whether or not one low resolution area TL matches the dither pattern DP (# 105). If they match, the representative value a is obtained by referring to the upper and lower limit table TJK (# 106), and the 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でノーの場合、つまりディザパターンDPと一致しない場合には、代表値差分「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 the pattern does not match the dither pattern DP, the representative value difference “0” is encoded and output by the code 1 (# 120), and the variable n is set to “0”. (# 121). Then, it is checked whether or not it matches with another dither pattern DP (# 122). If there is a matching dither pattern DP (Yes in # 122), the dither pattern DP is switched to (# 123), and the attribute code “258” indicating that the dither pattern DP has been switched is encoded by the code 1 for the number of times of switching. Output (# 124), obtain representative value a (# 225), and proceed 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 matching dither pattern DP, the attribute code “256” indicating that the low resolution area TL does not match any dither pattern DP is encoded with code 1 and output. (# 129), the process proceeds to step # 131 and subsequent steps which are 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 one medium resolution area TM obtained by dividing the low resolution area TL into four matches with any dither pattern DP (# 131). If they match (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 medium resolution area TM does not match any dither pattern DP, the attribute code “25” indicating that they do not match is encoded by code 2 and output (# 135). ), The process proceeds to step # 141 and subsequent steps which are 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および図23において、まず、ディザパターンDPおよびデコード表DCを読み込む(#201,202)。そして、コンピュータ本体11から送信されてきた圧縮データD2を受信し、その先頭から順に復元のための処理を行う。最初はデコード1によって復元する(#203)。   22 and 23, 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として、パターン番号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, using the accumulated value k1 as the representative value a, 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として、パターン番号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 dot pattern is restored using the dither pattern DP specified by the pattern number pn with the cumulative value k1 as the representative value a (# 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.

また、代表値aの算出のための処理を上下限テーブルTJKからデータを読み出すことで高速に行うことができ、全体の処理時間の短縮に大きく寄与する。また、高解像度領域TSの処理においては、8画素の画像データを1つの数値で読み替えるので、アドレス指示が速い。これによっても全体の処理時間の短縮が図られる。   Further, the processing for calculating the representative value a can be performed at high speed by reading data from the upper / lower limit table TJK, which greatly contributes to shortening the entire processing time. 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は、それを構成する各画素にドットを打つか打たないかをフラグのあるなしで表現することが可能である。濃度の高い画素に対してドットを打つようにしてもよいし、濃度の低い画素に対してドットを打つようにしてもよい。代表値aを求めるための画素の濃度値の最小値Jと最大値Kについても、濃度の低い画素に対してドットを打った場合を想定して求めてもよいし、濃度の高い画素に対してドットを打った場合を想定して求めてもよい。このように、階調性、濃度値、輝度値、および、それらとドットを打つ打たないことについて、種々の組み合わせを行うことが可能である。
〔第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. The minimum value J and the maximum value K of the pixel density values for obtaining the representative value a may also be calculated assuming that dots are shot on a pixel with low density, or for pixels with high density. It may be obtained assuming that a dot is hit. As described above, various combinations can be made with respect to the gradation, the density value, the luminance value, and not hitting the dots.
[Second]
Embodiment for Compressing 4-level Image Data Next, a case of compressing 4-level image data will be described. In this case, the case is basically the same as the case of compressing binary image data. is there. 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において、低解像度領域TLは、48個(6×8個)の画素TPからなる矩形の領域である。図25の例では、4値画像データD5の全体の領域が、左上から順に、低解像度領域TL1、TL2、TL3、…というようにTLmまで区画されている。
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 FIG. 25, the low resolution region TL is a rectangular region composed of 48 (6 × 8) pixels TP. 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,.

図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.

ここで、比較のために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階調の濃度が得られる。
〔代表値aの求め方〕
さて、画像データFDの各画素の濃度値が、ディザパターンDPの対応する画素のいずれかのしきい値以上であったときに、その画素のしきい値に対応してドットが打たれるものとする。つまり、この場合にドットを打つ打たないは、画素に対応してではなく画素に対応した3つの各しきい値に対応して、ということになる。なお、ここでは濃度値が大きいほど濃度が高いものとする。
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.
[How to find representative value a]
Now, when the density value of each pixel of the image data FD is equal to or higher than any threshold value of the corresponding pixel of the dither pattern DP, a dot is shot corresponding to the threshold value of that pixel. And That is, in this case, not hitting a dot means not corresponding to the pixel but corresponding to each of the three threshold values corresponding to the pixel. Here, the larger the density value, the higher the density.

その場合に、ある画素のしきい値でドットが打たれているときは、その画素の濃度値が対応するしきい値以上であったということができる。これは、その画素の濃度の下限値が、対応するしきい値と同じ値であった、と言い換えることができる。逆に、ドットが打たれていないときは、その画素の濃度値は対応するしきい値未満であったということになる。これは、その画素の濃度の上限値が、対応するしきい値より「1」だけ小さい値であった、と言い換えることができる。   In this case, when a dot is shot with a threshold value of a certain pixel, it can be said that the density value of that pixel is equal to or higher than the corresponding threshold value. In other words, the lower limit value of the density of the pixel is the same value as the corresponding threshold value. On the contrary, when a dot is not hit, it means that the density value of the pixel is less than the corresponding threshold value. In other words, the upper limit value of the density of the pixel is a value smaller by “1” than the corresponding threshold value.

このようにして、ディザパターンDPの各画素に割り当てられた各しきい値に対して、上限値および下限値を集計し、上限値の最小値Jおよび下限値の最大値Kを求める。そして、上と同様に、(2)式を満たす「a」を代表値とする。   In this way, the upper limit value and the lower limit value are totaled for each threshold value assigned to each pixel of the dither pattern DP, and the minimum value J of the upper limit value and the maximum value K of the lower limit value are obtained. Similarly to the above, “a” satisfying the expression (2) is set as a representative value.

(2)式を満たす「a」が複数ある場合、つまり、ある範囲(レンジ)の中に代表値aがある場合には、そのような代表値aのうち、隣り合う領域との代表値の差分が最小となる値を代表値aとして用いる。
〔低解像度領域、中解像度領域、高解像度領域〕
図29は低解像度領域TL、中解像度領域TM、および高解像度領域TSを示す図である。
When there are a plurality of “a” s that satisfy the expression (2), that is, when there is a representative value a within a certain range (range), the representative value of the adjacent region among such representative values a The value that minimizes the difference is used as the representative value a.
[Low resolution area, medium resolution area, high resolution area]
FIG. 29 is a diagram showing a low resolution area TL, a medium resolution area TM, and a high resolution area TS.

図29に示すように、低解像度領域TLは6×8画素の領域である。低解像度領域TLは、中解像度領域区画部104によって、3×4画素の4つの中解像度領域TMに区画される。中解像度領域TMは、必要に応じて、さらに4画素の3つの高解像度領域TSに区画される。
〔低解像度領域の処理〕
図25に示すように区画された低解像度領域TLについて、第1の場合と同様に、そのドットパターンとディザパターンDPとを比較し、これらが互いに一致しているか否かを判別する。一致している場合に、上に述べたように代表値aを求める。後は第1の場合と同様である。
〔中解像度領域の処理〕
図30は画像におけるドット数の差分の出現頻度の分布を表す図である。
As shown in FIG. 29, 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.
[Low-resolution area processing]
As in the first case, the low resolution region TL partitioned as shown in FIG. 25 is compared with the dot pattern and the dither pattern DP to determine whether or not they match each other. If they match, the representative value a is obtained as described above. The rest is the same as in the first case.
[Medium resolution area processing]
FIG. 30 is a diagram illustrating a distribution of appearance frequencies of the difference in the number of dots in an image.

中解像度代表値算出部106では、中解像度領域TMがディザパターンDPと一致した場合に、低解像度領域の場合と同様な処理によって、(2)式を満たす代表値aを求める。   In the medium resolution representative value calculation unit 106, when the medium resolution region TM matches the dither pattern DP, the representative value a satisfying the expression (2) is obtained by the same processing as in the case of the low resolution region.

そして、得られた代表値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.

図30に示すように、差分が「0」〜「30」程度および「200」〜「255」程度の範囲で出現頻度が高い。差分である0〜255の後に、「256」の値についての出現頻度が示されている。これの趣旨は低解像度領域TLの場合の属性コードと同様であり、「256」は、ある中解像度領域TMがいずれのディザパターンDPとも一致しなかったことを表す属性コードである。   As shown in FIG. 30, 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 region TL, and “256” is an attribute code indicating that a certain medium resolution region TM does not match any dither pattern DP.

つまり、中解像度領域TMにおいていずれのディザパターンDPとも一致しなかった場合に、コード2で「256」を出力し、領域をさらに高解像度領域TSに区画する。   That is, if no dither pattern DP matches in the medium resolution area TM, “256” is output as the code 2 to further divide the area into high resolution areas TS.

なお、第1に示す2値の場合には、中解像度領域TMは24画素であり、最大で24個のドットであったので、領域のドットの数を数えて代表値とした。しかし、第2に示す4値の場合では、共通化と処理の速さとを優先させ、上に述べたように濃度値を代表値とした。
〔フローチャートによる説明〕
次に、第1における処理について、フローチャートを参照して説明する。
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 first process will be described with reference to a flowchart.

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

つまり、図31において、1つの中解像度領域TMについてディザパターンDPと一致する場合には(#21でイエス)、ステップ#15と同様にして代表値aを求める(#22B)。そして、その差分をとり(#22)、符号化する(#23)。   That is, in FIG. 31, when one medium resolution area TM matches the dither pattern DP (Yes in # 21), the representative value a is obtained in the same manner as in Step # 15 (# 22B). Then, the difference is taken (# 22) and encoded (# 23).

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

図33において、いずれかのディザパターンDPと一致する場合に(#131でイエス)、その中解像度領域TMにおいて代表値aを取得してその差分を算出し(#132B)、代表値差分をコード2で符号化して出力する(#133B)。これを4回繰り返し、図20のステップ#113の低解像度領域TLの処理に戻る。   In FIG. 33, if it matches any of the dither patterns DP (Yes in # 131), the representative value a is acquired in the medium resolution area TM and the difference is calculated (# 132B), and the representative value difference is coded. 2 is encoded 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 the medium resolution area TM does not match any dither pattern DP, the attribute code “256” indicating that it does not match is encoded by code 2 and output (# 135B ), The process proceeds to step # 141 and subsequent steps which are processing of the high-resolution area TS.

図35において、ステップ#252Bにおいて、デコード2によって得られた値dc2が「256」でなければ、値dc2は代表値の差分であるので、それまでの累計値k2に値dc2を加算し、得られた値を新たな累計値k2とする(#253)。累計値k2が「255」を超えた場合には(#254Bでイエス)、代表値の最大値を超えているので、累計値k2から「256」を差し引く(#255B)。そして、累計値k2を代表値として、パターン番号pnで特定されるディザパターンDPを用いてドットパターンを再現する(#256)。   In FIG. 35, 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). When 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を用いてディザ処理が行われる。2値の画像データの場合には、代表値aとしきい値とを比較し、代表値aがしきい値以上であったときに「1」を、しきい値未満であったときに「0」を、それぞれ出力する。   In the decompression process, the dither process is performed using the dither pattern DP attached to the header portion of the compressed data D2. In the case of binary image data, the representative value a is compared with a threshold value. When the representative value a is greater than or equal to the threshold value, “1” is indicated, and when the representative value a is less than the threshold value, “0” is indicated. Are output respectively.

これに対して、4値の画像データの場合には、各画素に3個ずつしきい値が小さい順に配置されているので、代表値aとしきい値とを比較し、代表値a以下である最も大きなしきい値のインデックスの値(0〜3)に「1」を加算したものを出力する。代表値a以下のしきい値が存在しない場合には「0」を出力する。   On the other hand, in the case of quaternary image data, the threshold value is compared with the threshold value by comparing the representative value a with the threshold value because three threshold values are arranged for each pixel in ascending order. A value obtained by adding “1” to the index value (0 to 3) of the largest threshold value is output. If there is no threshold value less than the representative value a, “0” is output.

なお、10値の画像データの場合には、各画素に15個ずつしきい値が小さい順に配置されるので、代表値aとしきい値とを比較し、代表値a以下である最も大きなしきい値のインデックスの値(0〜14)に「1」を加算したものを出力する。代表値a以下のしきい値が存在しない場合には「0」を出力する。   In the case of 10-value image data, 15 threshold values are arranged for each pixel in ascending order, so that the representative threshold value a is compared with the threshold value, and the largest threshold value that is equal to or lower than the representative value a. A value obtained by adding “1” to the value (0 to 14) of the value index is output. If there is no threshold value less than the representative value a, “0” is output.

但し、インデックスとして、例えば4値のときに「1」〜「4」とした場合には、「1」を加算することなく、インデックスの値を出力すればよい。   However, when the index is set to “1” to “4”, for example, in the case of four values, the index value may be output without adding “1”.

上の実施形態において、擬似階調化として2値化および4値化を行ったが、3値化、8値化、16値化など、種々の値の多値化を行うことも可能である。   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. .

その他、コンピュータ本体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 example of an upper / lower limit table. 複数の低解像度領域についての代表値の推移の例を示す図である。It is a figure which shows the example of transition of the representative value about a some low resolution area | region. 循環整数の例を示す図である。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 showing distribution of the appearance frequency of the difference of the number of dots in an image. ドットパターンの数値化を説明するための図である。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 of the restoration process in a data restoration part. データ復元部における復元処理のフローチャートである。It is a flowchart of the restoration process in a data restoration part. 区画された低解像度領域を説明するための図である。It is a figure for demonstrating the divided low resolution area | region. 区画された低解像度領域を説明するための図である。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 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 restoration process in a data restoration part. データ復元部における復元処理のフローチャートである。It is a flowchart of the restoration process in a data restoration part.

符号の説明Explanation of symbols

1 プリントシステム
11 コンピュータ本体
13 プリンタ
100 圧縮データ作成部
101 低解像度領域区画部
102 低解像度比較部
103 低解像度代表値算出部
104 中解像度領域区画部
105 中解像度比較部
106 中解像度代表値算出部
107 ドットパターン抽出部
108 符号化部
109 データ送信部
300 データ復元部
D1 2値画像データ(擬似階調化された画像データ)
D2 圧縮データ
D5 4値画像データ(擬似階調化された画像データ)
DP ディザパターン
DP5 ディザパターン
TL 低解像度領域(所定の領域)
TM 中解像度領域(所定の領域)
TS 高解像度領域(所定の領域)
DESCRIPTION OF SYMBOLS 1 Print system 11 Computer main body 13 Printer 100 Compressed data creation part 101 Low resolution area | region division part 102 Low resolution comparison part 103 Low resolution representative value calculation part 104 Medium resolution area | region division part 105 Medium resolution comparison part 106 Medium resolution representative value calculation part 107 Dot pattern extraction unit 108 Coding unit 109 Data transmission unit 300 Data restoration unit D1 Binary image data (pseudo-gradation image data)
D2 Compressed data D5 Four-value image data (Pseudo gradation image data)
DP dither pattern DP5 dither pattern TL Low resolution area (predetermined area)
TM Medium resolution area (predetermined area)
TS High resolution area (predetermined area)

Claims (25)

ディザパターンを用いて擬似階調化された画像データを圧縮する方法であって、
前記画像データを所定の領域ごとに区画し、各領域内における画像データのドットの配列パターンが擬似階調化に用いられたディザパターンと一致するか否かを判別し、一致する場合にその領域における画像データの濃度に関する代表値を求め、求めた代表値を用いて圧縮データを作成する、
ことを特徴とする画像データの圧縮方法。
A method of compressing pseudo-gradated image data using a dither pattern,
The image data is divided into predetermined areas, and it is determined whether or not the dot arrangement pattern of the image data in each area matches the dither pattern used for pseudo-gradation. To obtain a representative value for the density of image data in and create compressed data using the obtained representative value,
A method for compressing image data.
前記代表値として、前記領域内における画像データの各画素の濃度値と前記ディザパターンの対応する部分の各画素の濃度値とをそれぞれ比較して前記画像データの各画素の濃度値が小さい場合に予め用意されたパターン領域にドットを打った場合に、前記領域内において打たれたドットに対応する前記ディザパターンの画素の濃度値の最小値Jと打たれなかったドットに対応する前記ディザパターンの画素の濃度値の最大値Kとの間で
J≧a≧K
の条件を満たすように求められる値aを用いる、
請求項1記載の画像データの圧縮方法。
When the density value of each pixel of the image data is small by comparing the density value of each pixel of the image data in the region with the density value of each pixel of the corresponding portion of the dither pattern as the representative value When a dot is hit in a pattern area prepared in advance, the minimum value J of the pixel density value of the dither pattern corresponding to the dot hit in the area and the dither pattern corresponding to the dot not hit J ≧ a ≧ K between the maximum density value K of the pixels
Using a value a that is required to satisfy the following condition:
The method of compressing image data according to claim 1.
前記代表値として、前記領域内における画像データの各画素の濃度値と前記ディザパターンの対応する部分の各画素の濃度値とをそれぞれ比較して前記画像データの各画素の濃度値が大きい場合に予め用意されたパターン領域にドットを打った場合に、前記領域内において打たれたドットに対応する前記ディザパターンの画素の濃度値の最大値Kと打たれなかったドットに対応する前記ディザパターンの画素の濃度値の最小値Jとの間で
J≧a≧K
の条件を満たすように求められる値aを用いる、
請求項1記載の画像データの圧縮方法。
When the density value of each pixel of the image data is large by comparing the density value of each pixel of the image data in the region with the density value of each pixel of the corresponding portion of the dither pattern as the representative value When dots are hit in a pattern area prepared in advance, the maximum density value K of the pixels of the dither pattern corresponding to the dots hit in the area and the dither pattern corresponding to the dots not hit J ≧ a ≧ K with the minimum value J of the density value of the pixel
Using a value a that is required to satisfy the following condition:
The method of compressing image data according to claim 1.
前記代表値として、隣り合う領域との代表値の差分が最小となる値を用いる、
請求項1ないし3のいずれかに記載の画像データの圧縮方法。
As the representative value, a value that minimizes the difference between the representative values of adjacent regions is used.
The image data compression method according to claim 1.
前記代表値として、前記領域内における画像データの各画素の濃度値と前記ディザパターンの対応する部分の各画素の濃度値とをそれぞれ比較して前記画像データの各画素の濃度値が小さい場合に予め用意されたパターン領域にドットを打った場合に、前記領域内において打たれたまたは打たれなかったドットの個数を用いる、
請求項1記載の画像データの圧縮方法。
When the density value of each pixel of the image data is small by comparing the density value of each pixel of the image data in the region with the density value of each pixel of the corresponding portion of the dither pattern as the representative value When a dot is hit in a pattern area prepared in advance, the number of dots hit or not hit in the area is used.
The method of compressing image data according to claim 1.
前記圧縮データを作成する際に、各領域において他の領域との代表値の差分を求め、求めた差分を符号化する、
請求項1ないし5のいずれかに記載の画像データの圧縮方法。
When creating the compressed data, in each area, obtain a difference between the representative values of the other areas, and encode the obtained difference.
6. A method for compressing image data according to claim 1.
擬似階調化に用いられたディザパターンが複数ある場合に、それら複数のディザパターンを切り換えて前記各領域内における画像データのドットの配列パターンと一致するか否かを判別する、
請求項1記載の画像データの圧縮方法。
When there are a plurality of dither patterns used for pseudo-gradation, it is determined whether the plurality of dither patterns are switched to match the dot arrangement pattern of the image data in each region.
The method of compressing image data according to claim 1.
前記領域内における画像データのドットの配列パターンが擬似階調化に用いられたディザパターンと一致しない場合に、当該領域をさらに複数の小領域に区画し、各小領域内における画像データのドットの配列パターンが前記ディザパターンと一致するか否かを判別する、
請求項1記載の画像データの圧縮方法。
When the dot pattern of the image data in the area does not match the dither pattern used for pseudo-gradation, the area is further divided into a plurality of small areas, and the dot of the image data in each small area Determining whether an array pattern matches the dither pattern;
The method of compressing image data according to claim 1.
前記領域における代表値として、前記領域内における画像データの各画素の濃度値と前記ディザパターンの対応する部分の各画素の濃度値とをそれぞれ比較して前記画像データの各画素の濃度値が小さい場合に予め用意されたパターン領域にドットを打った場合に、前記領域内において打たれたドットに対応する前記ディザパターンの画素の濃度値の最小値Jと打たれなかったドットに対応する前記ディザパターンの画素の濃度値の最大値Kとの間で
J≧a≧K
の条件を満たす値aを用い、
前記小領域における代表値として、前記領域内において打たれたまたは打たれなかったドットの個数を用いる、
請求項8記載の画像データの圧縮方法。
As the representative value in the area, the density value of each pixel of the image data in the area is compared with the density value of each pixel of the corresponding portion of the dither pattern, and the density value of each pixel of the image data is small. In this case, when a dot is applied to a pattern area prepared in advance, the dither pattern corresponding to the minimum value J of the pixel of the dither pattern corresponding to the dot applied in the area and the dither corresponding to the dot not applied J ≧ a ≧ K between the maximum density value K of the pattern pixels
Using a value a that satisfies the condition
As a representative value in the small area, the number of dots hit or not hit in the area is used,
The method of compressing image data according to claim 8.
前記領域における代表値として、前記領域内における画像データの各画素の濃度値と前記ディザパターンの対応する部分の各画素の濃度値とをそれぞれ比較して前記画像データの各画素の濃度値が大きい場合に予め用意されたパターン領域にドットを打った場合に、前記領域内において打たれたドットに対応する前記ディザパターンの画素の濃度値の最大値Kと打たれなかったドットに対応する前記ディザパターンの画素の濃度値の最小値Jとの間で
J≧a≧K
の条件を満たす値aを用い、
前記小領域における代表値として、前記領域内において打たれたまたは打たれなかったドットの個数を用いる、
請求項8記載の画像データの圧縮方法。
As a representative value in the area, the density value of each pixel of the image data in the area is compared with the density value of each pixel of the corresponding portion of the dither pattern, and the density value of each pixel of the image data is large. In this case, when a dot is applied to a pattern area prepared in advance, the dither pattern corresponding to the maximum value K of the pixel of the dither pattern corresponding to the dot applied in the area and the dither corresponding to the dot not applied J ≧ a ≧ K between the minimum value J of the density values of the pixels of the pattern
Using a value a that satisfies the condition
As a representative value in the small area, the number of dots hit or not hit in the area is used,
The method of compressing image data according to claim 8.
前記領域および前記小領域における代表値として、前記領域内または前記小領域内における画像データの各画素の濃度値と前記ディザパターンの対応する部分の各画素の濃度値とをそれぞれ比較して前記画像データの各画素の濃度値が小さい場合に予め用意されたパターン領域にドットを打った場合に、前記領域内または前記小領域内において打たれたドットに対応する前記ディザパターンの画素の濃度値の最小値Jと打たれなかったドットに対応する前記ディザパターンの画素の濃度値の最大値Kとの間で
J≧a≧K
の条件を満たす値aを用いる、
請求項8記載の画像データの圧縮方法。
As the representative value in the area and the small area, the density value of each pixel of the image data in the area or the small area is compared with the density value of each pixel in the corresponding portion of the dither pattern, respectively. When the density value of each pixel of the data is small, when a dot is shot in a pattern area prepared in advance, the density value of the pixel of the dither pattern corresponding to the dot hit in the area or the small area Between the minimum value J and the maximum density value K of the pixels of the dither pattern corresponding to the dot that has not been hit, J ≧ a ≧ K
A value a satisfying the condition
The method of compressing image data according to claim 8.
前記領域および前記小領域における代表値として、前記領域内または前記小領域内における画像データの各画素の濃度値と前記ディザパターンの対応する部分の各画素の濃度値とをそれぞれ比較して前記画像データの各画素の濃度値が大きい場合に予め用意されたパターン領域にドットを打った場合に、前記領域内または前記小領域内において打たれたドットに対応する前記ディザパターンの画素の濃度値の最大値Kと打たれなかったドットに対応する前記ディザパターンの画素の濃度値の最小値Jとの間で
J≧a≧K
の条件を満たす値aを用いる、
請求項8記載の画像データの圧縮方法。
As the representative value in the area and the small area, the density value of each pixel of the image data in the area or the small area is compared with the density value of each pixel in the corresponding portion of the dither pattern, respectively. When the density value of each pixel of the data is large, when the dot is hit in the pattern area prepared in advance, the density value of the pixel of the dither pattern corresponding to the dot hit in the area or the small area J ≧ a ≧ K between the maximum value K and the minimum value J of the density values of the pixels of the dither pattern corresponding to the dot that has not been hit
A value a satisfying the condition
The method of compressing image data according to claim 8.
前記圧縮データを作成する際に、各領域において他の領域との代表値の差分を求め、求めた差分を符号化する、
請求項8ないし12のいずれかに記載の画像データの圧縮方法。
When creating the compressed data, in each area, obtain a difference between the representative values of the other areas, and encode the obtained difference.
The method for compressing image data according to claim 8.
前記領域内または前記小領域内における画像データのドットの配列パターンが擬似階調化に用いられたディザパターンと一致しない場合に、当該領域内または前記小領域内において打たれたまたは打たれなかったドットの配列を符号化することによって前記圧縮データを作成する、
請求項8ないし13のいずれかに記載の画像データの圧縮方法。
When the dot arrangement pattern of the image data in the area or in the small area does not match the dither pattern used for pseudo-gradation, it was hit or not hit in the area or in the small area Creating the compressed data by encoding an array of dots;
The method for compressing image data according to claim 8.
ディザパターンを用いて擬似階調化された画像データを圧縮する方法であって、
前記画像データを所定の領域ごとに区画する第1のステップと、
各領域内における画像データのドットの配列パターンが擬似階調化に用いられたディザパターンと一致するか否かを判別する第2のステップと、
前記第2のステップにおける判別の結果が一致する場合に、当該領域における画像データの濃度に関する代表値を、前記領域内における画像データの各画素の濃度値と前記ディザパターンの対応する部分の各画素の濃度値とをそれぞれ比較して前記画像データの各画素の濃度値が小さい場合に予め用意されたパターン領域にドットを打った場合に、前記パターン領域に打たれたドットに対応する前記ディザパターンの画素の濃度値の最小値Jと打たれなかったドットに対応する前記ディザパターンの画素の濃度値の最大値Kとの間で
J≧a≧K
の条件を満たす値aとして求める第3のステップと、
前記第2のステップにおける判別の結果が一致しない場合に、当該領域をさらに複数の小領域に区画し、各小領域内における画像データのドットの配列パターンが前記ディザパターンと一致するか否かを判別する第4のステップと、
前記第4のステップにおける判別の結果が一致する場合に、前記小領域における代表値として、前記領域内において打たれたまたは打たれなかったドットの個数を求める第5のステップと、
前記第4のステップにおける判別の結果が一致しない場合に、当該小領域におけるドットの配列を符号化する第6のステップと、
前記第2のステップまたは前記第4のステップにおける判別の結果が一致する場合に、求めた代表値に基づいて符号化を行う第7のステップと、
を有することを特徴とする画像データの圧縮方法。
A method of compressing pseudo-gradated image data using a dither pattern,
A first step of dividing the image data into predetermined areas;
A second step of determining whether or not the dot arrangement pattern of the image data in each region matches the dither pattern used for pseudo-gradation;
If the determination result in the second step matches, the representative value related to the density of the image data in the area is set as the density value of each pixel of the image data in the area and each pixel of the corresponding portion of the dither pattern. The dither pattern corresponding to the dot hit in the pattern area when the dot value is hit in the pattern area prepared in advance when the density value of each pixel of the image data is small J ≧ a ≧ K between the minimum value J of the pixel density value J and the maximum density value K of the pixel of the dither pattern corresponding to the dot that has not been hit
A third step for obtaining a value a that satisfies the following condition:
When the determination result in the second step does not match, the area is further divided into a plurality of small areas, and whether or not the dot arrangement pattern of the image data in each small area matches the dither pattern. A fourth step of determining;
A fifth step of obtaining the number of dots hit or not hit in the area as a representative value in the small area when the determination results in the fourth step match;
A sixth step of encoding an array of dots in the small region when the result of determination in the fourth step does not match;
A seventh step of performing encoding based on the obtained representative value when the determination results in the second step or the fourth step match;
A method for compressing image data, comprising:
ディザパターンを用いて擬似階調化された画像データを圧縮する方法であって、
前記画像データを所定の領域ごとに区画する第1のステップと、
各領域内における画像データのドットの配列パターンが擬似階調化に用いられたディザパターンと一致するか否かを判別する第2のステップと、
前記第2のステップにおける判別の結果が一致する場合に、当該領域における画像データの濃度に関する代表値を、前記領域内における画像データの各画素の濃度値と前記ディザパターンの対応する部分の各画素の濃度値とをそれぞれ比較して前記画像データの各画素の濃度値が大きい場合に予め用意されたパターン領域にドットを打った場合に、前記パターン領域に打たれたドットに対応する前記ディザパターンの画素の濃度値の最大値Kと打たれなかったドットに対応する前記ディザパターンの画素の濃度値の最小値Jとの間で
J≧a≧K
の条件を満たす値aとして求める第3のステップと、
前記第2のステップにおける判別の結果が一致しない場合に、当該領域をさらに複数の小領域に区画し、各小領域内における画像データのドットの配列パターンが前記ディザパターンと一致するか否かを判別する第4のステップと、
前記第4のステップにおける判別の結果が一致する場合に、前記小領域における代表値として、前記領域内において打たれたまたは打たれなかったドットの個数を求める第5のステップと、
前記第4のステップにおける判別の結果が一致しない場合に、当該小領域におけるドットの配列を符号化する第6のステップと、
前記第2のステップまたは前記第4のステップにおける判別の結果が一致する場合に、求めた代表値に基づいて符号化を行う第7のステップと、
を有することを特徴とする画像データの圧縮方法。
A method of compressing pseudo-gradated image data using a dither pattern,
A first step of dividing the image data into predetermined areas;
A second step of determining whether or not the dot arrangement pattern of the image data in each region matches the dither pattern used for pseudo-gradation;
If the determination result in the second step matches, the representative value related to the density of the image data in the area is set as the density value of each pixel of the image data in the area and each pixel of the corresponding portion of the dither pattern. The dither pattern corresponding to the dot hit in the pattern area when the dot value is hit in a pattern area prepared in advance when the density value of each pixel of the image data is large J ≧ a ≧ K between the maximum value K of the density values of the pixels of the pixel and the minimum value J of the density values of the pixels of the dither pattern corresponding to the dots that have not been hit.
A third step for obtaining a value a that satisfies the following condition:
When the determination result in the second step does not match, the area is further divided into a plurality of small areas, and whether or not the dot arrangement pattern of the image data in each small area matches the dither pattern. A fourth step of determining;
A fifth step of obtaining the number of dots hit or not hit in the area as a representative value in the small area when the determination results in the fourth step match;
A sixth step of encoding an array of dots in the small region when the result of determination in the fourth step does not match;
A seventh step of performing encoding based on the obtained representative value when the determination results in the second step or the fourth step match;
A method for compressing image data, comprising:
ディザパターンを用いて擬似階調化された画像データを圧縮する方法であって、
前記画像データを所定の領域ごとに区画する第1のステップと、
各領域内における画像データのドットの配列パターンが擬似階調化に用いられたディザパターンと一致するか否かを判別する第2のステップと、
前記第2のステップにおける判別の結果が一致する場合に、当該領域における画像データの濃度に関する代表値を、前記領域内における画像データの各画素の濃度値と前記ディザパターンの対応する部分の各画素の濃度値とをそれぞれ比較して前記画像データの各画素の濃度値が大きい場合に予め用意されたパターン領域にドットを打った場合に、前記パターン領域に打たれたドットに対応する前記ディザパターンの画素の濃度値の最大値Kと打たれなかったドットに対応する前記ディザパターンの画素の濃度値の最小値Jとの間で
J≧a≧K
の条件を満たす値aとして求める第3のステップと、
前記第2のステップにおける判別の結果が一致しない場合に、当該領域をさらに複数の小領域に区画し、各小領域内における画像データのドットの配列パターンが前記ディザパターンと一致するか否かを判別する第4のステップと、
前記第4のステップにおける判別の結果が一致する場合に、前記小領域における代表値として、前記第3のステップと同じ処理によって代表値を求める第5のステップと、
前記第4のステップにおける判別の結果が一致しない場合に、当該小領域におけるドットの配列を符号化する第6のステップと、
前記第2のステップまたは前記第4のステップにおける判別の結果が一致する場合に、求めた代表値に基づいて符号化を行う第7のステップと、
を有することを特徴とする画像データの圧縮方法。
A method of compressing pseudo-gradated image data using a dither pattern,
A first step of dividing the image data into predetermined areas;
A second step of determining whether or not the dot arrangement pattern of the image data in each region matches the dither pattern used for pseudo-gradation;
If the determination result in the second step matches, the representative value related to the density of the image data in the area is set as the density value of each pixel of the image data in the area and each pixel of the corresponding portion of the dither pattern. The dither pattern corresponding to the dot hit in the pattern area when the dot value is hit in a pattern area prepared in advance when the density value of each pixel of the image data is large J ≧ a ≧ K between the maximum value K of the density values of the pixels of the pixel and the minimum value J of the density values of the pixels of the dither pattern corresponding to the dots that have not been hit.
A third step for obtaining a value a that satisfies the following condition:
When the determination result in the second step does not match, the area is further divided into a plurality of small areas, and whether or not the dot arrangement pattern of the image data in each small area matches the dither pattern. A fourth step of determining;
A fifth step of obtaining a representative value by the same process as the third step as a representative value in the small region when the determination results in the fourth step match;
A sixth step of encoding an array of dots in the small region when the result of determination in the fourth step does not match;
A seventh step of performing encoding based on the obtained representative value when the determination results in the second step or the fourth step match;
A method for compressing image data, comprising:
前記代表値として、隣り合う領域との代表値の差分が最小となる値を用いる、
請求項15ないし17のいずれかに記載の画像データの圧縮方法。
As the representative value, a value that minimizes the difference between the representative values of adjacent regions is used.
18. The method for compressing image data according to claim 15.
前記第7のステップにおいて、各領域において他の領域との代表値の差分を求め、求めた差分を符号化する、
請求項15ないし18のいずれかに記載の画像データの圧縮方法。
In the seventh step, a difference between representative values in each area and other areas is obtained, and the obtained difference is encoded.
The method for compressing image data according to claim 15.
前記擬似階調化された画像データは、2値の画像データである、
請求項1ないし19のいずれかに記載の画像データの圧縮方法。
The pseudo gradation image data is binary image data.
20. The method for compressing image data according to claim 1.
前記擬似階調化された画像データは、多値の画像データである、
請求項1ないし19のいずれかに記載の画像データの圧縮方法。
The pseudo gradation image data is multi-value image data.
20. The method for compressing image data according to claim 1.
請求項1ないし21のいずれかに記載の方法によって圧縮された画像データを復元する方法であって、
圧縮された画像データから各領域の代表値を取得し、取得した代表値と前記ディザパターンとを比較してドットパターンを再現する、
ことを特徴とする画像データの復元方法。
A method for restoring image data compressed by the method according to any one of claims 1 to 21, comprising:
Obtain a representative value of each area from the compressed image data, and compare the acquired representative value with the dither pattern to reproduce the dot pattern,
A method for restoring image data.
ディザパターンを用いて擬似階調化された画像データを圧縮する装置であって、
前記画像データを所定の領域ごとに区画する手段と、
各領域内における画像データのドットの配列パターンが擬似階調化に用いられたディザパターンと一致するか否かを判別する手段と、
一致する場合にその領域における画像データの濃度に関する代表値を求める手段と、
求めた代表値を用いて圧縮データを作成する手段と、
を有することを特徴とする画像データの圧縮装置。
An apparatus for compressing pseudo-gradated image data using a dither pattern,
Means for dividing the image data into predetermined areas;
Means for determining whether or not the dot pattern of image data in each region matches the dither pattern used for pseudo-gradation;
Means for obtaining a representative value for the density of the image data in the area when they match,
Means for creating compressed data using the obtained representative value;
A compression apparatus for image data, comprising:
前記代表値を求める手段は、前記代表値として、隣り合う領域との代表値の差分が最小となる値を用いる、
請求項23記載の画像データの圧縮装置。
The means for obtaining the representative value uses, as the representative value, a value that minimizes the difference between the representative values from adjacent regions.
24. The apparatus for compressing image data according to claim 23.
前記圧縮データを作成する手段は、各領域において他の領域との代表値の差分を求め、求めた差分を符号化する、
請求項23または24記載の画像データの圧縮装置。
The means for creating the compressed data obtains a difference between representative values of each region and the other region, and encodes the obtained difference.
The image data compression apparatus according to claim 23 or 24.
JP2004377575A 2004-09-28 2004-12-27 Image data compression method and apparatus Expired - Fee Related JP4529681B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2004377575A JP4529681B2 (en) 2004-09-28 2004-12-27 Image data compression method and apparatus
US11/318,046 US7586649B2 (en) 2004-12-27 2005-12-23 Method and device for compressing image data

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2004282050 2004-09-28
JP2004377575A JP4529681B2 (en) 2004-09-28 2004-12-27 Image data compression method and apparatus

Publications (2)

Publication Number Publication Date
JP2006129413A true JP2006129413A (en) 2006-05-18
JP4529681B2 JP4529681B2 (en) 2010-08-25

Family

ID=36723564

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004377575A Expired - Fee Related JP4529681B2 (en) 2004-09-28 2004-12-27 Image data compression method and apparatus

Country Status (1)

Country Link
JP (1) JP4529681B2 (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06152986A (en) * 1992-11-10 1994-05-31 Fuji Xerox Co Ltd Picture compressing method and device
JPH09275499A (en) * 1996-04-04 1997-10-21 Canon Inc Device and method for processing image

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06152986A (en) * 1992-11-10 1994-05-31 Fuji Xerox Co Ltd Picture compressing method and device
JPH09275499A (en) * 1996-04-04 1997-10-21 Canon Inc Device and method for processing image

Also Published As

Publication number Publication date
JP4529681B2 (en) 2010-08-25

Similar Documents

Publication Publication Date Title
US7844120B2 (en) Method and device for compressing image data
JP4418762B2 (en) Image encoding apparatus, image decoding apparatus, control method thereof, computer program, and computer-readable storage medium
US8213727B2 (en) Image encoding apparatus and image decoding apparatus, and control method thereof
US7710605B2 (en) Print system and printer
JP4522199B2 (en) Image encoding apparatus, image processing apparatus, control method therefor, computer program, and computer-readable storage medium
JPWO2004068844A1 (en) Image compression method, image restoration method, program, and apparatus
US7746501B2 (en) Method and device for compressing image data
JP4871822B2 (en) Image coding apparatus and control method thereof
JPH11168632A (en) Binary expression processing method for dither image, method for uncompressing dither image expressed in compression binary representation and compression and uncompression system for dither image
US7586649B2 (en) Method and device for compressing image data
JP4529681B2 (en) Image data compression method and apparatus
KR101454208B1 (en) Method and apparatus for encoding/decoding halftone image
JP4696738B2 (en) Image data compression method and apparatus, and pseudo gradation image restoration method
US5684603A (en) Coding apparatus for bi-level images halftoned with error diffusion algorithm
JP4753007B2 (en) Image encoding apparatus, image decoding apparatus, and programs thereof
JP4719924B2 (en) Image processing apparatus and image processing method
JP2010074444A (en) Image compression apparatus and method, image decoding apparatus and method, and computer program
JP4971881B2 (en) Image encoding apparatus, image decoding apparatus, and control method thereof
JP4743884B2 (en) Image coding apparatus and control method thereof
JP4743883B2 (en) Image coding apparatus and control method thereof
JP3259989B2 (en) Binary and multi-valued mixed coded image data restoration method and apparatus
JP4753006B2 (en) Image encoding apparatus, image decoding apparatus, and programs thereof
JP4377352B2 (en) Data compression apparatus and data compression program
JP4633577B2 (en) Data compression apparatus and data compression program
JPH06311372A (en) Data compression method and device for binary picture

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20071017

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20100218

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20100223

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20100416

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

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20100531

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20130618

Year of fee payment: 3

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313111

R360 Written notification for declining of transfer of rights

Free format text: JAPANESE INTERMEDIATE CODE: R360

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

LAPS Cancellation because of no payment of annual fees