JPH1074248A - Color reduction device and color reduction method - Google Patents

Color reduction device and color reduction method

Info

Publication number
JPH1074248A
JPH1074248A JP8230020A JP23002096A JPH1074248A JP H1074248 A JPH1074248 A JP H1074248A JP 8230020 A JP8230020 A JP 8230020A JP 23002096 A JP23002096 A JP 23002096A JP H1074248 A JPH1074248 A JP H1074248A
Authority
JP
Japan
Prior art keywords
color
pixel
image
input image
filter
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
JP8230020A
Other languages
Japanese (ja)
Inventor
Shusaku Okamoto
修作 岡本
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.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial Co Ltd
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 Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP8230020A priority Critical patent/JPH1074248A/en
Publication of JPH1074248A publication Critical patent/JPH1074248A/en
Withdrawn legal-status Critical Current

Links

Landscapes

  • Facsimile Image Signal Circuits (AREA)
  • Color Image Communication Systems (AREA)
  • Controls And Circuits For Display Device (AREA)
  • Image Processing (AREA)

Abstract

PROBLEM TO BE SOLVED: To perform the color reduction processing of pictures while leaving a colorful part by referring to a lookup table and allocating the color of respective picture elements for constituting an input picture to one of limited colors. SOLUTION: A classification means 101 uses a classification rule 102 for classifying the respective picture elements of the input picture corresponding to the value of the color and classifies the respective picture elements of the input picture by one of the plural attribute values. A color number counting means 103 classifies the respective picture elements for constituting the input picture by the attribute value in the classification means 101 and calculates a color number to be allocated to a picture element group constituted of the picture elements of the same attribute value for the respective attribute values based on the classified result. Also, a lookup table calculation means 104 inputs the picture, calculates color conversion information and stores the calculated result in the lookup table 105. Then, a color reduction means 106 refers to the lookup table 105 and allocates the color of the respective picture elements for constituting the input picture to one of the limited colors.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、表示手段や印刷手
段などの画像出力手段において出力されるフルカラー画
像の色数を意図的に減少させ、リアルさを取り除きつつ
原画像の風合いを残した、イラスト風カラー画像を作成
する減色装置およびその減色方法に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention is intended to reduce the number of colors of a full-color image output by an image output means such as a display means or a printing means, and to maintain the texture of an original image while eliminating realism. The present invention relates to a color reduction device for creating an illustration-like color image and a color reduction method thereof.

【0002】[0002]

【従来の技術】画像を表示する装置は、一般に、赤
(R)、緑(G)、青(B)の組合せによって画素デー
タを表現し、それを表示するものである。特にフルカラ
ー画像と呼ばれる画像を表示する装置では、一般的に一
画素当たり赤(R)、緑(G)、青(B)の各々の明度
が8ビット(=256)の階調を持つ画像データを蓄え
るためのメモリ容量をフレームバッファが持っているた
め、高精度のフルカラー画像を表示することが可能であ
る。
2. Description of the Related Art Generally, an apparatus for displaying an image expresses pixel data by a combination of red (R), green (G), and blue (B) and displays the pixel data. In particular, in a device that displays an image called a full-color image, generally, each pixel of red (R), green (G), and blue (B) has 8 bits (= 256) of grayscale image data for each pixel. Since the frame buffer has a memory capacity for storing image data, a high-precision full-color image can be displayed.

【0003】しかしながら、ほとんどのワークステーシ
ョン、パーソナルコンピュータなどにおいては、フルカ
ラー画像を同時表示できるだけのメモリ容量をフレーム
バッファが持っていないため、入力のフルカラー画像を
表示手段で表示可能な色を用いて疑似的に表示する方法
が用いられる。そのためにはフルカラー画像の各々の画
素の色を、表示手段で表示可能な色に変換する処理が必
要となるが、その処理の方法としては、大きく、 ・ディザマトリクスを用いる方法 ・色の統計的分布を用いる方法 の2つがある。以下、上記2つの方法を簡単に説明す
る。
However, in most workstations, personal computers, and the like, the frame buffer does not have a memory capacity enough to simultaneously display a full-color image. Therefore, an input full-color image is simulated using colors that can be displayed by display means. A method of displaying information is used. For that purpose, it is necessary to convert the color of each pixel of the full-color image into a color that can be displayed by the display means. The method of the processing is large, a method using a dither matrix, and a statistical method of color. There are two ways to use the distribution. Hereinafter, the above two methods will be briefly described.

【0004】1)ディザマトリクスを用いる方法 これは、入力画像の表現できない色の画素を単純に、階
調数を減らした場合に生じる偽の輪郭線を目立たなくす
るために、意図的に雑音を加える方法であり、処理のア
ルゴリズムによってディザマトリクスを用いる方法を分
類すると、以下の2つの方法がある。
[0004] 1) Method using dither matrix [0004] This is because noise of a color that cannot be expressed in an input image is simply made inconspicuous in order to make false contour lines generated when the number of gradations is reduced inconspicuous. When the methods using the dither matrix are classified according to the processing algorithm, there are the following two methods.

【0005】・当該画素の周辺画素の色などを考慮して
当該画素の色を決定する方法 ・当該画素の周辺画素の色を考慮せず、あらかじめ用意
したディザマトリクスを入力画像に重ね合わせ各画素の
色を決定する方法 2)色の統計的分布を用いて減色する方法 入力画像の色分布の統計量を計算し、入力画像を再現す
るのに最適なN色(N:表示手段で再現可能な色の最大
値以下の任意の数)を計算し、ルックアップテーブルを
作成する。そして、入力画像の各々の画素について、ル
ックアップテーブルと、 ・同じ色があればその色に、 ・同じ色がなければルックアップテーブル内のもっとも
似た色に、 変換することによってフルカラー画像データを表示手段
で表示可能な色に変換し表示するものである。
[0005] A method of determining the color of a pixel in consideration of the color of the pixel surrounding the pixel, etc. [0005] Each pixel is prepared by superimposing a previously prepared dither matrix on the input image without considering the color of the pixel in the vicinity of the pixel. 2) Method of reducing colors using statistical distribution of colors Calculates the statistical value of the color distribution of the input image, and N colors (N: can be reproduced by display means) that are optimal for reproducing the input image Calculate any number less than the maximum value of the color) and create a look-up table. Then, for each pixel of the input image, the full-color image data is converted by converting to a look-up table, if there is the same color, to that color, and if not, to the most similar color in the look-up table. It is converted into a color that can be displayed by the display means and displayed.

【0006】なお、上記1)の方法は例えば「特開平8−
22273号公報」などで、また、上記2)の方法は例え
ば「特開平5−89972号公報」、「特開平5−21
5260号公報」、「”画像解析ハンドブック”、pp.5
05-516、財団法人東京大学出版会、1991年」などで開示
されている。
The method 1) is described, for example, in Japanese Patent Application Laid-Open
22273, and the method 2) is described in, for example, JP-A-5-89972 and JP-A-5-21.
No. 5260, “Image Analysis Handbook”, pp.5
05-516, The University of Tokyo Press, 1991 ".

【0007】[0007]

【発明が解決しようとする課題】本発明の目的とすると
ころは、フルカラー画像を入力し、該入力画像からリア
ルさを取り除きつつ原画像の風合いを残したイラスト風
カラー画像を作成することである。例えばアニメーショ
ンやイラストなどにおいて、人物の肌は、色の階調を用
いてグラデーションで表現されているより、階調を持た
ないベタ塗りで表現されている方が、アニメーション、
イラストの風あいがより強く出る。従って、フルカラー
画像を入力した場合、減色処理によって該フルカラー画
像のグラデーション表現を可能な限り単一色で塗りかえ
られることが望ましい。例えば人物顔のフルカラー画像
を入力した場合、肌色の部分は2ないし3色の代表的な
肌色で置き換えて表現できるように減色できることが望
ましい。しかも異なる色同士の境界は、疑似階調を用い
てグラデーション風に表現するのではなく、明確に境界
が表現される方がアニメーション、イラストの風あいが
強められる。
SUMMARY OF THE INVENTION It is an object of the present invention to input a full-color image and to create an illustration-like color image which retains the texture of the original image while removing the realism from the input image. . For example, in animations and illustrations, it is better to express a person's skin with solid colors without gradations than with gradations using color gradations.
The texture of the illustration appears more strongly. Therefore, when a full-color image is input, it is desirable that the gradation expression of the full-color image be repainted with a single color as much as possible by the color reduction processing. For example, when a full-color image of a human face is input, it is desirable that the color of the skin color can be reduced so that it can be expressed by replacing it with two or three representative skin colors. In addition, the boundaries between different colors are not expressed in a gradation style using pseudo gradations, but when the boundaries are clearly expressed, the texture of animation and illustration is enhanced.

