JPH07170410A - Color image data compression method - Google Patents

Color image data compression method

Info

Publication number
JPH07170410A
JPH07170410A JP5342210A JP34221093A JPH07170410A JP H07170410 A JPH07170410 A JP H07170410A JP 5342210 A JP5342210 A JP 5342210A JP 34221093 A JP34221093 A JP 34221093A JP H07170410 A JPH07170410 A JP H07170410A
Authority
JP
Japan
Prior art keywords
data
compression
line
compressed
color information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP5342210A
Other languages
Japanese (ja)
Inventor
Katsushi Yamamori
克史 山森
Emi Takahashi
恵美 高橋
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.)
Kokusai Electric Corp
Original Assignee
Kokusai Electric Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Kokusai Electric Corp filed Critical Kokusai Electric Corp
Priority to JP5342210A priority Critical patent/JPH07170410A/en
Publication of JPH07170410A publication Critical patent/JPH07170410A/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Processing (AREA)
  • Compression Of Band Width Or Redundancy In Fax (AREA)

Abstract

PURPOSE:To attain efficient compression of color image data whose notation scale exceeds binary with the simple method employing the run length coding compression technology aiming at a conventional binary image. CONSTITUTION:Color information is read in the unit of horizontal lines, and a comparator means 32 compares the read color information with that of a preceding line as to whether or not they are identical to each other. Then a same color discrimination means 33 discriminates whether or not all pixels have the same color, a compression arithmetic means 34 counts number of pixels in the compression unit being consecutive pixels having same color information, replaces the count into a numeral or bits having specific values whose number is equal to the pixel number. Then the processing is sequentially repeated as to all compression units in the horizontal lines to generate compression data, and finally a data length comparison means 35 compares a compressed data quantity with a data quantity before compression and when the compression data quantity is not less than the data quantity before compression, the data before compression are adopted for compressed data in this color image data compression method.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、パーソナルコンピュー
タ等に用いられるカラーグラフィック表示データ等のカ
ラー画像データ圧縮方法に係り、特にカラー画像データ
を簡単な方法で圧縮することができるカラー画像データ
圧縮方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a method for compressing color image data such as color graphic display data used in personal computers and the like, and more particularly to a method for compressing color image data capable of compressing color image data by a simple method. Regarding

【0002】[0002]

【従来の技術】従来、FAX等の2値画像データの画像
データ圧縮方法は、走査、光電変換の過程でディジタル
化処理(標本化・量子化処理)され、1(黒)、0
(白)のパルスに変換された画信号中の、黒又は白の画
素の連続する長さ(ランレングス)を符号に置き換える
ランレングス符号化圧縮技術が代表的なものであった
(オーム社,「画像情報圧縮」原島博監修,p150
平成3年8月25日発行,参照)。
2. Description of the Related Art Conventionally, an image data compression method for binary image data such as FAX is digitized (sampling / quantized) in the process of scanning and photoelectric conversion, and 1 (black), 0.
A typical run length encoding / compression technique is to replace a continuous length (run length) of black or white pixels in a picture signal converted into a (white) pulse with a code (Ohm Co., Ltd., "Image information compression" Supervised by Hiroshi Harashima, p150
Issued August 25, 1991, see).

【0003】[0003]

【発明が解決しようとする課題】しかしながら、上記従
来の画像データ圧縮方法では、白黒の2色(2値)だけ
を対象とした白黒画像データの圧縮技術には対応できる
ものの、カラー画像データの圧縮技術に関してはカラー
情報をも含めて圧縮することが考慮されていない為に、
従来のランレングス符号化圧縮技術をもってカラー画像
データを圧縮することができないという問題点があっ
た。
However, although the above-mentioned conventional image data compression method can be applied to the compression technique of monochrome image data for only two colors (binary) of black and white, the compression of color image data is performed. As for the technology, since compression including color information is not considered,
There is a problem in that color image data cannot be compressed by the conventional run-length coding compression technique.

【0004】また、カラー画像データについてもいろい
ろな圧縮技術(日経エレクトロニクス 1993,5−
10 no.580「データ圧縮技術」p93,参照)
があるが、いずれの圧縮技術も複雑であり、カラー画像
データを容易に圧縮することができないという問題点が
あった。
Various color compression techniques are also applied to color image data (Nikkei Electronics 1993, 5-
10 no. 580 "Data compression technology" p93, see)
However, all of the compression techniques are complicated and there is a problem in that color image data cannot be easily compressed.

【0005】本発明は上記実情に鑑みて為されたもの
で、2値を越えるカラー画像データを、従来の2値画像
を対象にしたランレングス符号化圧縮技術を応用した簡
単な方法で容易に効率よく圧縮することができるカラー
画像データ圧縮方法を提供することを目的とする。
The present invention has been made in view of the above situation, and color image data having more than two values can be easily processed by a simple method to which a conventional run-length coding / compression technique for binary images is applied. It is an object of the present invention to provide a color image data compression method capable of efficient compression.

【0006】[0006]

【課題を解決するための手段】上記従来例の問題点を解
決するための請求項1記載の発明は、1画面の画像デー
タから水平ライン単位にカラー情報を読み込み、前ライ
ンのカラー情報と処理対象ラインのカラー情報とが同一
であるかを比較し、同一であれば前ラインと同一のカラ
ー情報であることを意味するコマンドを圧縮ラインデー
タとするラインデータ比較処理ステップと、前記前ライ
ンのカラー情報と前記処理対象ラインのカラー情報とが
同一ではない場合に、前記処理対象ライン内の全ピクセ
ルが同一カラー情報であるか判定し、同一カラー情報で
あれば全ピクセルが同一のカラー情報であることを意味
するコマンドと前記カラー情報とを圧縮ラインデータと
する同一色判定処理ステップと、前記処理対象ライン内
の全ピクセルが同一のカラー情報ではない場合に、同一
のカラー情報を持つ連続するピクセルを圧縮単位として
圧縮演算を行い、前記処理対象ライン内の前記全圧縮単
位について繰り返し圧縮演算を行った結果を順次付加し
て圧縮データを作成する圧縮演算処理ステップと、前記
圧縮演算処理ステップ実行後に、前記圧縮データのデー
タ長の値と前記圧縮演算前のデータ長の値とを比較し
て、前記圧縮データのデータ長の値の方が小さい場合は
圧縮演算処理を施したデータを意味するコマンドと圧縮
データのデータ長の値と圧縮データとを圧縮ラインデー
タとし、前記圧縮データのデータ長の値の方が小さくな
い場合は、前記圧縮演算前のデータを意味するコマンド
と前記圧縮演算前のデータとを圧縮ラインデータとする
データ長比較処理ステップとを有することを特徴として
いる。
According to a first aspect of the present invention for solving the above-mentioned problems of the prior art, color information is read in horizontal line units from image data of one screen, and the color information of the previous line and processing are performed. The line data comparison processing step of comparing the color information of the target line with the color information of the target line, and if the color information of the target line is the same, the command indicating that the color information is the same as the color information of the previous line is used as the compressed line data. When the color information and the color information of the processing target line are not the same, it is determined whether all the pixels in the processing target line have the same color information. If the same color information, all the pixels have the same color information. The same color determination processing step in which the command indicating that there is and the color information are compressed line data and all pixels in the processing target line are the same. If the color information is not the color information, the compression operation is performed using consecutive pixels having the same color information as the compression unit, and the result of repeatedly performing the compression operation on all the compression units in the processing target line is sequentially added and compressed. A value of the data length of the compressed data is compared by comparing the value of the data length of the compressed data with the value of the data length before the compression operation after the compression operation processing step of creating data and the execution of the compression operation processing step. Is smaller, the command meaning the data subjected to the compression calculation process, the value of the data length of the compressed data, and the compressed data are the compressed line data, and when the value of the data length of the compressed data is not smaller, A data length comparison processing step in which the command meaning the data before the compression operation and the data before the compression operation are compressed line data It is characterized by a door.

【0007】上記従来例の問題点を解決するための請求
項2記載の発明は、請求項1記載の圧縮演算処理ステッ
プが、圧縮単位に圧縮演算処理を施した圧縮単位データ
として、前記圧縮単位の始まりを示すカラー変更ビット
と、前記圧縮単位でのカラー情報と、次に続くピクセル
連続情報の種別を表すブロック/非ブロック情報ビット
と、前記圧縮単位内のピクセル数を示すピクセル連続情
報とで構成される圧縮単位データを作成するのに、カラ
ー変更ビットを設定し、前記圧縮単位のカラー情報を設
定し、前記圧縮単位の境界をピクセルのカラー情報の変
化により検出するまで、前記圧縮単位内のピクセル数を
カウントし、前記カウントした圧縮単位中のピクセル数
が前記ピクセル連続情報のビット数より大きい場合は、
前記ブロック/非ブロック情報ビットをブロック情報と
して設定し、それに続く前記ピクセル連続情報として前
記ピクセル数を数値で設定して圧縮単位データを作成
し、前記ピクセル数が前記ピクセル連続情報のビット数
より大きくない場合は、前記ブロック/非ブロック情報
ビットを非ブロック情報として設定し、それに続く前記
ピクセル連続情報として前記ピクセル数と同数の特定の
値を持つビットを設定して圧縮単位データを作成し、前
記処理対象ライン中の全圧縮単位について繰り返し圧縮
演算を行って圧縮単位データを付加していって1ライン
分の圧縮データを作成することを特徴としている。
According to a second aspect of the present invention for solving the above-mentioned problems of the conventional example, the compression operation processing step according to the first aspect uses the compression unit as compression unit data obtained by performing compression operation processing on the compression unit. A color change bit indicating the beginning of a block, color information in the compression unit, a block / non-block information bit indicating the type of the following pixel continuity information, and pixel continuity information indicating the number of pixels in the compression unit. Within the compression unit, the color change bit is set, the color information of the compression unit is set, and the boundary of the compression unit is detected by the change of the color information of the pixel to create the compression unit data to be constructed. If the number of pixels in the counted compression unit is larger than the number of bits of the pixel continuous information,
The block / non-block information bit is set as block information, and the number of pixels is set as a numerical value as the subsequent pixel continuity information to create compression unit data, and the number of pixels is larger than the number of bits of the continuous pixel information. If not, the block / non-block information bit is set as non-block information, and the subsequent bits of the pixel continuity information are set with bits having a specific value equal to the number of pixels to create compression unit data. It is characterized in that the compression unit data is added by repeatedly performing the compression calculation for all the compression units in the processing target line to create the compressed data for one line.