【0008】かかる観点で従来の減色処理の有効性を考
えると、まず、上記1)のディザマトリクスを用いる方法
は、限定色を用いてできるだけ入力のフルカラー画像を
的確に再現するための方法であるので、本発明の目的に
そぐわないのは明らかである。
Considering the effectiveness of the conventional color reduction processing from such a viewpoint, first, the method using the dither matrix of the above 1) is a method for accurately reproducing an input full-color image as much as possible using limited colors. Thus, it is clear that the purpose of the present invention is not met.

【0009】一方、上記2)の色の統計的分布を用いて減
色する方法は、赤(R)、緑(G)、青(B)の3つの
明度軸からなるRGB色空間内で距離を定義し、前記距
離の近い色同士を一つの代表となる色にまとめることに
より色数を減らしていく仕組みである。すなわち、従来
の方法では、表示色の数(仮にここではMとする)を指
定すると、入力のフルカラー画像全体をスキャンして、
M色に塗り分けるためのRGB空間内での最適な距離を
計算し、 ・M個の代表色の計算 ・前記距離に応じた入力画像の各画素のM個の代表色へ
の変換 を行なうもので、入力のフルカラー画像全体をスキャン
して代表のM色を決めるため、Mの値を小さく設定すれ
ば前記距離は大きくなり、従って、似た色が連続的に変
化するグラデーション部分はある程度単一色もしくは
2、3の複数の色で置き換えることが可能である。
On the other hand, in the method of color reduction using the statistical distribution of colors in the above 2), the distance is reduced in an RGB color space including three lightness axes of red (R), green (G), and blue (B). This is a mechanism for reducing the number of colors by defining the colors that are close to each other into one representative color. That is, in the conventional method, when the number of display colors (M is assumed here) is designated, the entire input full-color image is scanned,
Calculates the optimal distance in the RGB space for separating into M colors, calculates M representative colors, and converts each pixel of the input image into M representative colors according to the distance. In order to determine the representative M color by scanning the entire input full-color image, if the value of M is set to a small value, the distance becomes large. Therefore, the gradation portion where similar colors continuously change is somewhat a single color. Alternatively, it can be replaced by a plurality of colors.

【0010】ところで、例えば全体的にくすんでいて、
ほんの少しだけ彩やかな部分が存在する画像を考える。
このような画像では、該彩やかな部分は際だって人の目
に印象的に写るものであるが、従来の方法では、入力画
像中で使用頻度の少ない色は、前記代表色のいずれかに
吸収されることになるため、上記の彩やかな部分の色
は、計算済みの代表色のどれかに置き換えられてしまう
ことになり、処理の結果得られた減色画像から受ける印
象は、入力画像から受ける印象とは異なるものになる可
能性が高い。
By the way, for example, the whole is dull,
Consider an image that has only a few colorful parts.
In such an image, the colorful portion is remarkably impressive to human eyes, but in the conventional method, the color that is used less frequently in the input image is replaced with any of the representative colors. Because of the absorption, the color of the vivid portion will be replaced by one of the calculated representative colors, and the impression received from the reduced color image obtained as a result of the processing will be the input image Is likely to be different from the impression received from

【0011】従って解決すべき課題としては、ほんの少
しだけ彩やかな部分が存在する画像を入力しても、その
彩やかな部分を残しつつ画像の減色処理を行なうことが
可能な装置およびその方法を提供することである。
Therefore, a problem to be solved is an apparatus and a method capable of performing color reduction processing of an image while inputting an image having only a little colorful portion while leaving the colorful portion. It is to provide.

【0012】[0012]

【課題を解決するための手段】かかる課題を解決するた
めに、本発明による減色装置は、画像を限定色で表現す
るための色変換情報を格納するルックアップテーブル
と、色の値に応じて入力画像の各画素を分類する分類ル
ールと、前記分類ルールを用いて入力画像の各々の画素
を複数個の属性値のいずれかで分類する分類手段と、分
類手段にて入力画像を構成する各々の画素を前記属性値
で分類し、前記分類の結果に基づいて、属性値が同じ画
素で構成される画素群に割り当てる色数を、それぞれの
属性値について計算する色数計算手段と、画像を入力
し、色変換情報を計算し前記計算結果を前記ルックアッ
プテーブルに格納するルックアップテーブル計算手段
と、ルックアップテーブルを参照し、入力画像を構成す
る各々の画素の色を前記限定色のいずれかに割り当てる
減色手段と、を主たる構成要素として具備することを特
徴とする。
In order to solve the above-mentioned problems, a color reduction apparatus according to the present invention uses a look-up table for storing color conversion information for expressing an image with a limited color, and a color conversion device according to a color value. A classification rule for classifying each pixel of the input image, a classification unit for classifying each pixel of the input image with any one of a plurality of attribute values using the classification rule, and The pixels are classified by the attribute value, and based on the result of the classification, the number of colors to be assigned to a pixel group composed of pixels having the same attribute value is calculated for each attribute value. A look-up table calculating means for inputting, calculating color conversion information and storing the calculation result in the look-up table, and referring to the look-up table to determine the color of each pixel constituting the input image. Characterized by comprising a color reduction means for assigning to any of Teiiro, as main components.

【0013】また本発明による減色方法は、前記分類ル
ールを用いて入力画像の各々の画素を複数個の属性値の
いずれかで分類する第1のステップと、前記第1のステ
ップでの処理結果に基づいて、属性値が同じ画素で構成
される画素群に割り当てる色数を、それぞれの属性値に
ついて計算する第2のステップと、画像を入力し、色変
換情報を計算し前記計算結果を前記ルックアップテーブ
ルに格納する第3のステップと、ルックアップテーブル
を参照し、入力画像を構成する各々の画素の色を前記限
定色のいずれかに割り当てる第4のステップと、正方形
フィルタを用いてフィルタ処理を施す第5のステップ
と、を包含することを特徴とする。
Further, in the color reduction method according to the present invention, a first step of classifying each pixel of the input image by any one of a plurality of attribute values using the classification rule, and a processing result in the first step A second step of calculating, for each attribute value, the number of colors to be assigned to a pixel group composed of pixels having the same attribute value, inputting an image, calculating color conversion information, and calculating the calculation result. A third step of storing in a look-up table, a fourth step of referencing the look-up table and assigning the color of each pixel constituting the input image to one of the limited colors, and a filter using a square filter. And a fifth step of performing processing.

【0014】本発明では、まず、分類手段によって、分
類ルールを参照しつつ入力画像の各々の画素を複数個の
属性値のいずれかで分類し、続いて色数計算手段にて、
分類結果を参照して、各々の属性値に対してそれぞれ
に、同じ属性値を持つ画素群に割り当てる色数を計算す
る。
According to the present invention, first, each pixel of the input image is classified by one of a plurality of attribute values by referring to the classification rule by the classifying means.
Referring to the classification result, the number of colors to be assigned to a pixel group having the same attribute value is calculated for each attribute value.

【0015】ルックアップテーブル計算手段では、前記
色数計算手段の処理結果を参照して、各々の属性値につ
いて、それぞれに対応したルックアップテーブルを作成
し、最後に減色手段にて、前記ルックアップテーブルを
参照して入力画像の各々の画素の色変換を行なって所望
の減色処理画像を得る。
The look-up table calculating means creates a look-up table corresponding to each attribute value with reference to the processing result of the number-of-colors calculating means. Color conversion of each pixel of the input image is performed with reference to the table to obtain a desired color-reduced image.

【0016】[0016]

【発明の実施の形態】以下、本発明の一実施例を図面を
用いて説明する。図1は、本発明の請求項1に記載の減
色装置の構成を示したブロック図である。
DESCRIPTION OF THE PREFERRED EMBODIMENTS One embodiment of the present invention will be described below with reference to the drawings. FIG. 1 is a block diagram showing a configuration of a color reduction apparatus according to claim 1 of the present invention.