【0008】[0008]

【作用】請求項1記載の発明によれば、1画面の画像デ
ータから水平ライン単位にカラー情報を読み込み、前ラ
インのカラー情報と処理対象ラインのカラー情報とを比
較して同一であれば前ラインと同一のカラー情報である
ことを意味するコマンドを圧縮ラインデータとし、処理
対象ライン内の全ピクセルが同一カラー情報であれば全
ピクセルが同一のカラー情報であることを意味するコマ
ンドとカラー情報とを圧縮ラインデータとし、それ以外
の場合は同一のカラー情報を持つ連続するピクセルを圧
縮単位として、処理対象ライン内の全圧縮単位について
繰り返し圧縮演算を行い、その結果を順次付加して圧縮
データを作成し、圧縮データのデータ長と圧縮演算前の
データ長とを比較して、圧縮データのデータ長の方が小
さい場合は圧縮演算処理を施したデータを意味するコマ
ンドと圧縮データのデータ長と圧縮データとを圧縮ライ
ンデータとし、圧縮データのデータ長の方が小さくない
場合は、圧縮演算前のデータを意味するコマンドと圧縮
演算前のデータとを圧縮ラインデータとするカラー画像
データ圧縮方法としているので、前ラインと同一のカラ
ー情報のラインと全ピクセル同一色のラインには複雑な
圧縮演算を施さずに圧縮データを作成することができ、
また圧縮演算後に、圧縮前後のデータ長を比較し、デー
タ長の値の小さい方のデータを採用して圧縮データとす
るので、従来の2値画像を対象にしたランレングス符号
化圧縮技術を応用した簡単な方法で容易に効率よくカラ
ー画像データを圧縮することができ、特に色変化が少な
い画像について圧縮効率を上げることができ、また圧縮
演算によって圧縮効果の上がらないパターンのラインが
含まれていても圧縮効率を劣化させずに圧縮することが
できる。
According to the present invention, the color information is read from the image data of one screen in units of horizontal lines, the color information of the previous line and the color information of the line to be processed are compared, and if they are the same, the previous A command and color information that means that all pixels have the same color information if all the pixels in the line to be processed have the same color information Are used as compressed line data, and in other cases, consecutive pixels having the same color information are used as compression units, and repeated compression operations are performed for all compression units in the line to be processed, and the results are sequentially added to obtain compressed data. Is created and the data length of the compressed data is compared with the data length before the compression operation, and if the data length of the compressed data is smaller, the compression operation is performed. The command meaning the processed data, the data length of the compressed data and the compressed data are the compressed line data, and if the data length of the compressed data is not smaller, the command meaning the data before the compression operation and the compressed operation. Since the color image data compression method uses the previous data as the compressed line data, the compressed data is created without performing a complicated compression operation on the line of the same color information as the previous line and the line of the same color for all pixels. It is possible,
Also, after the compression operation, the data length before and after compression is compared, and the data with the smaller data length value is adopted as the compressed data, so the conventional run-length encoding compression technology for binary images is applied. The color image data can be easily and efficiently compressed by the simple method described above, and the compression efficiency can be improved especially for images with little color change, and the line of the pattern that does not improve the compression effect by the compression operation is included. However, the compression can be performed without degrading the compression efficiency.

【0009】請求項2記載の発明によれば、請求項1記
載の圧縮演算処理ステップが、水平ライン単位のカラー
情報を連続する同一カラーピクセルからなる圧縮単位に
分けて圧縮演算を行い、圧縮単位の境界をピクセルのカ
ラー情報の変化により検出するまで圧縮単位内のピクセ
ル数をカウントし、ピクセル数の大きさによって、ピク
セル数を数値で設定するか、又はピクセル数と同数の特
定の値を持つビットに置き換えて圧縮単位データを作成
し、処理対象ライン中の全圧縮単位について繰り返し圧
縮演算を行い圧縮単位データを付加していって1ライン
分の圧縮ラインデータを作成するカラー画像データ圧縮
方法としているので、連続する同一カラーのピクセル数
を数値などに置き換える簡単なロジックで圧縮ラインデ
ータを作成することができ、従来の2値画像を対象にし
たランレングス符号化圧縮技術を応用した簡単な方法で
容易に2値を越えるカラー画像データを圧縮することが
できる。
According to a second aspect of the present invention, the compression calculation processing step according to the first aspect divides the color information in units of horizontal lines into compression units made up of consecutive same color pixels, and performs the compression calculation. The number of pixels in the compression unit is counted until the boundary of is detected by the change of the color information of the pixel, and the number of pixels is set numerically or has a specific value equal to the number of pixels depending on the size of the number of pixels. As a color image data compression method in which compressed line data is created by substituting bits, and compressed line data is added by repeatedly performing compression operation for all compression units in the processing target line to create compressed line data for one line. Therefore, compressed line data can be created with simple logic that replaces the number of consecutive pixels of the same color with numerical values. Can be, it can be easily compressed color image data exceeding the binary in a simple manner of applying run-length encoding compression techniques a conventional binary image to the subject.

【0010】[0010]

【実施例】本発明の一実施例について図面を参照しなが
ら説明する。図1は、本発明の一実施例に係るカラー画
像データ圧縮方法を実現する概念構成ブロック図であ
る。
DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment of the present invention will be described with reference to the drawings. FIG. 1 is a conceptual configuration block diagram for realizing a color image data compression method according to an embodiment of the present invention.

【0011】本実施例の画像データ圧縮方法は、図1に
示すように、1画面分のカラー画像データを格納する画
像データエリア10と、画像データエリア10のカラー
画像データに圧縮処理を施す画像データ圧縮手段30
と、圧縮後の画像データを格納する圧縮画像データエリ
ア60とで構成され、更に画像データ圧縮手段30にお
いて画像データエリア10から水平ライン単位で画像デ
ータを取り込んで圧縮処理を行うためのラインデータエ
リア21と、ラインデータ退避エリア22と、ラインデ
ータ数エリア23と、圧縮ラインデータエリア50とが
設けられており、また画像データ圧縮処理30において
圧縮単位を検知して圧縮演算を行うための同一カラーカ
ウンタ40と、圧縮データ長カウンタ41と、ピクセル
ポインタ45と、カラー情報退避エリア46と、圧縮デ
ータワークエリア47とが設けられている。
In the image data compression method of this embodiment, as shown in FIG. 1, an image data area 10 for storing color image data for one screen and an image to be subjected to compression processing on the color image data in the image data area 10. Data compression means 30
And a compressed image data area 60 for storing the compressed image data, and a line data area for taking in image data in horizontal line units from the image data area 10 and performing compression processing in the image data compression means 30. 21, a line data save area 22, a line data number area 23, and a compressed line data area 50 are provided, and the same color for detecting the compression unit and performing compression calculation in the image data compression processing 30. A counter 40, a compressed data length counter 41, a pixel pointer 45, a color information save area 46, and a compressed data work area 47 are provided.

【0012】一方、水平ライン単位で圧縮処理を行う画
像データ圧縮手段30の内部には、ヘッダ作成手段31
と、ラインデータ比較手段32と、同一色判定手段33
と、圧縮演算手段34と、データ長比較手段35と、ラ
インデータ出力手段36とが設けられている。
On the other hand, inside the image data compression means 30 for performing the compression processing in units of horizontal lines, a header creation means 31 is provided.
, Line data comparison means 32, and same color determination means 33
A compression calculation means 34, a data length comparison means 35, and a line data output means 36 are provided.

【0013】更に、図1における各部の構成について具
体的に説明する。画像データエリア10は、1画面分の
画像データを格納するエリアである。そして画像データ
エリア10の画像データは複数のピクセル(画素)で構
成され、各ピクセルの表示色を示すカラー情報の大きさ
は適応するシステムによって異なるので、ここではNビ
ットとして説明する。通常、画像データエリア10のデ
ータは、パーソナルコンピュータ等で記憶媒体から読み
込んだり、あるいは通信回線等を通して外部から伝送さ
れてきた画像データを1画面分づつ格納するようになっ
ている。
Further, the configuration of each part in FIG. 1 will be specifically described. The image data area 10 is an area for storing image data for one screen. The image data in the image data area 10 is made up of a plurality of pixels (pixels), and the size of the color information indicating the display color of each pixel varies depending on the system to which the pixel is applied, and therefore the description will be made here with N bits. Normally, the data in the image data area 10 is read from a storage medium by a personal computer or the like, or image data transmitted from the outside through a communication line or the like is stored for each screen.