【0017】本発明による減色装置は、主たる構成要素
として、画像を限定色で表現するための色変換情報を格
納するルックアップテーブル(105)と、色の値に応じて
入力画像の各画素を分類する分類ルール(102)と、分類
ルール(102)を用いて入力画像の各々の画素を複数個の
属性値のいずれかで分類する分類手段(101)と、分類手
段(101)にて入力画像を構成する各々の画素を前記属性
値で分類し、前記分類の結果に基づいて、属性値が同じ
画素で構成される画素群に割り当てる色数を、それぞれ
の属性値について計算する色数計算手段(103)と、画像
を入力し、色変換情報を計算し前記計算結果をルックア
ップテーブル(105)に格納するルックアップテーブル計
算手段(104)と、ルックアップテーブル(105)を参照し、
入力画像を構成する各々の画素の色を前記限定色のいず
れかに割り当てる減色手段(106)とを備えることを特徴
とし、さらに、画像を入力する入力手段(108)と、正方
形フィルタを用いてフィルタ処理を施すフィルタ手段(1
07)と、画像を表示する表示手段(109)とからなる構成を
有する。
The color reduction apparatus according to the present invention includes, as main components, a lookup table (105) for storing color conversion information for expressing an image with a limited color, and stores each pixel of an input image in accordance with a color value. Classification rule (102) for classification, classification means (101) for classifying each pixel of the input image by any one of a plurality of attribute values using the classification rule (102), and input by the classification means (101) Color number calculation for classifying each pixel constituting an image based on the attribute value and calculating, for each attribute value, the number of colors to be assigned to a pixel group composed of pixels having the same attribute value based on the result of the classification Means (103), input an image, look-up table calculating means (104) for calculating the color conversion information and storing the calculation result in a look-up table (105), refer to the look-up table (105),
A color reduction means (106) for assigning the color of each pixel constituting the input image to any of the limited colors, further comprising an input means (108) for inputting an image, and a square filter. Filter means for filtering (1
07) and display means (109) for displaying an image.

【0018】以下、本発明を構成する各構成要素につい
て説明する。図2〜図4は、本発明における処理全般に
おいて必要とするルックアップテーブル(105)の構成例
を示した概念図である。まず、図2に示すルックアップ
テーブル(105)は、赤(R)、緑(G)、青(B)の各
々の明度が8ビット(=256)の階調を持つ場合の具
体例である。この例では、RGBをこの順に上位から8
ビットずつ埋めて合計3バイトで表される数値をルック
アップテーブル(105)のテーブル番号(201、配列でいう
要素番号に対応する)とし、その配列要素(202)には、
実際に置き換えるべき色のデータが格納されるという構
成をとる。
Hereinafter, each component constituting the present invention will be described. FIG. 2 to FIG. 4 are conceptual diagrams showing an example of the configuration of a look-up table (105) required in the overall processing in the present invention. First, the lookup table (105) shown in FIG. 2 is a specific example in the case where the brightness of each of red (R), green (G), and blue (B) has a gradation of 8 bits (= 256). . In this example, the RGB values are set in the order of 8
A numerical value represented by a total of 3 bytes by padding each bit is set as a table number (201, corresponding to an element number in the array) of the lookup table (105), and the array element (202) includes:
The configuration is such that data of a color to be actually replaced is stored.

【0019】例えば図2の例では、(R,G,B)の値が(0
x01,0x01,0x01)ならば、これをまとめて3バイトで表現
すると0x010101になり、さらに0x010101を十進法に変換
すると、65793番目の配列要素のデータということにな
り、そこに格納されているデータが0x000000であること
から、前記(0x01,0x01,0x01)のデータがあれば、このデ
ータは(0x00,0x00,0x00)で置き換えるということが、図
2のルックアップテーブル(105)から読みとれる。
For example, in the example of FIG. 2, the value of (R, G, B) is (0
x01,0x01,0x01), if these are expressed together in 3 bytes, it becomes 0x010101, and if 0x010101 is converted to decimal, it is the data of the 65793th array element, and the data stored there is Since it is 0x000000, it can be read from the lookup table (105) in FIG. 2 that if there is the data of (0x01, 0x01, 0x01), this data is replaced with (0x00, 0x00, 0x00).

【0020】しかしながら、前述のように、赤(R)、
緑(G)、青(B)の各々の明度が8ビット(=25
6)の階調を持つルックアップテーブル(105)を作成す
るとなると、該ルックアップテーブル(105)を格納する
メモリ容量が多大になることが問題となる。例えば、図
2の例では、色変換後のデータを格納するデータが、1
色につき3バイト必要であり、また、このデータ配列サ
イズは色数分、すなわち16777216個になるため、メモリ
容量や処理速度などの面で実装には適しない。
However, as described above, red (R),
The brightness of each of green (G) and blue (B) is 8 bits (= 25
When the lookup table (105) having the gradation of 6) is created, there is a problem that the memory capacity for storing the lookup table (105) becomes large. For example, in the example of FIG. 2, the data for storing the data after the color conversion is 1
Since 3 bytes are required for each color, and the data array size is equal to the number of colors, that is, 16777216, it is not suitable for mounting in terms of memory capacity and processing speed.

【0021】そこで実際には、例えば赤(R)、緑
(G)、青(B)の各々の明度を4ないし5ビットの階
調まで落したルックアップテーブル(105)などが用いら
れる。図3は赤(R)、緑(G)、青(B)の各々の明
度が4ビット場合のルックアップテーブル(105)の例で
あり、この場合、ルックアップテーブル(105)のサイズ
は4096個で済む。
Therefore, in practice, for example, a look-up table (105) is used in which the brightness of each of red (R), green (G), and blue (B) is reduced to a 4- or 5-bit gradation. FIG. 3 shows an example of the look-up table (105) when the brightness of each of red (R), green (G), and blue (B) is 4 bits. In this case, the size of the look-up table (105) is 4096. It only needs an individual.

【0022】また、図4は減色後の色数が256色(=
1バイト)以内の場合、さらに必要なメモリ容量を少な
くすることのできるように構成したルックアップテーブ
ル(105)である。この例では、従来のルックアップテー
ブル(105)においての減色後の色を書き込む部分に、直
接その色を書き込むのではなく、その色データが実際に
書き込んである対応表(特にここではカラーパレットと
呼ぶ)の行番号(203)にしてある。こうすれば、ルック
アップテーブル(105)の減色後の色を書き込む場所のサ
イズは1バイトですむ。別にカラーパレットを用意する
必要はあるが、必要なメモリの合計を考えれば、カラー
パレットを別に作成するほうが少ないメモリ容量で済む
ことは明らかである。
FIG. 4 shows that the number of colors after color reduction is 256 (=
If it is less than 1 byte, it is a lookup table (105) configured to further reduce the required memory capacity. In this example, instead of directly writing the color after the color reduction in the conventional look-up table (105), the corresponding table (in particular, the color palette and Call) (203). In this case, the size of the place for writing the color after the color reduction of the lookup table (105) is only 1 byte. Although it is necessary to prepare a separate color palette, it is clear from the consideration of the total required memory that a smaller memory capacity is required if a separate color palette is created.

【0023】本発明による分類手段(101)は、本発明に
よる分類ルール(102)を用いて入力画像の各々の画素を
複数個の属性値のいずれかで分類するものであり、該分
類ルール(102)とは、ある画素について該画素の色の値
に応じて入力画像の各画素を分類するルールであって、
例えば以下の例に示すようなものである。ただし、ここ
では、彩度をs、明度をvで表し、sとvはいずれも0〜2
55の範囲の値をとるものとする。
The classification means (101) according to the present invention classifies each pixel of the input image by one of a plurality of attribute values using the classification rule (102) according to the present invention. 102) is a rule for classifying each pixel of the input image according to the color value of the pixel for a certain pixel,
For example, it is as shown in the following example. Here, the saturation is represented by s and the lightness is represented by v, and both s and v are 0 to 2
A value in the range of 55 is assumed.

【0024】なお、分類手段(101)における処理は、本
発明の請求項8に記載の減色方法における第1のステッ
プの処理に対応するものである。
The processing in the classification means (101) corresponds to the processing in the first step in the color reduction method according to claim 8 of the present invention.

【0025】分類ルールの例:「ある画素について、当
該画素のs,vの値を計算し、(sが128以上でかつvの
値が144以上)または、(vの値が224以上)であ
れば、当該画素の属性値の値をA、そうでなければ属性
値の値をBとする」。
Example of classification rule: "For a pixel, calculate the value of s, v of the pixel, and calculate (s is 128 or more and v is 144 or more) or (v is 224 or more). If so, the attribute value of the pixel is A, otherwise the attribute value is B. "

【0026】なお、上記の例で用いた分類ルール(102)
は、本発明の請求項3に記載の高明彩度画素検出ルール
の一実施例としても使用可能である。以下では上記の例
を分類ルール(1)と呼ぶ。
The classification rule (102) used in the above example
Can also be used as an embodiment of the high brightness chroma pixel detection rule according to the third aspect of the present invention. Hereinafter, the above example is referred to as a classification rule (1).

【0027】続いて分類手段(101)での処理の流れを図
5に従って説明する。図5は本発明による分類手段(10
1)での処理の流れを示すフローチャートである。
Next, the flow of processing in the classification means (101) will be described with reference to FIG. FIG. 5 shows a classification means (10
3 is a flowchart showing the flow of the process in 1).

【0028】(301a)属性値として使用する値以外の値で
ルックアップテーブル(105)を初期化する。
(301a) The lookup table (105) is initialized with a value other than the value used as the attribute value.

【0029】(302a)入力画像中でまだ属性値が決定して
いない任意の1画素を取りだし、分類ルール(102)によ
り当該画素の属性値を決定する。
(302a) An arbitrary pixel whose attribute value has not yet been determined is extracted from the input image, and the attribute value of the pixel is determined by the classification rule (102).

【0030】(303a)当該画素の色に対応するルックアッ
プテーブル(105)に、決定した属性値を書き込む。
(303a) The determined attribute value is written in the lookup table (105) corresponding to the color of the pixel.

【0031】(304a)入力画像のすべての画素について、
上記(302a)〜(303a)の処理が終了したならば、分類手段
(101)での処理を終了する。また未終了であるならば、
(302a)に戻り(302a)〜(303a)の処理を繰り返す。
(304a) For all pixels of the input image,
If the above processes (302a) to (303a) are completed,
The process at (101) ends. If it is not finished,
Returning to (302a), the processing of (302a) to (303a) is repeated.

【0032】なお、図6は、図5において分類ルール
(1)を適用した場合の具体的な処理フローの例であ
る。処理の流れの内容は図5と同じであるので説明は省
略する。
FIG. 6 shows an example of a specific processing flow when the classification rule (1) is applied in FIG. The details of the processing flow are the same as those in FIG.

【0033】本発明による色数計算手段(103)は、入力
画像を構成する各々の画素が分類手段(101)にて分類さ
れた結果に基づいて、属性値が同じ画素で構成される画
素群に割り当てる色数を、それぞれの属性値について計
算する。図7は本発明による色数計算手段(103)におけ
る処理の流れの例をフローチャートの形式で示したもの
で、図7に従って色数計算手段(103)での処理例を説明
する。なお、色数計算手段(103)における処理は、本発
明の請求項8に記載の減色方法における第2のステップ
の処理に対応するものである。
The number-of-colors calculating means (103) according to the present invention comprises a pixel group consisting of pixels having the same attribute value based on the result of classification of each pixel constituting the input image by the classification means (101). Is calculated for each attribute value. FIG. 7 is a flowchart showing an example of the flow of processing in the number-of-colors calculating means (103) according to the present invention. An example of processing in the number-of-colors calculating means (103) will be described with reference to FIG. The processing in the color number calculation means (103) corresponds to the processing in the second step in the color reduction method according to claim 8 of the present invention.

【0034】(401)減色後の色数Nを入力する。また、
ルックアップテーブル(105)を参照することにより、分
類手段(101)にて分類された属性値の個数を調べる。こ
こでは説明の都合上、前記個数はk個とし、また、i
(1≦i≦k)番目の属性値をAiとする。
(401) The number of colors N after color reduction is input. Also,
By referring to the look-up table (105), the number of attribute values classified by the classification means (101) is checked. Here, for convenience of explanation, the number is assumed to be k, and i
The (1 ≦ i ≦ k) -th attribute value is Ai.

【0035】(402)i=1、…、kについて、属性値が
Aiである画素群の標本数Hi、および属性値がAiで
ある画素群のちらばりの度合いViを計算する。
(402) For i = 1,..., K, the number of samples Hi of the pixel group whose attribute value is Ai and the degree Vi of the scattering of the pixel group whose attribute value is Ai are calculated.

【0036】ここで、前記Viの計算方法には色々考え
られるが、例えば、画素を赤(R)、緑(G)、青
(B)の色の構成要素に分解し、赤(R)、緑(G)、
青(B)のそれぞれでのパラメータ空間で分散を計算し
たものの合計値でもってViの値とするなど、色空間で
の画素群の散らばりを反映させられるものであれば、V
iの計算方法はどのようなものであってもよい。
There are various methods for calculating Vi. For example, a pixel is decomposed into components of red (R), green (G), and blue (B), and red (R), Green (G),
If the dispersion of pixel groups in the color space can be reflected, for example, the value of Vi is calculated by the sum of the variances calculated in the parameter space for each of blue (B), V
The calculation method of i may be any.

【0037】(403)i=1、…、kについて、Hiの値
およびViの値から、属性値がAiである画素群に割り
当てる色数Niを計算する。
(403) For i = 1,..., K, the number of colors Ni to be assigned to the pixel group whose attribute value is Ai is calculated from the value of Hi and the value of Vi.

【0038】ここで、Niの計算方法には色々考えられ
るが、基本方針として、 ・頻度Hiが大きい場合にはNiの値を大きく、Hiが
小さい場合にはNiの値を小さくする。
Here, there are various methods for calculating Ni. The basic policy is as follows: When the frequency Hi is large, the value of Ni is increased, and when the frequency Hi is small, the value of Ni is decreased.

【0039】・散らばりの度合いViが大きい場合には
Niの値を大きく、Viが小さい場合にはNiの値を小
さくする。
If the degree of dispersion Vi is large, the value of Ni is increased, and if Vi is small, the value of Ni is decreased.

【0040】とすれば色数の妥当な割当ができると考え
られる。上記方針に基づいて例えば次の式(1)、 Ni=Sqrt(Hi)×Vi 式(1) (但しSqrt(x)はxの平方根を返す関数)でNiを計算し、
続いて、 Σ(i=1,…,k)Ni=N 満たすようにNiを正規化し目的のNiを得るなどの方
法が有効であると思われる。
In this case, it is considered that the number of colors can be appropriately assigned. Based on the above policy, for example, Ni is calculated by the following equation (1), Ni = Sqrt (Hi) × Vi Equation (1) (where Sqrt (x) is a function that returns the square root of x)
Then, it is considered that a method of normalizing Ni to obtain Ni (i = 1,..., K) Ni = N to obtain a target Ni is effective.

【0041】上記では、属性値がAiである画素群の標
本数Hi、及び属性値がAiである画素群のちらばりの
度合いViに基づいて色数Niを計算する方法を示した
が、例えば処理速度の遅い装置でできるだけ処理コスト
を小さくしたい場合などは、もっと簡単に、i=1、
…、kについて、属性値がAiである画素群の標本数H
iのみを観測し、その平方根の比でNiの値を決めるな
どの方法でもよい。
In the above description, a method of calculating the number of colors Ni based on the number of samples Hi of the pixel group whose attribute value is Ai and the degree of dispersion Vi of the pixel group whose attribute value is Ai has been described. If the processing cost is to be as small as possible with a device having a low processing speed, i = 1,
.., K, the sample number H of the pixel group whose attribute value is Ai
A method of observing only i and determining the value of Ni by the square root ratio may be used.

【0042】すなわち、例えば次の式(2)、 Ni=Sqrt(Hi) 式(2) (但しSqrt(x)はxの平方根を返す関数)でNiを計算し、
続いて、 Σ(i=1,…,k)Ni=N を満たすようにNiを正規化し目的のNiを得るなどの
方法が有効であると思われる。
That is, for example, Ni is calculated by the following equation (2), Ni = Sqrt (Hi) Equation (2) (where Sqrt (x) is a function that returns the square root of x)
Subsequently, it is considered that a method of normalizing Ni to obtain 目的 (i = 1,..., K) Ni = N to obtain a target Ni is effective.

【0043】なお、Niの計算においては、上記の式
(1)または式(2)のどちらを用いるとしてもHiの
値がNiに影響を及ぼすが、Hiが十分小さい場合、N
iに1以上の値を与えるのは無意味となる。その場合、
i番目の属性値は何らかの手段でそれ以外のいずれかの
属性値に置き換えるのがよい。例えば、ある分類ルール
(102)によって2つの属性に分けるべき状況で、どちら
か1つの属性に分類された画素の総数が、他方の属性に
分類された画素の総数の、例えば0.3%に満たないと
いう結果になった場合、すべての画素を同じ属性値にし
てしまうなどが上記置き換えの一例にあたるわけで、分
類結果に応じて該例のような追加処理が必要な場合は、
追加処理が必要な条件と、前記追加処理の内容を、合わ
せて分類ルール(102)に記述しておけばよい(下記の例
参照)。
In the calculation of Ni, the value of Hi affects Ni regardless of either of the above formulas (1) and (2).
Giving i a value of 1 or more is meaningless. In that case,
The i-th attribute value may be replaced by any other attribute value by some means. For example, a classification rule
In the situation where the two attributes should be divided according to (102), the total number of pixels classified into one of the attributes is less than, for example, 0.3% of the total number of pixels classified into the other attribute. In such a case, all pixels have the same attribute value, which is an example of the above replacement.If additional processing like the example is necessary according to the classification result,
The condition that requires additional processing and the content of the additional processing may be described together in the classification rule (102) (see the following example).