【0014】次に、ラインデータエリア21は、画像デ
ータエリア10に格納された1画面分の画像データか
ら、画像データ圧縮手段30の制御により、水平ライン
単位でデータを読み込み格納するエリアである。ライン
データ退避エリア22は、圧縮処理の終了した後に、ラ
インデータエリア21のデータを退避し、ラインデータ
比較手段32で、処理対象のラインデータが前のライン
と同一データであるかどうかを比較する為に使用するも
のである。
Next, the line data area 21 is an area in which the image data for one screen stored in the image data area 10 is read and stored in horizontal line units under the control of the image data compression means 30. The line data save area 22 saves the data in the line data area 21 after the compression processing is completed, and the line data comparing means 32 compares the line data to be processed with the previous line. It is used for the purpose.

【0015】そして、ラインデータ数エリア23は、画
像データエリア10に格納された画像データの水平ライ
ンのピクセル数が予め設定されており、ライン毎の処理
の終了を検知する時に使用したり、また圧縮演算終了後
に圧縮前のデータ長と圧縮後のデータ長とを比較する時
に使用される。
In the line data number area 23, the number of pixels of the horizontal line of the image data stored in the image data area 10 is set in advance, which is used when detecting the end of the processing for each line, or It is used when comparing the data length before compression and the data length after compression after the completion of the compression operation.

【0016】次に、圧縮ラインデータエリア50は、圧
縮処理が施された1ライン分の圧縮データを格納するエ
リアであり、内部はコマンドエリア51とデータエリア
52とで構成されている。但し、1ラインについて圧縮
演算処理を完了した時点で、圧縮データ長が圧縮前のデ
ータ長よりも大きい場合は、圧縮前のデータをそのまま
採用して、コマンドを付加した形の圧縮データが格納さ
れるようになっている。
Next, the compressed line data area 50 is an area for storing the compressed data for one line which has been subjected to the compression processing, and the inside is composed of a command area 51 and a data area 52. However, if the compressed data length is larger than the pre-compression data length when the compression calculation process is completed for one line, the pre-compression data is used as it is, and the compressed data with the command added is stored. It has become so.

【0017】そして、圧縮画像データエリア60は、圧
縮処理が施された1画面分の圧縮画像データを格納する
エリアであり、ライン毎の圧縮処理の最後にラインデー
タ出力手段36の動作により圧縮ラインデータエリア5
0からライン単位で圧縮データが書き込まれ、1画面分
の圧縮処理が終了した時点で、当該エリアから記憶媒体
に記録したり、あるいは通信回線等を通して送信するよ
うになっている。
The compressed image data area 60 is an area for storing the compressed image data for one screen which has been subjected to the compression processing. At the end of the compression processing for each line, the compressed line is output by the operation of the line data output means 36. Data area 5
The compressed data is written line by line from 0, and when the compression processing for one screen is completed, the compressed data is recorded from the area to a storage medium or transmitted through a communication line or the like.

【0018】ここで、圧縮画像データエリア60に格納
される圧縮画像データのフォーマットについて、図2を
用いて説明する。図2は、本実施例の画像データ圧縮方
法における圧縮画像データのフォーマットを示すフォー
マット図である。本実施例の画像圧縮方法における圧縮
画像データは、図2に示すように、ヘッダ部61と、ラ
インデータ部62とで構成され、ヘッダ部61には、フ
ァイル名やチェックサム等のデータ全体に関する情報が
記録され、ラインデータ部62には各水平ライン毎の圧
縮データが水平ライン分記録されるようになっている。
The format of the compressed image data stored in the compressed image data area 60 will be described with reference to FIG. FIG. 2 is a format diagram showing the format of compressed image data in the image data compression method of this embodiment. As shown in FIG. 2, the compressed image data in the image compression method of this embodiment is composed of a header section 61 and a line data section 62. The header section 61 relates to the entire data such as a file name and a checksum. Information is recorded, and compressed data for each horizontal line is recorded in the line data portion 62 for the horizontal line.

【0019】そして、ラインデータ部62の各水平ライ
ン毎の圧縮ラインデータは、更にコマンド部63とデー
タ部64とで構成され、コマンド部63は、それに続く
データ部64のデータの圧縮種別を示すコマンド(CM
D)がセットされるようになっている。具体的なコマン
ド(CMD)、及びそのコマンドに対応するラインデー
タ部62のフォーマットには次のようなものがある。 1)コマンド”LINE REPEAT” ・・・前のラインと全く同一データの場合 フォーマット CMD(LINE REPEAT )のみ 2)コマンド”LINE FILL” ・・・1ラインがすべて同一色の場合 フォーマット CMD(LINE FILL )+カラー情報 3)コマンド”CMP” ・・・圧縮演算処理を施した場合 フォーマット CMD(CMP )+圧縮データ長+圧縮
データ 4)コマンド”ORG” ・・・圧縮演算処理を施さず、オリジナルデータのまま
の場合 フォーマット CMD(ORG )+カラー情報(オリジ
ナルデータのまま)
The compressed line data for each horizontal line of the line data section 62 is further composed of a command section 63 and a data section 64, and the command section 63 indicates the compression type of the data of the subsequent data section 64. Command (CM
D) is set. Specific commands (CMD) and formats of the line data section 62 corresponding to the commands include the following. 1) Command "LINE REPEAT" --- When the data is exactly the same as the previous line Format CMD (LINE REPEAT) only 2) Command "LINE FILL" --- When all lines have the same color Format CMD (LINE FILL) + Color information 3) Command "CMP" --- When compressed calculation processing is applied Format CMD (CMP) + Compressed data length + Compressed data 4) Command "ORG" --- Format as it is CMD (ORG) + color information (original data remains)

【0020】次に圧縮演算処理を施した場合の圧縮デー
タのフォーマットについて、図3を用いて詳しく説明す
る。図3は、本実施例の画像データ圧縮方法における圧
縮演算処理を施した場合の圧縮データのフォーマットを
示すフォーマット図である。本実施例の画像データ圧縮
方法における圧縮演算処理は、最大16個までの同一の
カラー情報を持つ連続するピクセルを圧縮単位として圧
縮演算を行って圧縮単位データを作成し、1ラインのオ
リジナルデータ中の全ての圧縮単位について順に圧縮単
位データを並べた圧縮データを作成するようになってい
る。尚、圧縮単位を構成する同一カラーのピクセル数の
最大値が16個であるのは、ピクセル連続情報を4ビッ
ト以下で表すようにしているためである。
Next, the format of the compressed data when the compression calculation processing is performed will be described in detail with reference to FIG. FIG. 3 is a format diagram showing the format of the compressed data when the compression calculation processing in the image data compression method of this embodiment is performed. In the compression operation processing in the image data compression method of the present embodiment, compression operation is performed by performing compression operation using up to 16 consecutive pixels having the same color information as a compression unit to generate compression unit data, and The compressed data in which the compression unit data are arranged in order for all the compression units is created. The maximum value of the number of pixels of the same color forming the compression unit is 16 because the pixel continuity information is represented by 4 bits or less.

【0021】そこで、本実施例の画像データ圧縮方法に
おける圧縮演算を施した場合の圧縮データのフォーマッ
トは、図3に示すように、圧縮単位データの開始を示す
カラー変更ビットと、カラー情報と、ブロック/非ブロ
ック情報ビットと、ピクセル連続情報とを1組の圧縮単
位データとして、1ラインの中の圧縮単位の数だけ圧縮
単位データが繰り返されるようになっている。
Therefore, the format of the compressed data when the compression operation is performed in the image data compression method of the present embodiment is, as shown in FIG. 3, a color change bit indicating the start of the compression unit data, color information, and The block / non-block information bit and the pixel continuity information are used as one set of compression unit data, and the compression unit data is repeated by the number of compression units in one line.

【0022】尚、同一のカラー情報を持つ連続するピク
セル数が16を越える場合は、一旦16個目のピクセル
で圧縮単位を区切って圧縮単位データを作成し、それ以
降のピクセルは次の圧縮単位として処理するようになっ
ている。
If the number of consecutive pixels having the same color information exceeds 16, compression unit data is created by dividing the compression unit by the 16th pixel, and subsequent pixels are compressed to the next compression unit. It is supposed to be processed as.

【0023】次に、圧縮単位データの中の各構成要素に
ついて説明する。まず、カラー変更ビットは、各圧縮単
位データの先頭に位置し、カラー情報が変化し圧縮単位
が変わったことを示すビットで、値は”1”に固定され
ている。
Next, each component in the compression unit data will be described. First, the color change bit is located at the head of each compression unit data and indicates that the color information has changed and the compression unit has changed, and its value is fixed to "1".