【0044】分類ルール(1)の処理を追加した例:
「ある画素について、当該画素のs,vの値を計算し、(s
が128以上でかつvの値が144以上)または、(vの
値が224以上)であれば、当該画素の属性値の値を
A、そうでなければ属性値の値をBとする」。
Example in which the processing of the classification rule (1) is added:
"For a pixel, calculate the value of s, v for that pixel, (s
Is 128 or more and the value of v is 144 or more) or (the value of v is 224 or more), the attribute value of the pixel is A, otherwise the attribute value is B. "

【0045】また、分類処理後、必要に応じて以下の2
処理を実行する ・属性値がAの画素の占める割合がが全体の0.3%以
下なら、属性値がAの画素の属性値をすべてBに変更す
る。
After the classification process, if necessary, the following 2
Execute the process. If the ratio of the pixels having the attribute value A is less than 0.3% of the whole, the attribute values of the pixels having the attribute value A are all changed to B.

【0046】・属性値がBの画素の占める割合がが全体
の0.3%以下なら、属性値がBの画素の属性値をすべ
てAに変更する。
If the proportion of the pixels having the attribute value B is less than 0.3% of the whole, the attribute values of the pixels having the attribute value B are all changed to A.

【0047】本発明によるルックアップテーブル計算手
段(104)は、属性値が同じ画素で構成される画素群に割
り当てる色数に基づいて、属性値が同じ画素で構成され
る画素群の代表色を計算し、前記計算結果をルックアッ
プテーブル(105)に格納する。
The lookup table calculating means (104) according to the present invention calculates a representative color of a pixel group having the same attribute value based on the number of colors assigned to the pixel group having the same attribute value. Calculate and store the calculation result in the lookup table (105).

【0048】図8は本発明によるルックアップテーブル
計算手段(104)における処理の流れの例を示すフローチ
ャートで、図8に従ってルックアップテーブル計算手段
(104)での処理例を説明する。尚、ルックアップテーブ
ル計算手段(104)における処理は、本発明の請求項8に
記載の減色方法における第3のステップの処理に対応す
るものである。
FIG. 8 is a flow chart showing an example of the flow of processing in the lookup table calculation means (104) according to the present invention.
The processing example in (104) will be described. The processing in the lookup table calculation means (104) corresponds to the processing in the third step in the color reduction method according to claim 8 of the present invention.

【0049】(501)i=1、…、kについて、属性値が
Aiである画素群の標本数Hiの値および、属性値がA
iである画素群に割り当てられる色数Niから、属性値
がAiである画素群を対象として色空間内で類似した色
であるかどうかを判断する距離Diを計算する。
(501) For i = 1,..., K, the value of the sample number Hi of the pixel group whose attribute value is Ai and the attribute value of A
From the number of colors Ni assigned to the pixel group i, a distance Di for determining whether or not the pixel group having the attribute value Ai is a similar color in the color space is calculated.

【0050】Diの計算方法についてはさまざまな方法
が開示されている。例えば前出の文献「”画像解析ハン
ドブック”」のpp.513-514に開示の立方最密配置による
方法で定義されている距離は、本方法に適した距離定義
の一つであると思われる。
Various methods for calculating Di have been disclosed. For example, the distance defined by the cubic close-packed method disclosed in pp.513-514 of the above-mentioned document "" Image Analysis Handbook "" seems to be one of the distance definitions suitable for this method. .

【0051】(502)i=1、…、kについて、属性値が
Aiである画素群に対するNi個の代表色を、前記距離
Diに基づいて計算する。前出の文献に開示の立法最密
配置による方法では、該代表色を選定するアルゴリズム
についても開示されているが、本処理における代表色の
選定に前記アルゴリズムを適用することが可能である。
なお、前記アルゴリズムでは、決められた計算を繰り返
すことよってより適切な代表色を決定する方法が開示さ
れているが、処理速度の遅い装置でできるだけ処理コス
トを小さくしたい場合などは、前記決められた計算を一
度行なうだけでもある程度の質を保った結果を得ること
が可能である。
(502) For i = 1,..., K, Ni representative colors for a pixel group whose attribute value is Ai are calculated based on the distance Di. In the method based on the legislative close-packed arrangement disclosed in the above-mentioned document, an algorithm for selecting the representative color is also disclosed. However, the algorithm can be applied to the selection of the representative color in the present processing.
In the above algorithm, a method of determining a more appropriate representative color by repeating a predetermined calculation is disclosed.However, in a case where it is desired to reduce the processing cost as much as possible with a device having a low processing speed, the above-described method is used. It is possible to obtain a result with a certain level of quality by performing the calculation only once.

【0052】(503)i=1、…、kについて、属性値が
Aiであるそれぞれの画素Ni個のどの代表色で置き換
えるかを、色空間での距離に基づいて計算し、結果をル
ックアップテーブル(105)に書き込み、ルックアップテ
ーブル計算手段(104)での処理を終了する。
(503) For i = 1,..., K, which representative color of each pixel Ni whose attribute value is Ai is to be replaced is calculated based on the distance in the color space, and the result is looked up. The result is written in the table (105), and the processing in the lookup table calculation means (104) is completed.

【0053】本発明による減色手段(106)は、ルックア
ップテーブル(105)を参照し、入力画像を構成する各々
の画素の色を前記限定色のいずれかに割り当てる処理を
行なう。図9は本発明による減色手段(106)での処理の
流れをフローチャートで簡単に示した例で、図9に従っ
て減色手段(106)での処理の流れを簡単に説明する。な
お、減色手段(106)における処理は、本発明の請求項8
に記載の減色方法における第4のステップの処理に対応
するものである。
The color reduction means (106) according to the present invention refers to the look-up table (105) and performs a process of assigning the color of each pixel constituting the input image to one of the limited colors. FIG. 9 is a flowchart simply showing the flow of processing in the color reduction means (106) according to the present invention. The flow of processing in the color reduction means (106) will be briefly described with reference to FIG. The processing in the color reduction means (106) is performed according to claim 8 of the present invention.
This corresponds to the processing of the fourth step in the color reduction method described in (1).

【0054】(601)入力画像中でまだ色変換を行なって
いない任意の1画素を取りだし、ルックアップテーブル
(105)の当該画素の当該画素に対応する色の部分を参照
し、そこに書かれている変換後の色で当該画素の色を書
き換える。
(601) An arbitrary pixel which has not been subjected to color conversion in the input image is extracted, and a look-up table is obtained.
The color of the pixel corresponding to the pixel of (105) is referred to, and the color of the pixel is rewritten with the converted color written therein.

【0055】(602)入力画像のすべての画素について、
上記(601)の処理が終了したならば、減色手段(106)での
処理を終了する。また未終了であるならば、(601)の処
理を繰り返す。
(602) For all pixels of the input image,
When the processing of (601) is completed, the processing by the color reduction means (106) is completed. If the processing has not been completed, the processing of (601) is repeated.

【0056】次に、本発明による減色装置および減色方
法での減色処理の全体の流れを図10のフローチャート
に従って説明する。また図11は処理が進んでいくにつ
れてルックアップテーブル(105)の内容が書き変わって
いく様子を示したものである。なお本例は、入力画像の
各画素の色データの赤(R)、緑(G)、青(B)各々
の明度が4ビット(=16)の階調を持ち、分類ルール
(102)は前述の分類ルール(1)を用いた場合について
である。
Next, the overall flow of the color reduction processing by the color reduction apparatus and the color reduction method according to the present invention will be described with reference to the flowchart of FIG. FIG. 11 shows how the contents of the lookup table (105) are rewritten as the processing proceeds. In this example, the brightness of each of red (R), green (G), and blue (B) of the color data of each pixel of the input image has a gradation of 4 bits (= 16), and the classification rule
(102) is the case where the above-described classification rule (1) is used.