【0024】カラー情報は、圧縮単位の色を示す情報
で、圧縮前の画像データのピクセルの色を示すカラー情
報をそのまま採用したもので、構成ビット数は適応する
システムに対応して変化するので、ここではNビットと
して説明している。
The color information is the information indicating the color of the compression unit, and the color information indicating the color of the pixel of the image data before compression is adopted as it is. Since the number of constituent bits changes according to the system to which it is adapted. , Here, it is explained as N bits.

【0025】ブロック/非ブロック情報ビットは、次に
続くピクセル連続情報がブロックであるか又は非ブロッ
クであるかを示す情報ビットであり、ブロックの場合に
は”1”をセットし、非ブロックの場合は”0”をセッ
トするようになっている。
The block / non-block information bit is an information bit indicating whether the succeeding pixel continuity information is a block or a non-block. In the case of a block, "1" is set to set the non-block information. In the case, "0" is set.

【0026】ピクセル連続情報は、圧縮単位内のピクセ
ル数を数値、又はピクセル数と同数ビットの値”0”の
連続で表すもので、ビット長は1〜4ビットである。す
なわち、ブロックの場合は、ピクセル連続情報を4ビッ
トの数値データとして扱い、圧縮単位に含まれるピクセ
ル数を4ビットの数値で設定し、非ブロックの場合は、
ピクセル連続情報に、圧縮単位に含まれるピクセル数と
同数ビットの値”0”を連続して設定するものである。
The pixel continuity information represents the number of pixels in the compression unit by a numerical value or a sequence of values "0" of the same number of bits as the number of pixels, and the bit length is 1 to 4 bits. That is, in the case of a block, the pixel continuity information is treated as 4-bit numerical data, and the number of pixels included in the compression unit is set by a 4-bit numerical value. In the case of a non-block,
The value "0" of the same number of bits as the number of pixels included in the compression unit is continuously set in the pixel continuity information.

【0027】次に、同一カラーカウンタ40は、画像デ
ータ圧縮手段30において、圧縮単位を構成する同一カ
ラーの連続するピクセル数をカウントするためのカウン
タであり、圧縮データ長カウンタ41は、1ライン分の
データを圧縮した長さ(圧縮データ長)をビット単位で
カウントするカウンタである。
Next, the same color counter 40 is a counter for counting the number of consecutive pixels of the same color forming the compression unit in the image data compression means 30, and the compressed data length counter 41 is for one line. Is a counter that counts the length of compressed data (compressed data length) in bit units.

【0028】そして、ピクセルポインタ45は、圧縮演
算手段34の中で、ラインデータエリア21から読み込
もうとする色情報のピクセルの位置を示すポインタであ
り、カラー情報退避エリア46は、カラー情報の変化位
置を検出するために、圧縮単位データ中のカラー情報に
セットした情報を一時的に退避しておくエリアである。
The pixel pointer 45 is a pointer indicating the position of the pixel of the color information to be read from the line data area 21 in the compression calculation means 34, and the color information save area 46 is the change position of the color information. This is an area for temporarily saving the information set in the color information in the compression unit data in order to detect the.

【0029】圧縮データワークエリア47は、圧縮演算
処理の過程で、圧縮データを順次設定していくワークエ
リアで、1ライン分の圧縮演算処理が終了し、圧縮デー
タ長の値の方が圧縮前のデータ長の値より小さい場合に
圧縮ラインデータエリア50のデータエリア52にセッ
トするようになっている。
The compressed data work area 47 is a work area in which the compressed data is sequentially set in the process of the compression calculation process, and the compression calculation process for one line is completed, and the value of the compressed data length is before the compression. If it is smaller than the value of the data length of, the compressed line data area 50 is set in the data area 52.

【0030】次に、画像データ圧縮手段30内の各手段
について説明する。ヘッダ作成手段31は、圧縮画像デ
ータの先頭部分のヘッダ部61を作成する手段であり、
圧縮画像データのファイル名やチェックサム等のデータ
全体に関する情報を作成し、圧縮画像データエリア60
に出力するようになっている。
Next, each means in the image data compression means 30 will be described. The header creating means 31 is a means for creating the header portion 61 of the head portion of the compressed image data,
Information about the entire data such as the file name and checksum of the compressed image data is created, and the compressed image data area 60 is created.
It is designed to output to.

【0031】次に、ラインデータ比較手段32は、処理
対象となるラインデータが1つ前のラインデータと全く
同一であるかを判定する手段であり、具体的にはライン
データエリア21に読み込まれた処理対象となるライン
データと、ラインデータ退避エリア22に退避されてい
る1つ前のラインデータとを順次比較し、全く同一の場
合は、前ラインと同一データを意味するコマンド”LI
NE REPEAT”を圧縮ラインデータエリア50の
コマンドエリア51にセットするようになっている。
Next, the line data comparing means 32 is means for judging whether the line data to be processed is exactly the same as the immediately preceding line data, and specifically, it is read into the line data area 21. The line data to be processed is sequentially compared with the immediately preceding line data saved in the line data save area 22, and if they are exactly the same, the command "LI" meaning the same data as the previous line
NE REPEAT "is set in the command area 51 of the compressed line data area 50.

【0032】次に、同一色判定手段33は、処理対象と
なるラインデータが全て同一色であるかどうかを判定す
る手段であり、具体的には、ラインデータエリア21に
読み込まれた処理対象となるラインデータのカラー情報
を順次チェックし、全ピクセルが同一のカラー情報を持
つ場合に、全て同一色を意味するコマンド”LINEF
ILL”を圧縮ラインデータエリア50のコマンドエリ
ア51にセットし、カラー情報をデータエリア52にセ
ットするようになっている。
Next, the same color judging means 33 is a means for judging whether or not all the line data to be processed have the same color. Specifically, the same color judging means 33 The color information of the line data is sequentially checked, and if all pixels have the same color information, the command "LINEF" which means the same color
ILL "is set in the command area 51 of the compressed line data area 50, and the color information is set in the data area 52.

【0033】次に、圧縮演算手段34は、処理対象とな
るラインデータが、前ラインと同一でもなく、且つ全て
同一色でもなかった場合に、圧縮演算処理を施す手段
で、同一のカラー情報を持つ連続するピクセルを圧縮単
位とし、圧縮単位毎に作成する圧縮単位データを順次圧
縮データワークエリア47に付加して行き、ラインデー
タ中の全圧縮単位について圧縮処理を繰り返し、終了し
た時点で圧縮データワークエリア47に処理対象ライン
の圧縮データが設定されるようになっている。
Next, the compression calculation means 34 is means for performing compression calculation processing when the line data to be processed is neither the same as the previous line nor has the same color, and the same color information is obtained. Consecutive pixels are used as a compression unit, compression unit data to be created for each compression unit is sequentially added to the compression data work area 47, compression processing is repeated for all compression units in the line data, and compression data at the end The compressed data of the line to be processed is set in the work area 47.

【0034】ここで圧縮単位毎の圧縮演算処理とは、具
体的には、対象となる圧縮単位に含まれるピクセル数を
同一カラーカウンタ40を用いてカウントし、ピクセル
数の値によってブロック/非ブロックを判定し、ピクセ
ル連続情報を設定するようになっている。
Here, the compression calculation processing for each compression unit is, specifically, the number of pixels included in the target compression unit is counted using the same color counter 40, and the block / non-block is determined according to the value of the number of pixels. Is determined and the pixel continuity information is set.

【0035】尚、同一のカラー情報を持つ連続するピク
セル数が16を越える場合は、一旦16個目のピクセル
で圧縮単位を区切って、圧縮単位データを作成するよう
になっている。
When the number of consecutive pixels having the same color information exceeds 16, the compression unit is once divided into 16th pixels to create compression unit data.

【0036】そして、圧縮処理の過程で、圧縮データ長
カウンタ41を用いて圧縮データ長を累積し、処理対象
ラインの全圧縮単位について圧縮演算が終了した時点
で、圧縮データカウンタ41の値が圧縮データ長を示す
ようになっている。
Then, in the course of the compression process, the compressed data length counter 41 is used to accumulate the compressed data length, and when the compression calculation is completed for all the compression units of the line to be processed, the value of the compressed data counter 41 is compressed. It indicates the data length.

【0037】次に、データ長比較手段35は、圧縮演算
手段34によって作成された圧縮データの長さを圧縮前
のデータの長さと比較する手段で、具体的には圧縮デー
タ長カウンタ41の値と圧縮前のデータ長である(ライ
ンデータ数×カラー情報長Nビット)とを比較し、も
し、圧縮データ長の値の方が小さい場合は、圧縮演算処
理を施したデータを意味するコマンド”CMP”を圧縮
ラインデータエリア50のコマンドエリア51にセット
し、圧縮データ長カウンタ41の値と圧縮データワーク
エリア47のデータをデータエリア52にセットする。
Next, the data length comparison means 35 is means for comparing the length of the compressed data created by the compression calculation means 34 with the length of the data before compression, and more specifically, the value of the compressed data length counter 41. And the data length before compression (the number of line data x color information length N bits) are compared, and if the value of the compressed data length is smaller, the command means the data that has been subjected to the compression calculation processing. CMP "is set in the command area 51 of the compressed line data area 50, and the value of the compressed data length counter 41 and the data of the compressed data work area 47 are set in the data area 52.