【0057】(701)入力手段(108)にて画像を入力し、ル
ックアップテーブル(105)を初期化する。図11(a)はル
ックアップテーブル(105)が初期化された状態を示した
ものである。
(701) An image is input by the input means (108), and the lookup table (105) is initialized. FIG. 11A shows a state in which the lookup table (105) has been initialized.

【0058】(702)分類手段(101)によって、分類ルール
(102)を参照しつつ入力画像の各々の画素を複数個の属
性値のいずれかで分類し、その結果をルックアップテー
ブル(105)に上書きする(図11(b))。なお本例は分類
ルール(102)の例として前出の分類ルール(1)を用い
た場合である。
(702) The classification means (101) uses the classification rule
Referring to (102), each pixel of the input image is classified by one of a plurality of attribute values, and the result is overwritten on the lookup table (105) (FIG. 11 (b)). This example is a case where the above-described classification rule (1) is used as an example of the classification rule (102).

【0059】(703)色数計算手段(103)にて、ルックアッ
プテーブル(105)を参照することにより、分類手段(101)
にて分類された属性値の個数が複数個かどうかを調べ
る。この個数をkとする。もしk=1なら、以下の処理
(704)〜(705)を、k>1ならば以下の処理(706)〜(708)
を実行する。前記分類ルール(1)では、画素をAとB
の2種類の属性値に分類するルールであるのでk=2と
なる。
(703) The color number calculating means (103) refers to the look-up table (105), and the classification means (101)
It is checked whether or not the number of attribute values classified by is plural. Let this number be k. If k = 1, the following processing
(704) to (705), if k> 1, the following processing (706) to (708)
Execute According to the classification rule (1), pixels are A and B
Since the rule is classified into the two types of attribute values, k = 2.

【0060】尚、以下の処理(705)においてのルックア
ップテーブル(105)の構成方法については公知の技術で
あるため、以下では、ルックアップテーブル(105)が再
構成されその内容が書き換えられていく様子は、(707)
の処理においてのみ図11(c,d)を用いた説明を行な
う。
Since the lookup table (105) in the following processing (705) is a known technique, the lookup table (105) is reconstructed and its contents are rewritten in the following. How to go (707)
Description will be made with reference to FIG.

【0061】(704)ルックアップテーブル計算手段(104)
によって、あらかじめ指定されている減色処理後の色数
分の代表色を計算し、ルックアップテーブル(105)を完
成させる。k=1の場合、ルックアップテーブル(105)
は図4に描かれたように、通常の形式のルックアップテ
ーブル(105)となる。
(704) Look-up table calculating means (104)
Thus, the representative colors for the number of colors after the color reduction processing specified in advance are calculated, and the lookup table (105) is completed. If k = 1, look-up table (105)
Is a look-up table (105) in the usual format, as depicted in FIG.

【0062】(705)減色手段(106)にて、ルックアップテ
ーブル(105)を参照し、入力画像を構成する各々の画素
の色を前記限定色の対応する色で書き換える。
(705) The color reduction means (106) refers to the look-up table (105) and rewrites the color of each pixel constituting the input image with the color corresponding to the limited color.

【0063】(706)色数計算手段(103)にて、入力画像を
構成する各々の画素が分類手段(101)にて分類された結
果に基づいて、属性値が同じ画素で構成される画素群に
割り当てる色数を、それぞれの属性値について計算す
る。ここでは仮にAに割り当てられた色数をNa、Bに
割り当てられた色数をNbとする。
(706) Based on the result of classification of each pixel constituting the input image by the color number calculation means (103) by the classification means (101), pixels having the same attribute value The number of colors to be assigned to the group is calculated for each attribute value. Here, it is assumed that the number of colors assigned to A is Na, and the number of colors assigned to B is Nb.

【0064】(707)ルックアップテーブル計算手段(104)
によって、それぞれの属性値に対応したルックアップテ
ーブル(105)を作成し、同時に減色後の色数分の代表色
を計算し、ルックアップテーブル(105)を完成させる。
図11(c)の例では、属性値AおよびBに対応した2つ
のルックアップテーブル(105)を作成する。また、サイ
ズ(配列の大きさ)がNa、Nbのカラーパレット(図
11(d))も同時に作成する。そして、属性値Aについ
てはNa分の、属性値BについてはNb分の代表色を計
算し、それぞれに対応したルックアップテーブル(105)
を完成させる。
(707) Look-up table calculating means (104)
Thus, a lookup table (105) corresponding to each attribute value is created, and at the same time, representative colors for the number of colors after color reduction are calculated, thereby completing the lookup table (105).
In the example of FIG. 11C, two lookup tables (105) corresponding to the attribute values A and B are created. In addition, a color palette (FIG. 11 (d)) whose size (size of the array) is Na or Nb is simultaneously created. Then, a representative color for Na is calculated for the attribute value A, and a representative color for Nb is calculated for the attribute value B, and the corresponding lookup table (105) is calculated.
To complete.

【0065】(708)減色手段(106)にて、入力画像を構成
する各々の画素の色を、前記画素の属性値AおよびBに
対応したルックアップテーブル(105)を参照し、前記限
定色の対応する色で書き換える。
(708) The color reduction means (106) determines the color of each pixel constituting the input image by referring to the look-up table (105) corresponding to the attribute values A and B of the pixel. Rewrite with the corresponding color of.

【0066】(709)必要であれば減色処理後の画像に雑
音除去などのフィルタ処理を施す。 (710)表示手段(109)にて減色画像を表示し、減色処理を
終了する。
(709) If necessary, the image after the color reduction processing is subjected to filter processing such as noise removal. (710) The reduced color image is displayed on the display means (109), and the color reduction processing ends.

【0067】なお、図12は、本発明の請求項7に記載
の減色装置の構成例を示したブロック図である。本発明
の請求項7に記載の減色装置では、図12で示してある
がごとく、本発明の請求項1に記載の減色装置(図1)
にさらに、フィルタ手段(107)を用いて入力画像のエッ
ジ成分を抽出するエッジ抽出手段(110)、画素の明度値
を比較して2枚の画像を合成する重ね合わせ手段(111)
を加えた構成にすることにより、減色した画像にエッジ
画像を重ね合わせることができる。この場合、重ね合わ
せ手段(111)において、画像を重ね合わせた後の色の計
算方法としては、入力した2枚の画像の同じ座標位置の
点同士の明度を比較し、明度の低いほうの画素の色を、
重ね合わせ後の画素の色とするなどの方法を用いれば良
い。該重ね合わせ処理により、入力画像に対して、アニ
メーション風の効果が施された画像を自動で作成するこ
とが可能となる。
FIG. 12 is a block diagram showing a configuration example of the color reduction apparatus according to the seventh aspect of the present invention. In the color reduction device according to the seventh aspect of the present invention, as shown in FIG. 12, the color reduction device according to the first aspect of the present invention (FIG. 1)
Further, an edge extracting means (110) for extracting an edge component of the input image by using a filtering means (107), and a superimposing means (111) for comparing brightness values of pixels to synthesize two images.
, The edge image can be superimposed on the color-reduced image. In this case, the superimposing means (111) calculates the color after superimposing the images by comparing the lightness of points at the same coordinate position of the two input images and determining the pixel having the lower lightness. The color of
A method of setting the color of the pixel after superposition may be used. By the superimposition processing, an image in which an animation-like effect has been applied to an input image can be automatically created.

【0068】なお、フィルタ手段(107)における処理
は、本発明の請求項8に記載の減色方法における第5の
ステップの処理に、また、前記重ね合わせ手段(111)に
おける処理は、本発明の請求項10に記載の減色方法に
おける第7のステップの処理にそれぞれ対応するもので
ある。
The processing in the filter means (107) is the same as the processing in the fifth step in the color reduction method according to the present invention, and the processing in the superimposing means (111) is the same as that in the present invention. This corresponds to the processing of the seventh step in the color reduction method according to claim 10.