【0038】逆に圧縮前のデータ長の値が圧縮データ長
の値と同じか、又は小さい場合は、データ量の少ない圧
縮前のデータを採用し、オリジナルデータを意味するコ
マンド”ORG”を圧縮ラインデータエリア50のコマ
ンドエリア51にセットし、ラインデータエリア21の
データをデータエリア52にセットするようになってい
る。
On the contrary, when the value of the data length before compression is the same as or smaller than the value of the compressed data length, the data before compression having a small amount of data is adopted and the command "ORG" meaning the original data is compressed. The line data area 50 is set in the command area 51, and the line data area 21 is set in the data area 52.

【0039】ラインデータ出力手段36は、圧縮ライン
データエリア50のデータを圧縮画像データエリア60
に出力する手段で、出力後ラインデータエリア21のデ
ータをラインデータ退避エリア22にコピーして、次の
処理の準備を行うようになっている。
The line data output means 36 converts the data in the compressed line data area 50 into the compressed image data area 60.
Then, the data in the post-output line data area 21 is copied to the line data save area 22 to prepare for the next process.

【0040】次に、本実施例の画像データ圧縮方法にお
ける処理の流れについて、図1、図4を用いて具体的に
説明する。図4は、本実施例の画像データ圧縮方法の処
理の流れを示すフローチャート図である。尚、図4では
既に画像データエリア10に1画面分の画像データが格
納されており、圧縮画像データエリア60に圧縮後の画
像データを格納するまでの処理を示し、1ピクセルのカ
ラー情報長をNビットとしている。
Next, the flow of processing in the image data compression method of this embodiment will be specifically described with reference to FIGS. FIG. 4 is a flow chart showing the flow of processing of the image data compression method of this embodiment. In FIG. 4, the image data for one screen is already stored in the image data area 10, and the process until the compressed image data is stored in the compressed image data area 60 is shown. N bits.

【0041】本実施例の画像データ圧縮方法の処理の流
れは、図4に示すように、まず初期処理として、ファイ
ルヘッダ作成手段31でファイルヘッダを作成して、圧
縮画像データエリア60に書き込み(100)、ライン
データ退避エリア22をクリアし(102)、次に、画
像データエリア10から1ライン分の画像データをライ
ンデータエリア21に読み込み(110)、圧縮ライン
データエリア50をクリアし(112)、ラインデータ
比較手段32でラインデータエリア21のラインデータ
とラインデータ退避エリア22のラインデータとを比較
し(120)、全く同じではない場合は、同一色判定手
段33でラインデータエリア21の全ピクセルが同一色
であるかどうかを判定し(130)、同一色でない場合
は、圧縮演算手段34で圧縮演算処理を行い(14
0)、データ長比較手段35でデータ長比較処理を行う
(150)。
As shown in FIG. 4, the process flow of the image data compression method of the present embodiment is as follows. First, as the initial process, the file header creating means 31 creates a file header and writes it in the compressed image data area 60 ( 100), the line data save area 22 is cleared (102), then image data for one line is read from the image data area 10 into the line data area 21 (110), and the compressed line data area 50 is cleared (112). ), The line data comparing means 32 compares the line data in the line data area 21 with the line data in the line data saving area 22 (120). It is determined whether all pixels have the same color (130), and if they are not the same color, compression calculation means. 4 performs compression processing (14
0), the data length comparison means 35 performs data length comparison processing (150).

【0042】次に、圧縮ラインデータエリア50を圧縮
画像データエリア60に書き出し(160)、ラインデ
ータエリア21のデータをラインデータ退避エリア22
に退避し(162)、画像データエリア10の全ライン
について圧縮処理が終了したか判断し(170)、全ラ
インについて圧縮処理が終了していなければ処理110
に戻り、全ラインについて圧縮処理が終了したなら、1
画面についての画像圧縮処理を終了する。
Next, the compressed line data area 50 is written to the compressed image data area 60 (160), and the data in the line data area 21 is saved in the line data save area 22.
(162), it is judged whether the compression processing has been completed for all the lines of the image data area 10 (170), and if the compression processing has not been completed for all the lines, the processing 110
Return to, if the compression process is completed for all lines, 1
The image compression process for the screen ends.

【0043】尚、処理120において、ラインデータエ
リア21のラインデータとラインデータ退避エリア22
のラインデータとが全く同じであった場合は、圧縮ライ
ンデータエリア50のコマンドエリア51に前ラインと
同一データを意味するコマンド”LINE REPEA
T”をセットし(122)、処理160に移る。
In the process 120, the line data in the line data area 21 and the line data save area 22 are stored.
If the line data of the same line is exactly the same, the command area 51 of the compressed line data area 50 indicates the same data as the previous line, "LINE REPEA".
T "is set (122), and the process moves to 160.

【0044】処理130において、ラインデータエリア
21の全ピクセルが同一色であった場合は、圧縮ライン
データエリア50のコマンドエリア51に全て同一色を
意味するコマンド”LINE FILL”をセットし
(132)、データエリア52に同一色であるカラー情
報をセットし(134)、処理160に移る。
When all the pixels in the line data area 21 have the same color in the process 130, the command "LINE FILL" meaning the same color is set in the command area 51 of the compressed line data area 50 (132). , The color information having the same color is set in the data area 52 (134), and the process 160 is performed.

【0045】次に、本実施例の画像データ圧縮方法の圧
縮演算処理(図4の処理140)の流れについて、図
1,図5〜図9を用いて説明する。図5は、本実施例の
画像データ圧縮方法の圧縮演算処理の流れの概要を示す
フローチャート図であり、図6は、ライン単位初期処理
の流れを示すフローチャート図であり、図7は、圧縮単
位初期処理の流れを示すフローチャート図であり、図8
は、同一カラーピクセル数のカウント処理の流れを示す
フローチャート図であり、図9は、圧縮情報作成処理の
流れを示すフローチャート図である。
Next, the flow of the compression calculation process (process 140 of FIG. 4) of the image data compression method of this embodiment will be described with reference to FIGS. 1 and 5 to 9. FIG. 5 is a flow chart showing an outline of the flow of compression calculation processing of the image data compression method of the present embodiment, FIG. 6 is a flow chart showing the flow of line unit initial processing, and FIG. 7 is a compression unit. 9 is a flowchart showing a flow of initial processing, and FIG.
[Fig. 9] is a flowchart showing a flow of a count process of the same color pixel number, and Fig. 9 is a flowchart showing a flow of a compression information creating process.

【0046】本実施例の画像データ圧縮方法の圧縮演算
処理(図4の処理140)の流れの概要は、図5に示す
ように、まずライン単位の初期処理を行い(200)、
次に圧縮単位の初期処理を行い(210)、同一カラー
ピクセル数のカウント処理を行い(220)、圧縮情報
作成処理を行い(230)、最後にピクセルポインタ4
5の値がラインデータ数エリア23より大きいかどうか
判断し(240)、大きい場合はラインデータエリア2
1のデータ全てに圧縮処理を施したことになるので処理
を終了し、大きくない場合は次の圧縮単位の処理を行う
ために、圧縮単位の初期処理である処理210に戻る。
The outline of the flow of the compression calculation process (process 140 of FIG. 4) of the image data compression method of this embodiment is as shown in FIG.
Next, the compression unit is initialized (210), the same color pixel number is counted (220), the compression information is created (230), and finally the pixel pointer 4
It is judged whether the value of 5 is larger than the line data number area 23 (240).
Since all the data of 1 has been subjected to the compression processing, the processing is terminated, and when the data is not large, the processing returns to the processing 210 which is the initial processing of the compression unit to perform the processing of the next compression unit.

【0047】次に、本実施例のライン単位の初期処理
(図5の処理200)は、図6に示すように、圧縮デー
タ長カウンタ41をクリアし(320)、ピクセルポイ
ンタ45に1をセットし(330)、ラインデータエリ
ア21から1ピクセル分のカラー情報を読み込んで(3
40)、ライン単位の初期処理を終了する。
Next, in the line-by-line initial processing (processing 200 in FIG. 5) of this embodiment, as shown in FIG. 6, the compressed data length counter 41 is cleared (320) and 1 is set in the pixel pointer 45. Then, the color information for one pixel is read from the line data area 21 (330) (3
40), the initial processing for each line is completed.

【0048】次に、本実施例の圧縮単位の初期処理(図
5の処理210)は、図7に示すように、圧縮データワ
ークエリア47にまずカラー変更ビット”1”をセット
し(400)、続いて読み込んだカラー情報をセットし
(410)、次に同一カラーカウンタ40を1にセット
し(420)、読み込んだカラー情報をカラー情報退避
エリア46に退避し(430)、圧縮データ長カウンタ
41に(1+N)ビット(カラー変更ビットのビット数
+カラー情報のビット数)を加算して(440)、圧縮
単位の初期処理を終了する。
Next, in the initial process of the compression unit (process 210 in FIG. 5) of this embodiment, as shown in FIG. 7, the color change bit "1" is first set in the compressed data work area 47 (400). Then, the read color information is set (410), the same color counter 40 is set to 1 (420), the read color information is saved in the color information save area 46 (430), and the compressed data length counter is set. (1 + N) bits (the number of color change bits + the number of color information bits) are added to 41 (440), and the initial process of the compression unit is completed.