【0069】図13は本発明の請求項7に記載の減色装
置および請求項10に記載の減色方法における処理の流
れをフローチャートの形式で示したものである。全体の
処理は、減色の処理((701)〜(710))とエッジ抽出の処
理(711)を並行して実行した後(どちらの処理が先でも
よい)、最後に、(701)減色の処理結果の画像とエッジ
抽出処理結果の画像を重ね合わせて終了する。なお、エ
ッジ抽出手段(110)の構成方法および、その際に使用す
る正方形フィルタの構成方法については、特願平8ー8
1268号にて詳述しているので、ここでは説明は省略
する。また、図13における処理(701)〜(710)は、図1
0における処理と同じであるので説明は省略する。また
エッジ抽出手段(110)における処理は、本発明の請求項
10に記載の減色方法における第6のステップの処理に
対応するものである。
FIG. 13 is a flowchart showing the flow of processing in a color reduction apparatus according to a seventh aspect of the present invention and a color reduction method according to a tenth aspect of the present invention. The overall processing is to execute the color reduction processing ((701) to (710)) and the edge extraction processing (711) in parallel (either processing may be performed first), and finally (701) the color reduction processing. The image of the processing result and the image of the edge extraction processing result are overlapped, and the processing ends. Regarding the configuration method of the edge extracting means (110) and the configuration method of the square filter used at that time, refer to Japanese Patent Application No. 8-8 / 1996.
1268, the description is omitted here. The processes (701) to (710) in FIG.
0, so the description is omitted. The processing in the edge extracting means (110) corresponds to the processing in the sixth step in the color reduction method according to claim 10 of the present invention.

【0070】[0070]

【発明の効果】本発明では、用途に応じた分類ルールを
用意し、分類手段にて該分類ルールを用いて入力画像の
色分布を分析分類することにより、例えば全体的にくす
んでいて、ほんの少しだけ彩やかな部分が存在する画像
については、該彩やかな部分の存在がどの程度あるか確
認でき、前記分類手段の処理結果によって該彩やかな部
分とそれ以外の部分とに割り当てる適切な色数を色数計
算手段によって計算する処理を新たに組み込んでいる。
According to the present invention, a classification rule according to a use is prepared, and the color distribution of an input image is analyzed and classified by the classification means using the classification rule. For an image having a slightly colorful portion, it is possible to confirm the degree of the presence of the colorful portion, and it is possible to appropriately assign the colorful portion and the other portion according to the processing result of the classification means. A process for calculating the number of colors by the number-of-colors calculating means is newly incorporated.

【0071】従来の減色処理においては、全体に対して
統計的に頻度の小さいデータが頻度の大きいデータに吸
収されるため、該頻度の小さいデータが減色処理によっ
て失われてしまうという問題があったが、この分類ルー
ル、分類手段および色数計算手段の導入によって、頻度
が小さくても必要である部分を残したままの減色処理が
可能となった。例えば上記画像の例では、ほんの少しだ
け彩やかな部分とそれ以外の部分とで独立して減色処理
を行なうことを実現し、その結果として、減色処理後も
彩やかな部分を残すことができる。
In the conventional color reduction processing, there is a problem that the data having a low frequency is absorbed by the data having a high frequency statistically with respect to the whole, so that the data having a low frequency is lost by the color reduction processing. However, the introduction of the classification rule, the classification means, and the number-of-colors calculation means enabled the color reduction processing while leaving a necessary part even if the frequency is low. For example, in the example of the above-described image, it is possible to realize that the color reduction processing is performed independently on the slightly colorful part and the other part, and as a result, the colorful part can be left after the color reduction processing. .

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

【図1】本発明の請求項1に記載の減色装置の一実施の
形態の構成を示したブロック図
FIG. 1 is a block diagram showing a configuration of an embodiment of a color reduction apparatus according to claim 1 of the present invention.

【図2】従来のルックアップテーブルの構成例を示した
概念図
FIG. 2 is a conceptual diagram showing a configuration example of a conventional lookup table.

【図3】従来のルックアップテーブルの構成例を示した
概念図
FIG. 3 is a conceptual diagram showing a configuration example of a conventional lookup table.

【図4】従来のルックアップテーブルの構成例を示した
概念図
FIG. 4 is a conceptual diagram showing a configuration example of a conventional lookup table.

【図5】本発明による分類手段での処理の流れを示すフ
ローチャート
FIG. 5 is a flowchart showing a flow of processing in a classification unit according to the present invention.

【図6】本発明による分類手段での処理の流れを分類ル
ールの例に基づいて示したフローチャート
FIG. 6 is a flowchart showing the flow of processing in the classification means according to the present invention based on an example of a classification rule;

【図7】本発明による色数計算手段における処理の流れ
の例を示すフローチャート
FIG. 7 is a flowchart showing an example of the flow of processing in the number-of-colors calculating means according to the present invention.

【図8】本発明によるルックアップテーブル計算手段に
おける処理の流れの例を示すフローチャート
FIG. 8 is a flowchart showing an example of the flow of processing in a lookup table calculation unit according to the present invention.

【図9】本発明による減色手段での処理の流れを示すフ
ローチャート
FIG. 9 is a flowchart showing the flow of processing in the color reduction means according to the present invention.

【図10】本発明による減色装置および減色方法での減
色処理の全体の流れを示すフローチャート
FIG. 10 is a flowchart showing an overall flow of a color reduction process in the color reduction apparatus and the color reduction method according to the present invention.

【図11】本発明によるルックアップテーブルの構成例
を示した概念図
FIG. 11 is a conceptual diagram showing a configuration example of a lookup table according to the present invention.

【図12】本発明の請求項7に記載の減色装置の構成例
を示したブロック図
FIG. 12 is a block diagram showing a configuration example of a color reduction apparatus according to claim 7 of the present invention.

【図13】本発明の請求項7に記載の減色装置および請
求項10に記載の減色方法における処理の流れを示すフ
ローチャート
FIG. 13 is a flowchart showing a processing flow in a color reduction apparatus according to a seventh aspect of the present invention and a color reduction method according to the tenth aspect;

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

101 分類手段 102 分類ルール 103 色数計算手段 104 ルックアップテーブル計算手段 105 ルックアップテーブル 106 減色手段 107 フィルタ手段 108 入力手段 109 表示手段 110 エッジ抽出手段 111 重ね合わせ手段 DESCRIPTION OF SYMBOLS 101 Classification means 102 Classification rule 103 Number of colors calculation means 104 Lookup table calculation means 105 Lookup table 106 Color reduction means 107 Filter means 108 Input means 109 Display means 110 Edge extraction means 111 Superposition means

Claims (10)