【0049】次に、本実施例の同一カラーピクセル数の
カウント処理(図5の処理220)は、図8に示すよう
に、ピクセルポインタ45に1を加算し(500)、ピ
クセルポインタ45の値がラインデータ数エリア23の
値より大きいか判断し(510)、大きくない時はライ
ンデータエリア21から1ピクセル分のカラー情報を読
み込み(520)、次に圧縮単位の終わりを色変化で検
知するために読み込んだカラー情報がカラー情報退避エ
リア46と同じかどうか判断し(530)、カラー情報
が同じ場合は同一圧縮単位であるから同一カラーカウン
タ40に1を加算し(540)、次に圧縮単位の最大ピ
クセル数を越えるかチェックするために同一カラーカウ
ンタ40の値が16より大きいか判断し(550)、1
6より大きくない場合は処理500に戻り、16より大
きい場合は圧縮単位が切り替わるので、同一カラーピク
セル数のカウント処理を終了する。
Next, in the counting process of the same color pixel number (process 220 of FIG. 5) of this embodiment, as shown in FIG. 8, 1 is added to the pixel pointer 45 (500) and the value of the pixel pointer 45 is added. Is larger than the value in the line data number area 23 (510), and if not larger, one pixel of color information is read from the line data area 21 (520), and then the end of the compression unit is detected by color change. It is determined whether the color information read for that purpose is the same as the color information save area 46 (530). If the color information is the same, the same compression unit is added, so 1 is added to the same color counter 40 (540), and the next compression is performed. In order to check whether the maximum number of pixels of the unit is exceeded, it is judged whether the value of the same color counter 40 is larger than 16 (550), 1
When it is not larger than 6, the process returns to the process 500, and when it is larger than 16, the compression unit is switched, so that the count process of the same color pixel number is ended.

【0050】尚、処理510において、ピクセルポイン
タ45の値がラインデータ数エリア23の値より大きい
場合は、ラインデータエリア21のデータを全て読み込
んだことになるので、同一カラーピクセル数のカウント
処理を終了し、また処理530において、読み込んだカ
ラー情報がカラー情報退避エリア46と同じでない場合
は、ピクセルの色情報が変化して圧縮単位が切り替わる
ので、同一カラーピクセル数のカウント処理を終了す
る。
In the process 510, if the value of the pixel pointer 45 is larger than the value of the line data number area 23, it means that all the data in the line data area 21 has been read. When the read color information is not the same as the color information save area 46 in the processing 530, the color information of the pixel is changed and the compression unit is switched, so that the counting processing of the same color pixel number is ended.

【0051】次に、本実施例の圧縮情報作成処理(図5
の処理230)では、図9に示すように、同一カラーカ
ウンタ40の値が”4”より大きいかどうか判断し(6
00)、大きい場合はピクセル連続情報をブロックとし
て扱う処理として、圧縮データワークエリア47にブロ
ック/非ブロック情報ビットとして”1”をセットし
(610)、同一カラーカウンタ40の値を4ビットの
数値で圧縮データワークエリア47にセットし(62
0)、圧縮データ長カウンタ41に”5”(ブロック/
非ブロック情報のビット数+ピクセル連続情報のビット
数)を加算して(630)、圧縮情報作成処理を終了す
る。
Next, the compressed information creation processing of this embodiment (see FIG.
In processing 230), it is determined whether the value of the same color counter 40 is larger than “4” as shown in FIG. 9 (6
00), if it is larger, as a process of treating pixel continuous information as a block, "1" is set as a block / non-block information bit in the compressed data work area 47 (610), and the value of the same color counter 40 is set to a 4-bit numerical value. To the compressed data work area 47 (62
0), "5" (block /
The number of bits of non-block information + the number of bits of continuous pixel information) are added (630), and the compression information creation process is terminated.

【0052】一方、処理600において、同一カラーカ
ウンタ40の値が”4”以下の場合は、ピクセル連続情
報を非ブロックとして扱う処理として、圧縮データワー
クエリア47にブロック/非ブロック情報ビットとし
て”0”をセットし(660)、同一カラーカウンタ4
0の値の数だけ圧縮データワークエリア47に値”0”
をセットし(670)、圧縮データ長カウンタ41に”
1”(ブロック/非ブロック情報のビット数)+同一カ
ラーカウンタ40の値を加算して(680)、圧縮情報
作成処理を終了する。
On the other hand, in the process 600, when the value of the same color counter 40 is "4" or less, the block / non-block information bit "0" is stored in the compressed data work area 47 as the process of treating the pixel continuous information as a non-block. "(660), and the same color counter 4
The value "0" is stored in the compressed data work area 47 by the number of 0s.
Is set (670), and the compressed data length counter 41 is set to "
1 ″ (the number of bits of block / non-block information) + the value of the same color counter 40 is added (680), and the compression information creating process is ended.

【0053】次に、本実施例の画像データ圧縮方法のデ
ータ長比較処理(図4の処理150)の流れについて、
図1,図10を用いて説明する。図10は、本実施例の
画像データ圧縮方法のデータ長比較処理の流れを示すフ
ローチャート図である。尚、図10では、1ピクセルの
カラー情報長をNビットとして説明する。本実施例の画
像データ圧縮方法のデータ長比較処理の流れは、図10
に示すように、圧縮前のデータ長である(ラインデータ
数エリア23の値×Nビット)と圧縮データ長カウンタ
41の値とを比較し(700)、圧縮データ長カウンタ
41の値の方が小さい場合は、圧縮演算処理を施したデ
ータを意味するコマンド”CMP”を圧縮ラインデータ
エリア50のコマンドエリア51にセットし(71
0)、圧縮データ長カウンタ41の値を圧縮ラインデー
タエリア50のデータエリア52にセットし(72
0)、圧縮データワークエリア47のデータをデータエ
リア52に続いてセットして(730)、データ長比較
処理を終了する。
Next, regarding the flow of the data length comparison processing (processing 150 in FIG. 4) of the image data compression method of this embodiment,
This will be described with reference to FIGS. FIG. 10 is a flow chart showing the flow of data length comparison processing of the image data compression method of this embodiment. In FIG. 10, the color information length of one pixel is described as N bits. The flow of the data length comparison processing of the image data compression method of this embodiment is shown in FIG.
As shown in, the data length before compression (the value of the line data number area 23 × N bits) is compared with the value of the compressed data length counter 41 (700), and the value of the compressed data length counter 41 is If it is smaller, the command "CMP" which means the data subjected to the compression calculation processing is set in the command area 51 of the compression line data area 50 (71
0), the value of the compressed data length counter 41 is set in the data area 52 of the compressed line data area 50 (72
0), the data in the compressed data work area 47 is set following the data area 52 (730), and the data length comparison process is ended.

【0054】一方、処理700において、圧縮データ長
の値と圧縮前のデータ長の値が同じか圧縮データ長の値
の方が大きい場合は、オリジナルデータを意味するコマ
ンド”ORG”を圧縮ラインデータエリア50のコマン
ドエリア51にセットし(740)、ラインデータエリ
ア21のデータをデータエリア52にセットし(75
0)、データ長比較処理を終了する。
On the other hand, in the process 700, when the value of the compressed data length is the same as the value of the data length before compression or the value of the compressed data length is larger, the command "ORG" meaning the original data is set to the compressed line data. The command area 51 of the area 50 is set (740), and the data of the line data area 21 is set in the data area 52 (75).
0), the data length comparison process ends.

【0055】本実施例の画像データ圧縮方法によれば、
2値を越えるカラー情報で構成される1画面の画像デー
タを水平ライン単位で編集し、同一のカラー情報を持つ
連続するピクセルを圧縮単位として、圧縮単位中のピク
セル数を数値に置き換えるか又はピクセル数と同数の特
定の値を持つビットに置き換えるようになっているの
で、従来の2値画像を対象にしたランレングス符号化圧
縮技術を応用した簡単な方法で容易にカラー画像データ
を圧縮することができ、特に色変化が少ない画像につい
て圧縮効率を向上することができる効果がある。
According to the image data compression method of this embodiment,
Image data of one screen composed of color information exceeding two values is edited in units of horizontal lines, and consecutive pixels having the same color information are used as a compression unit, or the number of pixels in the compression unit is replaced with a numerical value or pixels. Since it is designed to replace with bits having the same number as the specific value, it is possible to easily compress color image data by a simple method that applies the conventional run-length coding compression technology for binary images. In particular, there is an effect that the compression efficiency can be improved particularly for an image with little color change.

【0056】また、本実施例の画像データ圧縮方法によ
れば、画像データの水平ライン単位で圧縮演算を行った
後に、圧縮後のデータ長と圧縮前のデータ長とを比較
し、データ長の値の小さい方を採用するので、画像デー
タ中に圧縮演算によって圧縮効果の上がらないパターン
のラインが含まれていても、それによって圧縮効率を劣
化させることがなく、効率よく圧縮することができる効
果がある。
Further, according to the image data compression method of the present embodiment, after the compression operation is performed for each horizontal line of the image data, the data length after compression and the data length before compression are compared to determine the data length. Since the one with the smaller value is adopted, even if the image data contains a line of a pattern that does not improve the compression effect due to the compression operation, the compression efficiency is not deteriorated by that, and the effect that the data can be compressed efficiently There is.