【特許請求の範囲】[Claims] 【請求項1】画像を限定色で表現するための色変換情報
を格納するルックアップテーブルと、画像を入力し、色
変換情報を計算し前記計算結果を前記ルックアップテー
ブルに格納するルックアップテーブル計算手段と、ルッ
クアップテーブルを参照し、入力画像を構成する各々の
画素の色を前記限定色のいずれかに割り当てる減色手段
とを備えた減色装置において、分類ルールは色の値に応
じて入力画像の各画素を分類するルールであって、前記
分類ルールを用いて入力画像の各々の画素を複数個の属
性値のいずれかで分類する分類手段とを備えたことを特
徴とする減色装置。
1. A lookup table for storing color conversion information for expressing an image in a limited color, and a lookup table for inputting an image, calculating color conversion information, and storing the calculation result in the lookup table. A color reduction device comprising: a calculation unit; and a color reduction unit that refers to a look-up table and assigns the color of each pixel constituting the input image to any of the limited colors. A color reduction apparatus, comprising: a rule for classifying each pixel of an image, wherein the classification rule classifies each pixel of the input image with one of a plurality of attribute values using the classification rule.
【請求項2】分類手段にて入力画像を構成する各々の画
素を前記属性値で分類し、前記分類の結果に基づいて、
属性値が同じ画素で構成される画素群に割り当てる色数
を、それぞれの属性値について計算する色数計算手段を
備えたことを特徴とする請求項1記載の減色装置。
2. Classification means classifies each pixel constituting an input image by the attribute value, and, based on the result of the classification,
2. The color reduction apparatus according to claim 1, further comprising a color number calculation unit that calculates the number of colors assigned to a pixel group having the same attribute value for each attribute value.
【請求項3】前記分類ルールは、少なくとも、色を構成
する要素のうち彩度、明度の値を入力して、属性値のい
ずれか一つを出力する高明彩度画素検出ルールを含むこ
とを特徴とする請求項1または2記載の減色装置。
3. The classification rule includes a high-brightness / saturation pixel detection rule that inputs at least one of a saturation value and a lightness value among elements constituting a color and outputs one of attribute values. The color reduction apparatus according to claim 1 or 2, wherein
【請求項4】正方形フィルタを用いてフィルタ処理を施
すフィルタ手段を備えたことを特徴とする請求項1〜3
のいずれかに記載の減色装置。
4. The apparatus according to claim 1, further comprising a filter means for performing a filtering process using a square filter.
A color reduction apparatus according to any one of the above.
【請求項5】2次元の正方形フィルタ1は、前記フィル
タに画像を入力して、頻度のもっとも高い入力値を該フ
ィルタの出力信号とするフィルタであって、減色手段で
の処理結果に対して前記正方形フィルタ1を用いてフィ
ルタ手段にてフィルタ処理を施すことを特徴とする請求
項1〜4のいずれかに記載の減色装置。
5. A two-dimensional square filter 1 is a filter that inputs an image to the filter and uses the most frequently input value as an output signal of the filter. The color reduction apparatus according to any one of claims 1 to 4, wherein filter processing is performed by filter means using the square filter 1.
【請求項6】2次元の正方形フィルタ2は、入力画像に
対する前記正方形フィルタの出力信号を前記入力画像の
エッジ情報として得るように構成したエッジ抽出フィル
タであって、入力画像を少なくとも2以上の階調を持つ
白黒濃淡画像に変換し、前記変換結果に対して、前記正
方形フィルタ2を用いてフィルタ手段にてフィルタリン
グ処理を施し、該入力画像からエッジ成分を抽出する処
理を行なうエッジ抽出手段を備えたことを特徴とする請
求項1〜4のいずれかに記載の減色装置。
6. A two-dimensional square filter 2, which is an edge extraction filter configured to obtain an output signal of the square filter for an input image as edge information of the input image, wherein the two-dimensional square filter 2 converts the input image into at least two or more floors. Edge extracting means for converting the converted result into a black-and-white gray-scale image, applying a filtering process to the conversion result by the filter means using the square filter 2, and extracting edge components from the input image. The color reduction apparatus according to any one of claims 1 to 4, wherein:
【請求項7】2枚の画像を入力し、該2枚の画像の同じ
座標位置の点同士の色を比較した結果に応じて、重ね合
わせ後の色を計算し、該2枚の画像のうちのいずれかの
一枚の画像の該座標位置の画素に、前記計算した色を上
書きする重ね合わせ手段を備えることを特徴とする請求
項6記載の減色装置。
7. The two images are input, and a color after superimposition is calculated according to a result of comparing colors of points at the same coordinate position of the two images, and a color of the two images is calculated. 7. The color reduction apparatus according to claim 6, further comprising a superimposing unit that overwrites the pixel at the coordinate position of any one of the images with the calculated color.
【請求項8】ルックアップテーブルは、画像を限定色で
表現するための色変換情報を格納し、分類ルールは色の
値に応じて入力画像の各画素を分類するルールであっ
て、前記分類ルールを用いて入力画像の各々の画素を複
数個の属性値のいずれかで分類する第1のステップと、
前記第1のステップでの処理結果に基づいて、属性値が
同じ画素で構成される画素群に割り当てる色数を、それ
ぞれの属性値について計算する第2のステップと、画像
を入力し、色変換情報を計算し前記計算結果を前記ルッ
クアップテーブルに格納する第3のステップと、ルック
アップテーブルを参照し、入力画像を構成する各々の画
素の色を前記限定色のいずれかに割り当てる第4のステ
ップと、正方形フィルタを用いてフィルタ処理を施す第
5のステップとを包含する減色方法。
8. The look-up table stores color conversion information for expressing an image with a limited color, and the classification rule is a rule for classifying each pixel of an input image according to a color value. A first step of classifying each pixel of the input image with one of a plurality of attribute values using a rule;
A second step of calculating, for each attribute value, the number of colors to be assigned to a pixel group having the same attribute value based on the processing result in the first step; A third step of calculating information and storing the calculation result in the lookup table; and a fourth step of referring to the lookup table and assigning a color of each pixel constituting the input image to one of the limited colors. And a fifth step of performing a filtering process using a square filter.
【請求項9】前記第4のステップでの処理結果に対して
請求項5記載の正方形フィルタ1を用いて前記第5のス
テップにてフィルタリング処理を施すことを特徴とする
請求項8記載の減色方法。
9. The color reduction according to claim 8, wherein the processing result in the fourth step is subjected to filtering processing in the fifth step using the square filter 1 according to claim 5. Method.
【請求項10】請求項8に記載の減色方法において、さ
らに、入力画像を少なくとも2以上の階調を持つ白黒濃
淡画像に変換し、前記処理結果に対して請求項6に記載
の正方形フィルタ5を用いて第5のステップにおいてフ
ィルタリング処理を施し、該入力画像からエッジ成分を
抽出する第6のステップと、2枚の画像を入力し、該2
枚の画像の同じ座標位置の点同士の色を比較した結果に
応じて、重ね合わせ後の色を計算し、該2枚の画像のう
ちのいずれかの一枚の画像の該座標位置の画素に、前記
計算した色を上書きする第7のステップとを包含する減
色方法。
10. The color filter method according to claim 8, further comprising: converting the input image into a black-and-white shading image having at least two or more tones; In a fifth step, a filtering process is performed in a fifth step, and an edge component is extracted from the input image, and two images are input.
According to the result of comparing the colors of the points at the same coordinate position of the two images, the color after superimposition is calculated, and the pixel at the coordinate position of any one of the two images is calculated. And a seventh step of overwriting the calculated color.
JP8230020A 1996-08-30 1996-08-30 Color reduction device and color reduction method Withdrawn JPH1074248A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP8230020A JPH1074248A (en) 1996-08-30 1996-08-30 Color reduction device and color reduction method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP8230020A JPH1074248A (en) 1996-08-30 1996-08-30 Color reduction device and color reduction method

Publications (1)

Publication Number Publication Date
JPH1074248A true JPH1074248A (en) 1998-03-17

Family

ID=16901320

Family Applications (1)

Application Number Title Priority Date Filing Date
JP8230020A Withdrawn JPH1074248A (en) 1996-08-30 1996-08-30 Color reduction device and color reduction method

Country Status (1)

Country Link
JP (1) JPH1074248A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1282292A2 (en) * 2001-07-30 2003-02-05 Kabushiki Kaisha Toshiba Mobile Communication Terminal
JP2005034318A (en) * 2003-07-18 2005-02-10 Uizu:Kk Game using image information
JP2010246650A (en) * 2009-04-13 2010-11-04 Square Enix Co Ltd Game device, method of advancing game, and game program
US7884977B2 (en) 2006-08-02 2011-02-08 Konica Minolta Business Technologies, Inc. Method, device and computer program for processing input data concerning generation of electronic files

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1282292A2 (en) * 2001-07-30 2003-02-05 Kabushiki Kaisha Toshiba Mobile Communication Terminal
EP1282292A3 (en) * 2001-07-30 2004-10-20 Kabushiki Kaisha Toshiba Mobile Communication Terminal
JP2005034318A (en) * 2003-07-18 2005-02-10 Uizu:Kk Game using image information
US7884977B2 (en) 2006-08-02 2011-02-08 Konica Minolta Business Technologies, Inc. Method, device and computer program for processing input data concerning generation of electronic files
JP2010246650A (en) * 2009-04-13 2010-11-04 Square Enix Co Ltd Game device, method of advancing game, and game program

Similar Documents

Publication Publication Date Title
JP2582999B2 (en) Color palette generation method, apparatus, data processing system, and lookup table input generation method
KR100320298B1 (en) Image processing method and system
US5204665A (en) Color editing with simple encoded images
EP1025558B1 (en) A method and apparatus for performing chroma key, transparency and fog operations
EP0586082B1 (en) Palettized fuzzy mask
JPH08508353A (en) Polymorphic graphics device
US6208351B1 (en) Conversion of alpha-multiplied color data
US7554557B2 (en) Device and method for image compression and decompression
EP0357385B1 (en) Image processing method and apparatus
JPH06333039A (en) Method and device for airbrushing
KR20050051719A (en) Method of background colour removal for porter and duff compositing
JPH05346953A (en) Image data processor
JP2647033B2 (en) Lookup table creation method and lookup table creation device
US6259439B1 (en) Color lookup table blending
JPH05300375A (en) Sharpness processing unit
US6693644B1 (en) Graphic accelerator reducing and processing graphics data
JPH1074248A (en) Color reduction device and color reduction method
JPH10134173A (en) Generation and process of image data
JP2000253269A (en) Method and device for color image processing
US6509901B1 (en) Image generating apparatus and a method thereof
JPH1188712A (en) Image processing method and image processor
JP2878477B2 (en) Image processing device
JP3215156B2 (en) Color image processing method
JP2795083B2 (en) Creating the same material appearance image in image processing
JP2898569B2 (en) Video accelerator board for computer game development

Legal Events

Date Code Title Description
RD01 Notification of change of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7421

Effective date: 20050623

A761 Written withdrawal of application

Free format text: JAPANESE INTERMEDIATE CODE: A761

Effective date: 20060515