【0057】更に、本実施例の画像データ圧縮方法によ
れば、複雑な圧縮演算を行う前に、前のラインと全く同
一のカラー情報で構成されるラインについては、同一で
あることを示すコマンドのみの圧縮データとし、また1
ラインが全て同一色の場合は、同一色であることを示す
コマンドとそのカラー情報のみの圧縮データとするの
で、色変化の少ない画像データの場合は圧縮効率が向上
し、更に圧縮処理効率をも向上することができる効果が
ある。
Further, according to the image data compression method of the present embodiment, before performing a complicated compression operation, a command indicating that the line constituted by the same color information as the previous line is the same is used. Only compressed data, 1
If all the lines have the same color, the command indicating that they are the same color and the compressed data of only that color information are used. Therefore, in the case of image data with few color changes, the compression efficiency is improved and the compression processing efficiency is also improved. There is an effect that can be improved.

【0058】[0058]

【発明の効果】請求項1記載の発明によれば、1画面の
画像データから水平ライン単位にカラー情報を読み込
み、前ラインのカラー情報と処理対象ラインのカラー情
報とを比較して同一であれば前ラインと同一のカラー情
報であることを意味するコマンドを圧縮ラインデータと
し、処理対象ライン内の全ピクセルが同一カラー情報で
あれば全ピクセルが同一のカラー情報であることを意味
するコマンドとカラー情報とを圧縮ラインデータとし、
それ以外の場合は同一のカラー情報を持つ連続するピク
セルを圧縮単位として、処理対象ライン内の全圧縮単位
について繰り返し圧縮演算を行い、その結果を順次付加
して圧縮データを作成し、圧縮データのデータ長と圧縮
演算前のデータ長とを比較して、圧縮データのデータ長
の方が小さい場合は圧縮演算処理を施したデータを意味
するコマンドと圧縮データのデータ長と圧縮データとを
圧縮ラインデータとし、圧縮データのデータ長の方が小
さくない場合は、圧縮演算前のデータを意味するコマン
ドと圧縮演算前のデータとを圧縮ラインデータとするカ
ラー画像データ圧縮方法としているので、前ラインと同
一のカラー情報のラインと全ピクセル同一色のラインに
は複雑な圧縮演算を施さずに圧縮データを作成すること
ができ、また圧縮演算後に、圧縮前後のデータ長を比較
し、データ長の値の小さい方のデータを採用して圧縮デ
ータとするので、従来の2値画像を対象にしたランレン
グス符号化圧縮技術を応用した簡単な方法で容易に効率
よくカラー画像データを圧縮することができ、特に色変
化が少ない画像について圧縮効率を上げることができ、
また圧縮演算によって圧縮効果の上がらないパターンの
ラインが含まれていても圧縮効率を劣化させずに圧縮す
ることができる効果がある。
According to the first aspect of the present invention, color information is read from the image data of one screen in horizontal line units, and the color information of the preceding line and the color information of the line to be processed are compared and found to be the same. For example, a command that means that the same color information as the previous line is used as compressed line data, and if all the pixels in the line to be processed have the same color information, a command that means that all the pixels have the same color information. Color information and compressed line data,
In other cases, using consecutive pixels with the same color information as the compression unit, the compression operation is repeated for all the compression units in the line to be processed, and the results are sequentially added to create compressed data. The data length is compared with the data length before the compression operation, and if the data length of the compressed data is smaller, the command meaning the data after the compression operation and the data length of the compressed data and the compression data are compressed line. If the data length of the compressed data is not smaller than the data of the previous line, since the compressed image data is the command that indicates the data before the compression operation and the data before the compression operation is the compressed line data. Compressed data can be created without applying complicated compression calculation to lines of the same color information and lines of the same color for all pixels. After the calculation, the data length before and after compression is compared, and the data with the smaller data length value is used as the compressed data, so it is easy to apply the run-length coding compression technology for conventional binary images. It is possible to easily and efficiently compress color image data with various methods, and especially to improve the compression efficiency for images with little color change,
Further, even if a line of a pattern that does not improve the compression effect is included by the compression calculation, the compression can be performed without degrading the compression efficiency.

【0059】請求項2記載の発明によれば、請求項1記
載の圧縮演算処理ステップが、水平ライン単位のカラー
情報を連続する同一カラーピクセルからなる圧縮単位に
分けて圧縮演算を行い、圧縮単位の境界をピクセルのカ
ラー情報の変化により検出するまで圧縮単位内のピクセ
ル数をカウントし、ピクセル数の大きさによって、ピク
セル数を数値で設定するか、又はピクセル数と同数の特
定の値を持つビットに置き換えて圧縮単位データを作成
し、処理対象ライン中の全圧縮単位について繰り返し圧
縮演算を行い圧縮単位データを付加していって1ライン
分の圧縮ラインデータを作成するカラー画像データ圧縮
方法としているので、連続する同一カラーのピクセル数
を数値などに置き換える簡単なロジックで圧縮ラインデ
ータを作成することができ、従来の2値画像を対象にし
たランレングス符号化圧縮技術を応用した簡単な方法で
容易に2値を越えるカラー画像データを圧縮することが
できる効果がある。
According to the second aspect of the present invention, the compression calculation processing step according to the first aspect divides the color information in units of horizontal lines into compression units made up of consecutive same color pixels, and performs compression calculation. The number of pixels in the compression unit is counted until the boundary of is detected by the change of the color information of the pixel, and the number of pixels is set numerically or has a specific value equal to the number of pixels depending on the size of the number of pixels. As a color image data compression method in which compressed line data is created by substituting bits, and compressed line data is added by repeatedly performing compression operation for all compression units in the processing target line to create compressed line data for one line. Therefore, compressed line data can be created with simple logic that replaces the number of consecutive pixels of the same color with numerical values. It can be readily embodiment offers the advantage of being able to compress the color image data exceeding the binary simple method applying the run-length encoding compression techniques a conventional binary image to the subject.

【図面の簡単な説明】[Brief description of drawings]

【図1】本発明の一実施例に係るカラー画像データ圧縮
方法を実現する概念構成ブロック図である。
FIG. 1 is a conceptual configuration block diagram for realizing a color image data compression method according to an embodiment of the present invention.

【図2】本実施例の画像データ圧縮方法における圧縮画
像データのフォーマットを示すフォーマット図である。
FIG. 2 is a format diagram showing a format of compressed image data in the image data compression method of the present embodiment.

【図3】本実施例の画像データ圧縮方法における圧縮演
算処理を施した場合の圧縮データのフォーマットを示す
フォーマット図である。
FIG. 3 is a format diagram showing a format of compressed data when a compression calculation process is performed in the image data compression method of the present embodiment.

【図4】本実施例の画像データ圧縮方法の処理の流れを
示すフローチャート図である。
FIG. 4 is a flowchart showing a processing flow of an image data compression method of this embodiment.

【図5】本実施例の画像データ圧縮方法の圧縮演算処理
の流れの概要を示すフローチャート図である。
FIG. 5 is a flowchart showing an outline of the flow of compression calculation processing of the image data compression method of this embodiment.

【図6】本実施例の画像データ圧縮方法の圧縮演算処理
の中のライン単位初期処理の流れを示すフローチャート
図である。
FIG. 6 is a flowchart showing a flow of a line unit initial process in the compression calculation process of the image data compression method of the present embodiment.

【図7】本実施例の画像データ圧縮方法の圧縮演算処理
の中の圧縮単位初期処理の流れを示すフローチャート図
である。
FIG. 7 is a flowchart showing a flow of a compression unit initial process in the compression calculation process of the image data compression method of the present embodiment.

【図8】本実施例の画像データ圧縮方法の圧縮演算処理
の中の同一カラーピクセル数のカウント処理の流れを示
すフローチャート図である。
FIG. 8 is a flowchart showing a flow of counting processing of the same color pixel number in the compression calculation processing of the image data compression method of the present embodiment.

【図9】本実施例の画像データ圧縮方法の圧縮演算処理
の中の圧縮情報作成処理の流れを示すフローチャート図
である。
FIG. 9 is a flowchart showing a flow of compression information creation processing in the compression calculation processing of the image data compression method of this embodiment.

【図10】本実施例の画像データ圧縮方法のデータ長比
較処理の流れを示すフローチャート図である。
FIG. 10 is a flowchart showing the flow of data length comparison processing of the image data compression method of this embodiment.

【符号の説明】[Explanation of symbols]

10…画像データエリア、 21…ラインデータエリ
ア、 22…ラインデータ退避エリア、 23…ライン
データ数エリア、 30…画像データ圧縮手段、31…
ヘッダ作成手段、 32…ラインデータ比較手段、 3
3…同一色判定手段、 34…圧縮演算手段、 35…
データ長比較手段、 36…ラインデータ出力手段、
40…同一カラーカウンタ、 41…圧縮データ長カウ
ンタ、45…ピクセルポインタ、 46…カラー情報退
避エリア、 47…圧縮データワークエリア、 50…
圧縮ラインデータエリア、 51…コマンドエリア、5
2…データエリア、 60…圧縮画像データエリア、
61…ヘッダ部、 62…ラインデータ部 、63…コ
マンド部、 64…データ部
10 ... Image data area, 21 ... Line data area, 22 ... Line data save area, 23 ... Line data number area, 30 ... Image data compression means, 31 ...
Header creating means, 32 ... Line data comparing means, 3
3 ... Same color determination means, 34 ... Compression calculation means, 35 ...
Data length comparison means, 36 ... line data output means,
40 ... Same color counter, 41 ... Compressed data length counter, 45 ... Pixel pointer, 46 ... Color information save area, 47 ... Compressed data work area, 50 ...
Compressed line data area, 51 ... Command area, 5
2 ... data area, 60 ... compressed image data area,
61 ... Header part, 62 ... Line data part, 63 ... Command part, 64 ... Data part

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 1画面の画像データから水平ライン単位
にカラー情報を読み込み、前ラインのカラー情報と処理
対象ラインのカラー情報とが同一であるかを比較し、同
一であれば前ラインと同一のカラー情報であることを意
味するコマンドを圧縮ラインデータとするラインデータ
比較処理ステップと、前記前ラインのカラー情報と前記
処理対象ラインのカラー情報とが同一ではない場合に、
前記処理対象ライン内の全ピクセルが同一カラー情報で
あるか判定し、同一カラー情報であれば全ピクセルが同
一のカラー情報であることを意味するコマンドと前記カ
ラー情報とを圧縮ラインデータとする同一色判定処理ス
テップと、前記処理対象ライン内の全ピクセルが同一の
カラー情報ではない場合に、同一のカラー情報を持つ連
続するピクセルを圧縮単位として圧縮演算を行い、前記
処理対象ライン内の前記全圧縮単位について繰り返し圧
縮演算を行った結果を順次付加して圧縮データを作成す
る圧縮演算処理ステップと、前記圧縮演算処理ステップ
実行後に、前記圧縮データのデータ長の値と前記圧縮演
算前のデータ長の値とを比較して、前記圧縮データのデ
ータ長の値の方が小さい場合は圧縮演算処理を施したデ
ータを意味するコマンドと圧縮データのデータ長の値と
圧縮データとを圧縮ラインデータとし、前記圧縮データ
のデータ長の値の方が小さくない場合は、前記圧縮演算
前のデータを意味するコマンドと前記圧縮演算前のデー
タとを圧縮ラインデータとするデータ長比較処理ステッ
プとを有することを特徴とするカラー画像データ圧縮方
法。
1. Color information is read in units of horizontal lines from image data of one screen, and it is compared whether the color information of the previous line and the color information of the processing target line are the same. If they are the same, it is the same as the previous line. When the line data comparison processing step in which the command meaning that the color information is the compressed line data is the color information of the preceding line and the color information of the processing target line are not the same,
It is determined whether all the pixels in the line to be processed have the same color information, and if they are the same color information, the command which means that all the pixels have the same color information and the color information are the same as the compressed line data. If all pixels in the color determination processing step and the processing target line do not have the same color information, a compression operation is performed using consecutive pixels having the same color information as a compression unit, and all the pixels in the processing target line are processed. A compression operation processing step of sequentially adding results of repeated compression operations for compression units to create compressed data, and a value of the data length of the compressed data and a data length before the compression operation after the compression operation processing step is executed. Of the compressed data, and if the value of the data length of the compressed data is smaller, it means that the compressed data has been processed. And the data length value of the compressed data and the compressed data are compressed line data, and when the data length value of the compressed data is not smaller, the command meaning the data before the compression operation and the command before the compression operation And a data length comparison processing step of using the above data as compressed line data.
【請求項2】 請求項1記載の圧縮演算処理ステップ
が、圧縮単位に圧縮演算処理を施した圧縮単位データと
して、前記圧縮単位の始まりを示すカラー変更ビット
と、前記圧縮単位でのカラー情報と、次に続くピクセル
連続情報の種別を表すブロック/非ブロック情報ビット
と、前記圧縮単位内のピクセル数を示すピクセル連続情
報とで構成される圧縮単位データを作成するのに、カラ
ー変更ビットを設定し、前記圧縮単位のカラー情報を設
定し、前記圧縮単位の境界をピクセルのカラー情報の変
化により検出するまで、前記圧縮単位内のピクセル数を
カウントし、前記カウントした圧縮単位中のピクセル数
が前記ピクセル連続情報のビット数より大きい場合は、
前記ブロック/非ブロック情報ビットをブロック情報と
して設定し、それに続く前記ピクセル連続情報として前
記ピクセル数を数値で設定して圧縮単位データを作成
し、前記ピクセル数が前記ピクセル連続情報のビット数
より大きくない場合は、前記ブロック/非ブロック情報
ビットを非ブロック情報として設定し、それに続く前記
ピクセル連続情報として前記ピクセル数と同数の特定の
値を持つビットを設定して圧縮単位データを作成し、前
記処理対象ライン中の全圧縮単位について繰り返し圧縮
演算を行って圧縮単位データを付加していって1ライン
分の圧縮データを作成することを特徴とするカラー画像
データ圧縮方法。
2. The compression operation processing step according to claim 1, wherein, as compression unit data obtained by performing compression operation processing on a compression unit, a color change bit indicating the beginning of the compression unit, and color information on the compression unit. , A color change bit is set to create compression unit data composed of block / non-block information bits indicating the type of the following pixel continuity information and pixel continuity information indicating the number of pixels in the compression unit. Then, the color information of the compression unit is set, the number of pixels in the compression unit is counted until the boundary of the compression unit is detected by the change of the color information of the pixel, and the number of pixels in the counted compression unit is If the number of bits of the pixel continuity information is greater than,
The block / non-block information bit is set as block information, and the number of pixels is set as a numerical value as the subsequent pixel continuity information to create compression unit data, and the number of pixels is larger than the number of bits of the continuous pixel information. If not, the block / non-block information bit is set as non-block information, and the subsequent bits of the pixel continuity information are set with bits having a specific value equal to the number of pixels to create compression unit data. A color image data compression method, characterized in that compression data is added repeatedly by repeatedly performing compression operation for all compression units in a line to be processed to create compressed data for one line.
JP5342210A 1993-12-15 1993-12-15 Color image data compression method Pending JPH07170410A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP5342210A JPH07170410A (en) 1993-12-15 1993-12-15 Color image data compression method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP5342210A JPH07170410A (en) 1993-12-15 1993-12-15 Color image data compression method

Publications (1)

Publication Number Publication Date
JPH07170410A true JPH07170410A (en) 1995-07-04

Family

ID=18351974

Family Applications (1)

Application Number Title Priority Date Filing Date
JP5342210A Pending JPH07170410A (en) 1993-12-15 1993-12-15 Color image data compression method

Country Status (1)

Country Link
JP (1) JPH07170410A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000356944A (en) * 1999-04-30 2000-12-26 Junglebyte Pte Ltd Offering teaching material through communication network
WO2001065420A2 (en) * 2000-02-29 2001-09-07 Watchpoint Media, Inc. Methods for manipulating data in multiple dimensions
US7230630B2 (en) 2004-05-29 2007-06-12 Samsung Electronics Co., Ltd. Graphics display systems with data compression and methods of performing data compression of graphics data
JP2014039832A (en) * 2013-09-10 2014-03-06 Fujishoji Co Ltd Game machine

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000356944A (en) * 1999-04-30 2000-12-26 Junglebyte Pte Ltd Offering teaching material through communication network
WO2001065420A2 (en) * 2000-02-29 2001-09-07 Watchpoint Media, Inc. Methods for manipulating data in multiple dimensions
WO2001065420A3 (en) * 2000-02-29 2002-02-28 Watchpoint Media Inc Methods for manipulating data in multiple dimensions
US7230630B2 (en) 2004-05-29 2007-06-12 Samsung Electronics Co., Ltd. Graphics display systems with data compression and methods of performing data compression of graphics data
KR100834439B1 (en) * 2004-05-29 2008-06-04 삼성전자주식회사 Compression and decompression device of graphic data and therefor method
JP2014039832A (en) * 2013-09-10 2014-03-06 Fujishoji Co Ltd Game machine

Similar Documents

Publication Publication Date Title
US6212234B1 (en) Color image encoding apparatus and color image decoding apparatus
JP2922680B2 (en) Compressed image storage method for high-resolution computer graphics
US4843632A (en) Compressed image expansion system
US5353061A (en) System and method for frame-differencing video compression/decompression using perceptually-constant information and image analysis
JP3461309B2 (en) Huffman coded data compression device
US7433522B2 (en) JBIG coding apparatus and method with low cost, high-performance ping-pong buffer arrangement
JPH07322074A (en) Equipment and method for data processing to process 2 level image file that a dither ring happened
JP3406220B2 (en) Data compression method, image data compression method and compression apparatus
JPH07170410A (en) Color image data compression method
JPH08180180A (en) Electronic filing device
JPH0983809A (en) Compression method for color image signal, image coding decoding device and image processing system
US5905821A (en) Compression/expansion circuit having transfer means and storage means with address management of the storage means
JPH1127540A (en) Image coding/decoding method and its system
JP2798025B2 (en) Video coding method and apparatus
KR100276768B1 (en) Changed Pixel Detector for Encoding Image Data
JP2615215B2 (en) Image data compression method
JPH07147638A (en) Image processor
JP2837581B2 (en) Image scanner reader
JP2595900B2 (en) Change point coordinate detection device for binary image data
JP2839578B2 (en) Image data input processing device
JPH0396071A (en) Dither image data compression system
JPS59110274A (en) Compression and expansion system for color image data
JPS63117562A (en) Image data coding system
JP2694569B2 (en) Predetermined code bit continuous position detection method
JP2795023B2 (en) Encoding device