JPH05188899A - Method for selecting limited color for color image - Google Patents
Method for selecting limited color for color imageInfo
- Publication number
- JPH05188899A JPH05188899A JP3356484A JP35648491A JPH05188899A JP H05188899 A JPH05188899 A JP H05188899A JP 3356484 A JP3356484 A JP 3356484A JP 35648491 A JP35648491 A JP 35648491A JP H05188899 A JPH05188899 A JP H05188899A
- Authority
- JP
- Japan
- Prior art keywords
- color
- pixels
- blocks
- block
- limited
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 24
- 238000010187 selection method Methods 0.000 claims abstract description 14
- 239000003086 colorant Substances 0.000 claims description 40
- 230000007423 decrease Effects 0.000 description 17
- 230000006870 function Effects 0.000 description 11
- 238000002474 experimental method Methods 0.000 description 9
- 238000010586 diagram Methods 0.000 description 3
- 238000006243 chemical reaction Methods 0.000 description 2
- 235000013399 edible fruits Nutrition 0.000 description 2
- 230000009982 effect on human Effects 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 230000036651 mood Effects 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 230000001174 ascending effect Effects 0.000 description 1
- 230000000052 comparative effect Effects 0.000 description 1
- 238000007796 conventional method Methods 0.000 description 1
- 230000010485 coping Effects 0.000 description 1
- 238000012937 correction Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 230000003247 decreasing effect Effects 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 230000007704 transition Effects 0.000 description 1
Landscapes
- Controls And Circuits For Display Device (AREA)
- Image Processing (AREA)
- Image Generation (AREA)
Abstract
(57)【要約】
【目的】 ルックアップテーブル(LUT)を使用した
限定色選択方法においてLUTに対応した色を選択する
方法を入力された画素の集団の配置関係とブロックサイ
ズとの一定関係から選択色を動的に選び出す方法を提供
する。
【構成】 RGB空間に配置した画素を適宜ブロックサ
イズで分割し、分割されたブロックの内LUTに使用す
る選択されたブロックに含まれている画素とブロック数
との一定関係から分割すべきブロックの単位を入力され
た画素の集団に対応して変化させて限定色を選択する。
(57) [Abstract] [Purpose] A method of selecting a color corresponding to an LUT in a limited color selection method using a lookup table (LUT) is based on a fixed relationship between the arrangement relationship of the input pixel group and the block size. Provide a method to dynamically select a selection color. A pixel arranged in an RGB space is appropriately divided into block sizes, and a block to be divided is divided based on a fixed relationship between the number of pixels included in a selected block used in the LUT of the divided blocks and the number of blocks. The unit is changed corresponding to the input pixel group to select the limited color.
Description
【0001】[0001]
【産業上の利用分野】本発明は、入力されたカラー画像
をコンピューター処理して出力する際のルック・アップ
・テーブル方式による限定色選択方法に関するものであ
る。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a limited color selection method by a look-up table method when a color image inputted is processed by a computer and outputted.
【0002】[0002]
【従来の技術】近年における技術の急速な進歩によっ
て、メモリ容量の集積密度の高度化、低価格化によっ
て、図9に示しているように、カラー表示する1画素あ
たりのデータ領域80に24ビットを使用した表示装置
が存在しており、このような表示装置においては、24
ビットをRGB各成分に対して8ビットずつ使用して、
再現の際、RGB別にデータがD/A変換(80R,8
0G,80B)されデイスプレイの表示エリア83に送
られていた。この場合に、例えば、640画素/ライン
で、400ラインの表示エリア83に使用するメモリ領
域は、 8ビット×3(RGB)×640(画素数/ライン)×
400(ライン)=6、144、000ビット(約6Mビ
ット)必要である。2. Description of the Related Art In recent years, due to the rapid progress of technology, the integration density of memory capacity has been improved and the price has been reduced, as shown in FIG. There is a display device using a.
Use 8 bits for each RGB component,
At the time of reproduction, data for each RGB is D / A converted (80R, 8
0G, 80B) and sent to the display area 83 of the display. In this case, for example, the memory area used for the display area 83 of 400 lines at 640 pixels / line is 8 bits × 3 (RGB) × 640 (the number of pixels / line) ×
400 (lines) = 6, 144,000 bits (about 6 Mbits) are required.
【0003】これに対して、1画素に対して割り当てら
れるデータ領域を8ビット程度にとどめてカラー画像の
中から任意に256色程度の限定された色種を選択し
て、入力されたカラー画像を再現する方法も広く使用さ
れている(以下、限定色選択方法と呼ぶ)。この限定色
選択方法であれば、上記表示エリア83に使用するメモ
リ領域は、 8ビット×640(画素数/ライン)×400(ライ
ン)=2、048、000(約2Mビット)で足りる。On the other hand, the data area assigned to one pixel is limited to about 8 bits, and a limited color type of about 256 colors is arbitrarily selected from the color image to input the color image. Is also widely used (hereinafter referred to as a limited color selection method). With this limited color selection method, the memory area used for the display area 83 is 8 bits × 640 (number of pixels / line) × 400 (lines) = 2,048,000 (about 2 Mbits).
【0004】ここで、限定色選択方法について図6、図
7、図8を参照にして説明する。図6は、入力されたカ
ラー画像に存在する1画素に割り当てられる8ビットか
らなるデータ領域40に基づいて、別に作成されたルッ
ク・アップ・テーブル(以下、LUTと云う)42のパ
レット番号44を参照してRGB各データの色番号46
を抽出し、D/A変換48してデイスプレイの表示エリ
ア83に再現する概略を表わしたものである。尚、この
LUT42が占有するメモリ領域は、 8ビット×3(RGB)×256=6、144ビット必
要となる。The limited color selection method will be described with reference to FIGS. 6, 7 and 8. FIG. 6 shows a palette number 44 of a look-up table (hereinafter, referred to as LUT) 42 separately created based on a data area 40 consisting of 8 bits assigned to one pixel existing in the input color image. Refer to the color number of each RGB data 46
Is extracted, D / A converted 48, and reproduced in the display area 83 of the display. The memory area occupied by the LUT 42 requires 8 bits × 3 (RGB) × 256 = 6, 144 bits.
【0005】また、表示エリア83は、例えば、1ライ
ンあたり640画素(H)で400ライン(V)からな
る入力されたカラー画像の画素52の総画素数をあらわ
したものであり、図7は、図6で示した表示エリア83
の総画素数を、RGBデータのそれぞれを16進で表し
たものであり、各々を00〜FF(Hex)までの値に
して3次元からなるRGB空間60に配置したものであ
り、図8は、図7で示したRGB空間60に配置した画
素52に対して、RGBの各データを均等な値(00〜
FFまでの合計256個)のブロックサイズで分割する
状態を表したものである。Further, the display area 83 represents, for example, the total number of pixels 52 of the input color image of 640 pixels (H) per line and 400 lines (V), and FIG. , The display area 83 shown in FIG.
8 represents the total number of pixels of each of the RGB data in hexadecimal, and arranges each in a three-dimensional RGB space 60 with each of the values ranging from 00 to FF (Hex). , For each pixel 52 arranged in the RGB space 60 shown in FIG.
This shows a state in which the block is divided into a total of 256 block sizes up to the FF.
【0006】従来の限定色選択方法は、前述した図7、
図8に示すように、入力したカラー画像の総画素をRG
B空間60に配置し、該RGB空間60中で近い距離に
ある画素どうしは色が似ていることからRGB空間60
をRGBの各データを均等に一定サイズのブロックで分
割し、各分割されたブロックの中心点の色を代表色とし
て定め、該ブロック中に存在する画素の値を、前記代表
色の値に置き換えても入力されたカラー画像に比べてあ
まり雰囲気の違わない画像の再現ができる。The conventional limited color selection method is shown in FIG.
As shown in FIG. 8, the total pixels of the input color image are set to RG.
Since the pixels arranged in the B space 60 and having a short distance in the RGB space 60 have similar colors, the RGB space 60
Each RGB data is equally divided into blocks of a certain size, the color of the center point of each divided block is determined as a representative color, and the pixel values existing in the block are replaced with the representative color values. However, it is possible to reproduce an image that does not differ much in mood compared to the input color image.
【0007】そのため、RGB空間の同一ブロック中に
存在する画素に、代表色と同値の色番号を付与すると共
に、この代表色を例えば256種類選択して限定色を抽
出することができるが、この限定色の種類は256種類
に限定されない。Therefore, it is possible to assign a color number having the same value as the representative color to pixels existing in the same block in the RGB space, and select 256 types of the representative color to extract the limited color. The types of limited colors are not limited to 256 types.
【0008】そして、抽出された限定色に0〜255の
パレット番号46を付与し、該パレット番号46とRG
B各データとを対応させてLUT42を作成し、入力さ
れたカラー画像を表示エリア83に表示する際には、置
き換えられたパレット番号46からRGB各データの色
番号44を選択しD/A変換48して表示する(図6参
照)。Then, a palette number 46 of 0 to 255 is given to the extracted limited color, and the palette number 46 and RG are assigned.
When the LUT 42 is created in association with each B data and the input color image is displayed in the display area 83, the color number 44 of each RGB data is selected from the replaced palette number 46 and the D / A conversion is performed. 48 and display (see FIG. 6).
【0009】図7は、カラー画像の各画素52が持つR
GBデータに基づいてRGB空間60に配置した各画素
52の分布の一例を表わしたものである。従って、RG
Bの各原色を座標軸とする3次元空間からなるRGB空
間60を設定することにより、カラー画像中の各画素5
2は、このRGB空間60中の一座標で表わされる。FIG. 7 shows the R of each pixel 52 of the color image.
It shows an example of the distribution of each pixel 52 arranged in the RGB space 60 based on GB data. Therefore, RG
By setting the RGB space 60, which is a three-dimensional space having each primary color of B as the coordinate axis, each pixel 5 in the color image
2 is represented by one coordinate in the RGB space 60.
【0010】そして、このRGB空間60に配置された
各画素52の色座標RGB(00,00,00)は、”黒色”であ
り、この色座標RGB(00,00,00)から一番遠い色座標RGB(F
F,FF,FF)は、”白色”と定義することができ、例えば色
座標RGB(00,00,00)から一番遠い色座標RGB(FF,FF,FF)に
引かれた線上の中点の色は”灰色”になる。The color coordinate RGB (00,00,00) of each pixel 52 arranged in the RGB space 60 is "black" and is the farthest from this color coordinate RGB (00,00,00). Color coordinates RGB (F
F, FF, FF) can be defined as "white". For example, the center on the line drawn from the color coordinate RGB (FF, FF, FF) farthest from the color coordinate RGB (00,00,00). The dot color becomes "gray".
【0011】図8は、図7で示したRGB空間60を均
等なサイズで分割したブロックに適当なブロック名B
(X,X、X)を付したものである。FIG. 8 shows a block name B suitable for a block obtained by dividing the RGB space 60 shown in FIG. 7 into equal sizes.
(X, X, X) is attached.
【0012】図8のRGB空間の分割において、RGB
各ブロックサイズは、Rの階調をGr=(1/△r)、
Gの階調をGg=(1/△g)、Bの階調をGb=(1
/△b)で表わし、ブロック総数は、Bn=Gr×Gg
×Gbで表わす。例えばブロック名B(0、0、0)を
黒色の画素を含んだブロックを意味し、このブロック内
に配置された画素の数が画素の分布密度を表わしてい
る。この、各ブロック内からそれぞれ中心となる色の画
素を1つずつ(代表色)任意に選択する。そして、各ブ
ロック毎の代表色の中から、代表色の集団からなる限定
数の限定色を抽出し、各ブロック内に存在する各画素を
この限定色に置き換えても、限定色の数を多めに定めて
やれば、入力したカラー画像に比べて、あまり雰囲気の
違わない画像が再現できる。In the division of the RGB space of FIG.
For each block size, the gradation of R is Gr = (1 / Δr),
The G gradation is Gg = (1 / Δg), and the B gradation is Gb = (1
/ Δb), and the total number of blocks is Bn = Gr × Gg
Represented by × Gb. For example, the block name B (0, 0, 0) means a block including black pixels, and the number of pixels arranged in this block represents the distribution density of pixels. One pixel (representative color) having a central color is arbitrarily selected from each block. Even if a limited number of limited colors consisting of a group of representative colors is extracted from the representative colors of each block and each pixel existing in each block is replaced with this limited color, the number of limited colors is increased. By setting the above, it is possible to reproduce an image that does not differ much in mood compared to the input color image.
【0013】しかし、図6で示したLUT42に使用さ
れる選択された色の種類は、例えば256種類に限定さ
れており、RGB空間を細かく多数のブロックに均等に
分割しても、その分割された全てのブロックに含まれる
画素が限定色として選択できない事情がある。However, the types of selected colors used in the LUT 42 shown in FIG. 6 are limited to, for example, 256 types. Even if the RGB space is finely divided into a large number of blocks, the division is performed. There is a circumstance in which pixels included in all blocks cannot be selected as limited colors.
【0014】従って、入力されたカラー画像50の画素
52に対応したRGB空間60の分割は、ブロックサイ
ズをいくら均等に細かく分割しても、LUT42で採用
する色種類に限定がある以上、一定の選択基準に基づい
て限定色を機械的に選択しなければならない。このよう
に機械的選択によって決定した限定色を用いると入力さ
れたカラー画像と比べてバランスのよい画像を再現する
ことが出来ない。Therefore, the division of the RGB space 60 corresponding to the pixels 52 of the input color image 50 is constant as long as the LUT 42 has a limited color type, no matter how finely the block size is divided. Limited colors must be mechanically selected based on selection criteria. As described above, when the limited color determined by the mechanical selection is used, a well-balanced image cannot be reproduced as compared with the input color image.
【0015】尚、抽出された限定色に含まれなかった画
素は、最も近い距離にある抽出された限定色を有するブ
ロックと同値の色番号46を付与して、RGB空間60
に存在する全ての画素52に対して限定色の色番号46
を付与することができる。そして、再現の際には、置き
換えられた色番号46に基づいて付与されたパレット番
号44からRGB各データの色番号46を選出し、該色
番号46をD/A変換48して表示エリア83に表示す
る(図6参照)。Pixels which are not included in the extracted limited color are given the same color number 46 as the block having the extracted limited color at the closest distance, and the RGB space 60
Limited color number 46 for all pixels 52 present in
Can be given. When reproducing, the color number 46 of each RGB data is selected from the palette number 44 given based on the replaced color number 46, the color number 46 is D / A converted 48, and the display area 83 is displayed. Is displayed (see FIG. 6).
【0016】このように限定色選択方法によって作成さ
れて、再現された画像は、入力されたカラー画像50か
らみれば劣るものの、データが圧縮され、且つデータ蓄
積にはきわめて都合がよい。従って、入力されたカラー
画像50を限定色で再現する簡易な表示方法であっても
比較的自然なカラー画像を表示できるため、現在におい
ても広く採用されている。The image reproduced and produced by the limited color selection method in this way is inferior to the input color image 50, but the data is compressed and very convenient for data storage. Therefore, a relatively natural color image can be displayed even with a simple display method for reproducing the input color image 50 with limited colors, and therefore it is widely used at present.
【0017】ここで問題となるのは、如何にして入力さ
れたカラー画像50に対して、RGB空間60をLUT
42の限定された色種類(例えば256種類)に対応し
た適切なブロックに分割するかが、表示される画像の品
質に大きく影響することである。The problem here is that the RGB space 60 is set to the LUT for the input color image 50.
Dividing into appropriate blocks corresponding to 42 limited color types (for example, 256 types) has a great influence on the quality of the displayed image.
【0018】[0018]
【発明が解決しようとする課題】しかしながら、上述し
たLUT42を使用した限定色選択方法においても欠点
があり、未だ満足な結果を得るに到っていない。即ち、
RGB空間60に存在する画素をRGBそれぞれを均等
なブロックサイズで分割して再現すると、RGB空間に
存在する画素の密度分布が一定しないのに均等に分割し
たブロックサイズに基づいて限定色を抽出しているた
め、再現された画像によっては入力されたカラー画像に
対して粗かったり、自然界の画素の分布密度と一致しな
いため、表示色にむらが生じてしまう。このような、課
題に対処した方法として、再現された画像を目視して適
宜RGBそれぞれのブロックサイズを変化させる会話形
式による方法もあるが処理時間が遅く実用性がない。従
って、従来例においては、LUT42で採用される色種
類に制限がある中で、入力されたカラー画像に比べ、バ
ランスのとれた画像の再現ができる限定色選択に解決し
なければならない課題を有している。However, the limited color selection method using the LUT 42 described above also has drawbacks, and satisfactory results have not yet been obtained. That is,
When the pixels existing in the RGB space 60 are reproduced by dividing each RGB into equal block sizes, the limited color is extracted based on the block size evenly divided even though the density distribution of the pixels existing in the RGB space is not constant. Therefore, depending on the reproduced image, it is rough with respect to the input color image, or does not match the distribution density of pixels in the natural world, resulting in uneven display color. As a method for coping with such a problem, there is a method in which the reproduced image is visually observed and the block size of each RGB is changed appropriately, but the processing time is slow and it is not practical. Therefore, in the conventional example, there is a problem that the limited color selection that can reproduce a more balanced image compared to the input color image must be solved, while the color types adopted in the LUT 42 are limited. is doing.
【0019】本発明は、これらの課題に鑑みてなされた
ものであり、入力したカラー画像50に比べて、きわめ
てバランスのとれた画像を再現するために、RGB空間
60に存在するカラー画像の画素の分布密度と、限定色
に選択された全ブロックに内含する画素の総数との関係
から分割するブロックサイズを適宜変化させて限定色を
選択する方法を提供することを目的とする。The present invention has been made in view of these problems, and in order to reproduce an image that is extremely balanced as compared with the input color image 50, the pixels of the color image existing in the RGB space 60. It is an object of the present invention to provide a method for selecting a limited color by appropriately changing the block size to be divided from the relationship between the distribution density of the above and the total number of pixels included in all blocks selected as the limited color.
【0020】[0020]
【課題を解決するための手段】上記目的を達成するため
に本発明は、画素の集団からなるカラー画像を、RGB
各色を各々直交する座標軸とする3次元空間からなるR
GB空間にRGBデータに基づいて前記画素を配置し、
前記RGB空間をRGB方向にそれぞれ等間隔に割り当
てた複数のブロックに分割し、該各ブロック内に存在す
る画素の代表色から複数の限定色を選択する方法におい
て、前記各ブロック内に存在する画素の分布密度に基づ
き、ブロック数をY軸にとり画素の度数範囲をX軸にと
った時に、画素の度数範囲とブロック数との関係から勾
配変化点を求め、選択した前記限定色を有する全てのブ
ロックに内含する画素の総数によってY軸と略平行する
境界線を求め、該境界線が前記勾配変化点を含む勾配変
化点の近傍位置になるように前記RGB空間を適宜サイ
ズのブロックに分割して限定色を選択することを特徴と
するカラー画像の限定色選択方法である。In order to achieve the above object, the present invention provides a color image composed of a group of pixels with RGB
R consisting of a three-dimensional space in which each color has orthogonal coordinate axes
Arranging the pixels in the GB space based on RGB data,
In the method of dividing the RGB space into a plurality of blocks allocated at equal intervals in the RGB directions and selecting a plurality of limited colors from the representative colors of the pixels present in each block, the pixels present in each block When the number of blocks is on the Y-axis and the frequency range of pixels is on the X-axis based on the distribution density of, the gradient change point is determined from the relationship between the frequency range of pixels and the number of blocks, and all the limited colors having the selected limited color are obtained. A boundary line that is substantially parallel to the Y-axis is obtained based on the total number of pixels included in the block, and the RGB space is divided into blocks of appropriate sizes so that the boundary line is near the gradient change point including the gradient change point. A limited color selection method for a color image is characterized in that the limited color is selected.
【0021】[0021]
【作用】上記勾配変化点と、限定色を有する全てのブロ
ックに内含する画素の総数との関係から、入力されたカ
ラー画像に対応したブロックサイズの分割を自動的に適
切に行なうことができ、それによって再現される画像は
入力されたカラー画像に比べて、最もバランスよい画像
が再現できる。From the relationship between the gradient change point and the total number of pixels included in all blocks having limited colors, it is possible to automatically and appropriately divide the block size corresponding to the input color image. As for the image reproduced thereby, the most balanced image can be reproduced as compared with the input color image.
【0022】[0022]
【実施例】本発明における実施例を図と表を参照して以
下詳細に説明する。本発明における限定色選択方法は、
カラー画像50の全ての画素52をRGB空間60に配
置することは従来例と同様である(図7、図8参照)。Embodiments of the present invention will be described in detail below with reference to the drawings and tables. The limited color selection method in the present invention is
Arranging all the pixels 52 of the color image 50 in the RGB space 60 is the same as in the conventional example (see FIGS. 7 and 8).
【0023】そして、RGB空間60中で近い距離にあ
る画素52どうしは色が似ていることからRGB空間6
0に配置したカラー画像50の画素52の分布密度に応
じたサイズのブロックに分割し、例えば、各ブロックの
中心点の色を代表色として定め、且つブロックに包含す
る画素52の値を当該ブロック内若しくはその画素の最
も近いブロックの代表色の値に置き換えれば入力された
カラー画像50に比べてあまり雰囲気の違わない画像の
再現ができる。Since the pixels 52 that are close to each other in the RGB space 60 have similar colors, the RGB space 6
It is divided into blocks of a size corresponding to the distribution density of the pixels 52 of the color image 50 arranged at 0. For example, the color of the center point of each block is set as the representative color, and the value of the pixels 52 included in the block is set to the block. By replacing the value with the representative color value of the block inside or closest to the pixel, an image having a different atmosphere can be reproduced compared to the input color image 50.
【0024】RGB空間60に存在する入力されたカラ
ー画像50の画素52の分布密度に応じた適切なブロッ
クサイズに分割するには、以下の方法による。 (1)任意のブロックサイズでRGB空間60を分割し
て、分割されたブロックに内含する画素の分布密度を求
める。The following method is used for dividing into an appropriate block size according to the distribution density of the pixels 52 of the input color image 50 existing in the RGB space 60. (1) The RGB space 60 is divided with an arbitrary block size, and the distribution density of pixels included in the divided block is obtained.
【0025】(2)次に、求めた画素の分布密度とブロッ
ク数の関係から、画素の度数範囲に含まれるブロックの
数を求める(後述する表2参照)。(2) Next, the number of blocks included in the pixel frequency range is obtained from the obtained relationship between the distribution density of pixels and the number of blocks (see Table 2 described later).
【0026】(3)画素の度数範囲と、該画素の度数範囲
に含まれるブロック数との関係(表2)から、画素の度
数範囲が増加すると、画素の度数範囲とブロック数の関
係はほぼ一定の状態である時点まで推移するが、更に画
素の度数範囲が増加するとブロック数は序々に減少して
ゆく。この時の一定に推移する状態から序々に減少する
時の区切り点(以下、勾配変化点Pと云う)を求める
(後述する図1参照)。(3) From the relationship between the pixel frequency range and the number of blocks included in the pixel frequency range (Table 2), when the pixel frequency range increases, the relationship between the pixel frequency range and the block number is almost the same. The number of blocks gradually decreases as the frequency range of pixels further increases, although the state changes to a certain state. At this time, a break point (hereinafter referred to as a gradient change point P) at the time of gradually decreasing from the constant transition state is obtained (see FIG. 1 described later).
【0027】(4)上記(1)で求めた各ブロックの画素の分
布密度の多い順から代表色の色(本実施例では256種
類の色)を限定色として選び出す。(4) A representative color (256 kinds of colors in this embodiment) is selected as a limited color in the descending order of pixel distribution density of each block obtained in (1) above.
【0028】(5)そして、選択した限定色を有する全て
のブロックに内含する画素の総数と選択されなかったブ
ロックに内含する画素の総数との境界線を求める。(5) Then, a boundary line between the total number of pixels included in all the blocks having the selected limited color and the total number of pixels included in the unselected block is determined.
【0029】(6)上記(3)で求めた勾配変化点Pと、上記
(5)で求めた境界線とが同一位置かその近傍位置になる
まで、上記(1)〜(5)を繰り返してブロックサイズを動的
に変化させて分割を行なう。この動的な変化は、勾配変
化点Pよりも右側に境界線があるときは、ブロックサイ
ズを大きくし、勾配変化点Pよりも左側に境界線がある
ときは、ブロックサイズを小さくする。(6) The gradient change point P obtained in (3) above and
The above-mentioned (1) to (5) are repeated until the boundary line obtained in (5) is at the same position or in the vicinity thereof, and the block size is dynamically changed to perform division. This dynamic change increases the block size when the boundary line is on the right side of the gradient change point P, and decreases the block size when the boundary line is on the left side of the gradient change point P.
【0030】(7)上記(1)〜(6)の方法で求めた限定色に
0〜255のパレット番号44を付与し、該パレット番
号44とRGB各データとを対応させてLUT42を作
成する(図6参照)。(7) A palette number 44 of 0 to 255 is given to the limited colors obtained by the methods (1) to (6), and the LUT 42 is created by associating the palette number 44 with each RGB data. (See Figure 6).
【0031】(8)限定色を有する全てのブロックに包含
する画素52に対して、ブロックと同値のパレット番号
を付与する(図6参照)。(8) A palette number having the same value as the block is given to the pixels 52 included in all the blocks having the limited color (see FIG. 6).
【0032】(9)上記(8)で選択された限定色を有するブ
ロックに内含されなかった画素は、最も近い距離にある
選択された限定色を有するブロックの代表色と同値のパ
レット番号44を付与する。従って、RGB空間60に
存在する全ての画素52に対してパレット番号44を付
与することができる。(9) Pixels that are not included in the block having the limited color selected in (8) above have the same palette number 44 as the representative color of the block having the selected limited color located at the closest distance. Is given. Therefore, the palette number 44 can be given to all the pixels 52 existing in the RGB space 60.
【0033】(10)再現する際には、従来例と同様に置き
換えられたパレット番号44に基づいて色番号46から
RGBデータを呼び出し、該RGBデータをD/A変換
48して表示エリア83に表示する(図6参照)。(10) When reproducing, RGB data is called from the color number 46 based on the palette number 44 replaced as in the conventional example, and the RGB data is D / A converted 48 and displayed in the display area 83. Display (see FIG. 6).
【0034】表1は、上記方法によって得られたRGB
空間60に存在するカラー画像50の限定色を得るため
に適当なブロックサイズで分割したブロックと、該ブロ
ックに存在している画素の分布密度との関係の一部を表
わしたものである。Table 1 shows the RGB values obtained by the above method.
It shows a part of the relationship between a block divided into an appropriate block size for obtaining the limited color of the color image 50 existing in the space 60 and the distribution density of pixels existing in the block.
【0035】[0035]
【表1】[Table 1]
【0036】例えば、ブロック名B(0、0、0)は”
黒色”の画素を含むブロック名であり、同様にブロック
名B(0、0、Gb−1)は”青色”を、ブロック名B
(0、Gg−1、Gb−1)は”シアン”を、ブロック
名B(Gr−1、Gg−1、Gb−1)は、”白色”を
それぞれ含んだブロック名である。以下、残りの他のブ
ロック(図8で表されるブロック総数Bn個全てについ
て)についても同様であるので説明は省略する。For example, the block name B (0,0,0) is "
The block name includes pixels of "black", and similarly, the block name B (0, 0, Gb-1) is "blue" and the block name B
(0, Gg-1, Gb-1) is a block name including "cyan", and the block name B (Gr-1, Gg-1, Gb-1) is a block name including "white". Hereinafter, since the same applies to the remaining other blocks (for all Bn total blocks shown in FIG. 8), description thereof will be omitted.
【0037】ここで、画素の分布密度の総数は、一画面
上の画素の総数であり、例えば図6に示した表示エリア
83で表わされる画素の総数は640(画素/ライン)
×400ライン=256、000個となる。Here, the total number of pixel distribution densities is the total number of pixels on one screen. For example, the total number of pixels represented by the display area 83 shown in FIG. 6 is 640 (pixels / line).
× 400 lines = 256,000.
【0038】表2は、前述した限定色選択方法により、
任意の一定サイズでRGB空間60を分割して、分割さ
れたブロックに存在する画素の分布密度を求め、該求め
た画素の分布密度とブロック数の関係から、画素の度数
範囲と、該画素の度数範囲に含まれるブロック数との関
係を、画素の度数範囲の少ない順に指数的に表わしたも
のである。Table 2 shows the results of the limited color selection method described above.
The RGB space 60 is divided into arbitrary fixed sizes, the distribution density of pixels existing in the divided blocks is calculated, and the frequency range of the pixels and the pixel density range are calculated from the relationship between the calculated distribution density of the pixels and the number of blocks. The relationship with the number of blocks included in the frequency range is exponentially represented in ascending order of the pixel frequency range.
【0039】[0039]
【表2】[Table 2]
【0040】即ち、この表2の意味するところは、画素
の度数範囲が一定値以下(表2の場合16〜31の度数
範囲以下)の場合には、各度数範囲に属するブロック数
が略一定であり、一定値以上の画素の度数範囲になると
ブロック数は、次第に減少しており、このことは後に説
明する実験例からも明らかにわかる。即ち、このブロッ
ク数が減少し始める点であるところの勾配変化点は、画
素の度数範囲の対数を横軸にとり、ブロック数の対数を
縦軸にとり、その両者の対数関数関係から更に容易に求
めることができる。That is, the meaning of Table 2 is that, when the pixel frequency range is below a certain value (below 16 to 31 in Table 2), the number of blocks belonging to each frequency range is substantially constant. The number of blocks gradually decreases in the frequency range of pixels having a certain value or more, which can be clearly seen from an experimental example described later. That is, the gradient change point where the number of blocks starts to decrease is determined more easily from the logarithmic function relation between the logarithmic function relation of the two, with the horizontal axis representing the logarithm of the pixel frequency range and the vertical axis representing the logarithm of the block number. be able to.
【0041】図1は、表2で求めたデータに基づいて得
られた画素の度数範囲とブロック数とを対数関係で表わ
したものであり、本発明の限定色選択方法を示すもので
ある。FIG. 1 shows the frequency range of pixels and the number of blocks obtained on the basis of the data obtained in Table 2 in a logarithmic relationship, and shows the limited color selection method of the present invention.
【0042】関数f(x)は、縦軸にブロック数(log
Y)、横軸に画素の度数範囲(logX)をとって、対数関
係で表わしたものである。即ち、f(x)は、横軸に対
して、一定の度数範囲(logX=(0〜logA))まではほ
ぼ同じブロック数の値(logX=logC)で推移するが、横
軸の画素の度数範囲が一定値以上(logX=(logA〜log
B))になると、一定の勾配(logC/(logA−logB))で
次第に減少してゆく。このようにして、画素の度数範囲
とブロック数の関係は、画素の度数範囲が一定値(logX
=logA)の点で減少し始めるところの勾配変化点Pをた
やすく求めることができる。The function f (x) is represented by the number of blocks (log
Y), the frequency range (logX) of pixels is plotted on the horizontal axis, and is expressed in a logarithmic relationship. That is, f (x) changes with the value of the same number of blocks (logX = logC) up to a certain frequency range (logX = (0 to logA)) with respect to the horizontal axis. The frequency range is a certain value or more (logX = (logA ~ log
B)), it gradually decreases with a constant gradient (logC / (logA-logB)). In this way, the relationship between the pixel frequency range and the block number is that the pixel frequency range has a constant value (logX
= LogA), the slope change point P at which it starts to decrease can be easily obtained.
【0043】そして、このグラフ上で横軸、logX=
logT、関数f(x)で囲まれた部分5(斜線の部
分)は、RGB空間60に存在するカラー画像50の画
素52の内、選択された限定色を有する全てのブロック
に内含する画素52の総数を表わしたものである。即
ち、ブロックサイズ(△r、△g、△b)を変化させるこ
とによて、関数f(x)のグラフ及び境界線(logX=lo
gT)は変化することとなる。そして、境界線は、選択さ
れたブロックと選択されなかったブロックとの略境界位
置にあり、Y軸と略平行する状態にある。Then, on this graph, the horizontal axis, logX =
A portion 5 (hatched portion) surrounded by logT and the function f (x) is a pixel included in all blocks having the selected limited color among the pixels 52 of the color image 50 existing in the RGB space 60. It represents the total number of 52. That is, by changing the block size (Δr, Δg, Δb), the graph of the function f (x) and the boundary line (logX = lo
gT) will change. The boundary line is located at a substantially boundary position between the selected block and the unselected block, and is in a state of being substantially parallel to the Y axis.
【0044】このf(x)のグラフは、境界線になる位
置(logX=logT)と勾配変化点P(logX=logA)がほぼ
同一位置になるように、RGB空間60を分割した理想
の関係を表わし、且つこのようにブロックサイズで分割
して再現した画像は、自然界に存在する画素を最も効率
よく限定色と置き換えることとなり、入力されたカラー
画像50に比べて最もバランスがよく美しく再現できる
ことが種々の実験より判明した。尚、限界線は、あらゆ
る画像を想定した時でも、この線を越えないことを示し
たものである。This graph of f (x) is an ideal relationship obtained by dividing the RGB space 60 so that the position of the boundary line (logX = logT) and the gradient change point P (logX = logA) are almost the same position. And that the image reproduced by dividing by the block size in this way replaces the pixels existing in the natural world with the limited color most efficiently, and can be reproduced with the best balance and beautifully as compared with the input color image 50. Was found from various experiments. It should be noted that the limit line indicates that the line is not crossed even when all images are assumed.
【0045】図2は、図8で示したようにRGB空間6
0を均等に分割した場合において、ブロックサイズ(△
r×△g×△b)が小さい場合と、大きい場合との関数
f1(x)、f2(x)と、限定色を有する全てのブロッ
クに内含する画素52の総数の関係を図1と同様にグラ
フで表わしたものであり、実質的に本発明との比較例を
示すものである。FIG. 2 shows the RGB space 6 as shown in FIG.
When 0 is divided evenly, the block size (△
FIG. 1 shows the relationship between the functions f1 (x) and f2 (x) when r × Δg × Δb) is small and when it is large, and the total number of pixels 52 included in all blocks having limited colors. Similarly, it is represented by a graph and substantially shows a comparative example with the present invention.
【0046】ブロックサイズが小さい場合の関数f1
(x)のグラフは、画素の度数範囲に対してブロック数
が多くなり、勾配変化点P1が比較的画素の度数範囲の
小さい値(logX=logA1)のところで到来し、以後ブロ
ック数が減少し始める(logA1<logX≦logB1)。Function f1 when the block size is small
In the graph of (x), the number of blocks increases in the pixel frequency range, the slope change point P1 arrives at a value (logX = logA1) in which the pixel frequency range is relatively small, and the number of blocks decreases thereafter. Start (logA1 <logX ≦ logB1).
【0047】この場合に、メモリー容量の関係で選択さ
れるブロック数(LUT42のパレット総数256個)
には限界があり、ブロックサイズが小さい場合には選択
されるブロック数が総ブロック数(Bn)に対して少な
くなるので境界線(logX=logT1)は、勾配変化点P1よ
りも右側になる(右斜線で示した面積の部分10参
照)。In this case, the number of blocks selected due to the memory capacity (256 palettes in LUT 42)
Is limited, and when the block size is small, the number of selected blocks is smaller than the total number of blocks (Bn), so the boundary line (logX = logT1) is on the right side of the gradient change point P1 ( (See part 10 of the area indicated by the right diagonal line)
【0048】このような、ブロックサイズが小さい場合
の関数f1(x)で表わされるブロックサイズで分割さ
れたカラー画像を再現すると、濃淡の緩やかな部分は美
しく表現されるが、そこに多くの色を使いすぎるため、
カラー画像に対して、大きく色が違うところが目立つよ
うになる。When a color image divided by the block size represented by the function f1 (x) in the case where the block size is small is reproduced, a part with light and shade is expressed beautifully, but many colors are present there. Is used too much,
The areas where the colors are greatly different from the color image become noticeable.
【0049】また、ブロックサイズが大きい場合の関数
f2(x)のグラフは、ブロックサイズの小さい場合の
関数f1(x)のグラフに比べて、画素の度数範囲に対
応したブロック数は少なく、そのぶん勾配変化点P2が
画素の度数範囲の大きな値(logX=logA2)のところで
到来してブロック数が減少し始める(logA2<logX≦log
B2)。The graph of the function f2 (x) when the block size is large has a smaller number of blocks corresponding to the frequency range of pixels than the graph of the function f1 (x) when the block size is small. The slope change point P2 arrives at a large value (logX = logA2) in the pixel frequency range, and the number of blocks starts to decrease (logA2 <logX ≦ log
B2).
【0050】この場合には、選択されるブロック数が総
ブロック数(Bn)に対して多くなるので境界線(logX
=logT2)は、勾配変化点P2の左側になる(左斜線で示
した面積の部分20参照)。In this case, since the number of selected blocks is larger than the total number of blocks (Bn), the boundary line (logX
= LogT2) is on the left side of the gradient change point P2 (see the area 20 shown by the left diagonal line).
【0051】選択されたブロック数が、総ブロック数
(Bn)に対し多くなるので選択されたブロック内の画
素の総数も全画素に対して多くなり一見この手段が良い
ように見える。しかし、各ブロックの大きさが大きくな
るため、仮に選択されたブロック内の画素であっても限
定色との距離が長くなり(補正量を増やさなければなら
ない)、結局入力された画像とは異なるものとなってし
まう。Since the number of selected blocks is larger than the total number of blocks (Bn), the total number of pixels in the selected blocks is also large for all pixels, and this means seems good at first glance. However, since the size of each block becomes large, even the pixels in the selected block have a long distance from the limited color (the amount of correction needs to be increased), which is different from the input image in the end. It becomes a thing.
【0052】従って、ブロックサイズが大きい場合の関
数f2(x)で表わされるブロックサイズで分割したデ
ータに基づいて入力されたカラー画像を再現すると、入
力されたカラー画像50に対して大きな違いは少ない
が、濃淡の緩やかな部分では、地図の等高線のような縞
模様ができてしまう。Therefore, when the input color image is reproduced based on the data divided by the block size represented by the function f2 (x) when the block size is large, there is little difference from the input color image 50. However, a striped pattern like the contour lines of a map is formed in the part where the shading is gentle.
【0053】次に、被写体の異なるカラー画像50に対
する3種類の実験例を説明する。表3及び表4と、表5
及び表6と、表7及び表8とは、3通りのブロックサイ
ズに分割し(図1及び図2に対応して)、各々3種類の
カラー画像50の被写体による実験データを表わしたも
のである。Next, three types of experimental examples for color images 50 of different subjects will be described. Tables 3 and 4 and Table 5
Table 6 and Table 7 and Table 8 are divided into three block sizes (corresponding to FIG. 1 and FIG. 2), and each represents experimental data of three types of color images 50 of subjects. is there.
【0054】そして、この表で表わした実験データに基
づいて前述した図1及び図2の方法によって、画素の度
数範囲とブロック数とを対数関係で表わして勾配変化点
を求め、且つ限定色を有するブロックに内含する画素の
総数から境界線を求めたのが、図3、図4及び図5であ
る。Then, based on the experimental data shown in this table, by the method shown in FIGS. 1 and 2, the frequency range of pixels and the number of blocks are expressed in a logarithmic relationship to obtain the gradient change point, and the limited color is determined. Boundary lines are obtained from the total number of pixels included in the included blocks in FIGS. 3, 4, and 5.
【0055】尚、表3及び表4と図3、表5及び表6と
図4、表7及び表8と図5は、各々対応し、1画面あた
り480(画素/ライン)×400(ライン)=19
2、000個の総画素数で実験を行っている。Table 3 and Table 4 and FIG. 3, Table 5 and Table 6 and FIG. 4, Table 7 and Table 8 and FIG. 5 correspond to each other, and 480 (pixels / line) × 400 (line) per screen. ) = 19
The experiment is conducted with the total number of pixels of 2,000.
【0056】[0056]
【表3】[Table 3]
【0057】表3は、入力するカラー画像50を、人物
が入った静止画像を被写体とした実験例1であって、図
1及び図2に対応して3通りのブロックサイズで分割し
たものである。即ち、従来例であれば実験例1(原画)
に示すように、Rブロックサイズを64階調、Gブロッ
クサイズを64階調、Bブロックサイズを64階調で分
割して、色の数は約260、000色必要である。Table 3 is an experimental example 1 in which the input color image 50 is a still image containing a person, and is divided into three block sizes corresponding to FIGS. 1 and 2. is there. That is, if it is a conventional example, Experimental example 1 (original image)
As shown in, the R block size is divided into 64 gradations, the G block size is divided into 64 gradations, and the B block size is divided into 64 gradations, and the number of colors is required to be about 260,000.
【0058】これに対して、実験例1―A(図2のf1
(x)に対応)は、Rブロックサイズを16階調、Gブ
ロックサイズを32階調、Bブロックサイズを16階調
でRGB空間を分割して、限定色の色数は256個に限
定したものである。On the other hand, Experimental Example 1-A (f1 in FIG. 2)
(Corresponding to (x)) divides the RGB space into 16 gradations of R block size, 32 gradations of G block size, and 16 gradations of B block size, and limits the number of limited colors to 256. It is a thing.
【0059】実験例1―B(図1のf(x)に対応)
は、Rブロックサイズを16階調、Gブロックサイズを
16階調、Bブロックサイズを16階調でRGB空間を
分割して、限定色の色数は256個にしたものである。Experimental Example 1-B (corresponding to f (x) in FIG. 1)
Shows that the RGB space is divided into R block size of 16 gradations, G block size of 16 gradations, and B block size of 16 gradations so that the number of limited colors is 256.
【0060】実験例1―C(図2のf2に対応)は、R
ブロックサイズを16階調、Gブロックサイズを8階
調、Bブロックサイズを16階調でRGB空間を分割し
て、限定色の色数は256個に限定したものである。
尚、RGBブロックサイズの内Gブロックサイズだけ変
化させたのは緑(G)の変化が他の赤(R)や青(B)
に比べて人間の視覚に与える影響が一番大きいからであ
る。Experimental Example 1-C (corresponding to f2 in FIG. 2) is R
The number of limited colors is limited to 256 by dividing the RGB space with a block size of 16 gradations, a G block size of 8 gradations, and a B block size of 16 gradations.
It should be noted that only the G block size of the RGB block size is changed because the change of green (G) is other red (R) or blue (B).
This is because it has the greatest effect on human vision compared to.
【0061】表4は、表3で示したブロックサイズで分
割した場合に、各ブロックに内含する画素の度数範囲
と、該画素の度数範囲とブロック数の関係を実験で得た
データを表わしたものである。Table 4 shows data obtained by experiments on the frequency range of pixels included in each block and the relationship between the frequency range of the pixels and the number of blocks when divided by the block size shown in Table 3. It is a thing.
【0062】[0062]
【表4】[Table 4]
【0063】即ち、実験例1―Aでは、画素の度数範囲
が”0〜(21−1)”から” 27〜(28―1)”ま
では略同じ値のブロック数であり、”28〜(29―
1)”から徐々にブロック数が減少する傾向が明らかに
わかる。That is, in the experimental example 1-A, the number of blocks is substantially the same in the pixel frequency range from "0 to (21-1)" to "27 to (28-1)", and "28 to (29-
It is clear from 1) that the number of blocks gradually decreases.
【0064】実験例1―Bでは、画素の度数範囲が”0
〜(21−1)”から”26〜(27―1)”までは略同
じ値のブロック数であり、”27〜(28―1)”から徐
々にブロック数が減少する傾向が明らかにわかる。In Experimental Example 1-B, the pixel frequency range is "0".
From ~ (21-1) "to" 26 ~ (27-1) ", the number of blocks is almost the same, and it is clear that the number of blocks gradually decreases from" 27 ~ (28-1) ". ..
【0065】実験例1―Cでは、画素の度数範囲が”0
〜(21−1)”から”28〜(29―1)”までは略同
じ値のブロック数であり、”29〜(210―1)”から
徐々にブロック数が減少する傾向が明らかにわかる。In Experimental Example 1-C, the pixel frequency range is "0".
From ~ (21-1) "to" 28 ~ (29-1) ", the number of blocks is almost the same, and it is clear that the number of blocks gradually decreases from" 29 ~ (210-1) ". ..
【0066】図3は、入力するカラー画像を、人物が入
った静止画像を被写体とした実験例1で求めたデータ
(表3、表4参照)に基づいて、上記図1及び図2で示
した方法によって画素の度数範囲とブロック数の関係を
グラフに表わしたものである。FIG. 3 shows the input color image in FIG. 1 and FIG. 2 based on the data (see Tables 3 and 4) obtained in Experimental Example 1 in which a still image containing a person is the subject. This is a graph showing the relationship between the frequency range of pixels and the number of blocks by the above method.
【0067】実験例1―Aは○印、実験例1―Bは△
印、実験例1―Cは□印で示し、画素の度数範囲の対数
を横軸にとり、ブロック数の対数を縦軸にとり、この両
者の関数関係の近似値を線で結んでグラフにしたもので
ある。Experimental example 1-A is marked with a circle, and experimental example 1-B is marked with a triangle.
The symbol □ indicates experimental example 1-C, the logarithm of the pixel frequency range is on the horizontal axis, the logarithm of the number of blocks is on the vertical axis, and the approximate values of the functional relationship between the two are connected by a line to form a graph. Is.
【0068】また、破線は、選択された限定色を有する
全てのブロックに内含する画素の総数の面積の1辺であ
る境界線(logX=logA、logX=logB、logX=logC)を表
わしている。従って、この境界線(logX=logA、logX=
logB、logX=logC)の右側によって囲まれた面積が選択
された限定色を有するブロックに内含する画素の総数で
ある。The broken line represents a boundary line (logX = logA, logX = logB, logX = logC) which is one side of the area of the total number of pixels included in all the blocks having the selected limited color. There is. Therefore, this boundary line (logX = logA, logX =
The area surrounded by the right side of (logB, logX = logC) is the total number of pixels included in the block having the selected limited color.
【0069】ここで×印は、勾配変化点P(P-A、P-B、
P-C)を表わしたものである。即ち、実験例1―Aで
は、勾配変化点P―Aに対して右側に上記境界線(logX
=logA)があり、実験例1―Bでは、勾配変化点P―B
に対してほぼ等しい位置に上記境界線(logX=logB)が
あり、実験例1―Cでは勾配変化点P―Cに対して左側
に上記境界線(logX=logC)がある。Here, the X mark indicates the slope change point P (PA, PB,
PC). That is, in Experimental Example 1-A, the boundary line (logX
= LogA), and in the experimental example 1-B, the gradient change point P-B
The boundary line (logX = logB) is located at substantially the same position as the above, and in Experimental Example 1-C, the boundary line (logX = logC) is located on the left side of the gradient change point P-C.
【0070】従って、これら3通りの実験例1で得られ
た選択色で再現した場合には、実験例1―A、1―Cは
縞模様がでたり、原画に対して大きく色が違ったりす
る。しかしながら、実験例1―Bにおいては、限定色に
よって再現しても入力したカラー画像に比べてバランス
のよい画像を再現することができる。Therefore, when reproduced with the selected colors obtained in these three different experimental examples 1, the experimental examples 1-A and 1-C have a striped pattern or a large difference in color from the original image. To do. However, in Experimental Example 1-B, it is possible to reproduce a well-balanced image as compared with the input color image even if the limited color is reproduced.
【0071】表5は、入力するカラー画像の対象を人物
を中心とせず、人物の前に置いた果物等の静止画像を被
写体とした実験例2であって、実験例1と同様に任意に
3通りのブロックサイズで分割したものを表にして表わ
したものである。即ち、従来例であれば実験例2(原
画)に示すように、Rブロックサイズを64階調、Gブ
ロックサイズを64階調、Bブロックサイズを64階調
で分割して、色の数は約260000色必要である。Table 5 shows an experiment example 2 in which the target of the input color image is not a person but a still image of fruit or the like placed in front of the person as an object. The table is obtained by dividing into three block sizes. That is, in the conventional example, as shown in Experimental Example 2 (original image), the R block size is divided into 64 gradations, the G block size is divided into 64 gradations, and the B block size is divided into 64 gradations. About 260,000 colors are needed.
【0072】[0072]
【表5】[Table 5]
【0073】これに対して、実験例2―A(図2のf1
(x)に対応)は、Rブロックサイズを16階調、Gブ
ロックサイズを32階調、Bブロックサイズを16階調
でRGB空間を分割して、限定色の色数は256色に限
定したものである。On the other hand, Experimental Example 2-A (f1 in FIG. 2)
(Corresponding to (x)), the R block size is divided into 16 gradations, the G block size is divided into 32 gradations, and the B block size is divided into 16 gradations, and the number of limited colors is limited to 256. It is a thing.
【0074】実験例2―B(図1のf(x)に対応)
は、Rブロックサイズを16階調、Gブロックサイズを
16階調、Bブロックサイズを16階調でRGB空間を
分割して、限定色の色数は256色にしたものである。Experimental Example 2-B (corresponding to f (x) in FIG. 1)
Is an R block size divided into 16 gradations, a G block size divided into 16 gradations, and a B block size divided into 16 gradations so that the RGB space is divided into 256 limited colors.
【0075】実験例2―C(図2のf2(x)に対応)
は、Rブロックサイズを16階調、Gブロックサイズを
8通り、Bブロックサイズを16階調でRGB空間を分
割して、限定色の色数は256色に限定したものであ
る。尚、RGBブロックサイズの内Gブロックサイズだ
け変化させたのは実験例1と同様に緑(G)の変化が他
の赤(R)や青(B)に比べて人間の視覚に与える影響
が一番大きいからである。Experimental Example 2-C (corresponding to f2 (x) in FIG. 2)
The R block size is 16 gradations, the G block size is 8 patterns, and the B block size is 16 gradations, so that the RGB space is divided and the number of limited colors is limited to 256 colors. It should be noted that changing only the G block size out of the RGB block sizes has the effect that the change in green (G) has an effect on human vision as compared with other red (R) and blue (B) as in Experimental Example 1. Because it is the largest.
【0076】表6は、表5で示したブロックサイズで分
割した場合に、各ブロックに内含する画素の度数範囲
と、該画素の度数範囲とブロック数との関係を実験で得
たデータを表わしたものである。Table 6 shows data obtained by experiments on the frequency range of the pixels included in each block and the relationship between the frequency range of the pixels and the number of blocks when divided by the block size shown in Table 5. It is a representation.
【0077】[0077]
【表6】[Table 6]
【0078】実験例2−Aでは、画素の度数範囲が”0
〜(21−1)”から”26〜(27―1)”までは略同
じ値のブロック数であり、”27〜(28―1)”から徐
々にブロック数が減少する傾向が明らかにわかる。In Experimental Example 2-A, the pixel frequency range is "0".
From ~ (21-1) "to" 26 ~ (27-1) ", the number of blocks is almost the same, and it is clear that the number of blocks gradually decreases from" 27 ~ (28-1) ". ..
【0079】実験例2―Bでは、画素の度数範囲が”0
〜(21−1)”から”29〜(210―1)”までは略同
じ値のブロック数であり、”210〜(211―1)”から
徐々にブロック数が減少する傾向が明らかにわかる。In Experimental Example 2-B, the pixel frequency range is "0".
From ~ (21-1) "to" 29 ~ (210-1) ", the number of blocks is almost the same, and it is clear that the number of blocks gradually decreases from" 210 ~ (211-1) ". ..
【0080】実験例2―Cでは、画素の度数範囲が”0
〜(21−1)”から”29〜(210―1)”までは略同
じ値のブロック数であり、”210〜(211―1)”から
徐々にブロック数が減少する傾向が明らかにわかる。In Experimental Example 2-C, the pixel frequency range is "0".
From ~ (21-1) "to" 29 ~ (210-1) ", the number of blocks is almost the same, and it is clear that the number of blocks gradually decreases from" 210 ~ (211-1) ". ..
【0081】図4は、入力するカラー画像を、実験例1
のようにカラー画像の対象を人物を中心とせず、人物の
前に置いた果物等の静止画像を被写体とした実験例2で
求めたデータ(表5、表6参照)に基づいて、図1及び
図2で示した方法によって画素の度数範囲とブロック数
の関係をグラフに表わしたものである。FIG. 4 shows a color image to be input as the first experimental example.
Based on the data (see Tables 5 and 6) obtained in Experimental Example 2 in which the target of the color image is not centered on the person like this, but a still image of a fruit or the like placed in front of the person is the subject, as shown in FIG. 3 is a graph showing the relationship between the frequency range of pixels and the number of blocks by the method shown in FIG.
【0082】図3で示した実験例1と同様に、実験例2
―Aは○印、実験例2―Bは△印、実験例2―Cは□印
で示し、画素の度数範囲の対数を横軸にとり、ブロック
数の対数を縦軸にとり、この両者の関数関係の近似値を
線で結んでグラフにしたものである。Experimental example 2 is the same as experimental example 1 shown in FIG.
-A is indicated by a circle, Experiment 2-B is indicated by a triangle, and Experiment 2-C is indicated by a square. The horizontal axis represents the logarithm of the pixel frequency range, and the vertical axis represents the logarithm of the number of blocks. It is a graph in which the approximate values of the relationship are connected by a line.
【0083】また、破線は、選択された限定色を有する
ブロックに内含する画素の総数の面積の1辺である境界
線(logX=logA、logX=logB、logX=logC)を表わしたも
のである。従って、この境界線(logX=logA、logX=log
B、logX=logC)の右側によって囲まれた面積が選択され
た限定色を有するブロックに内含する画素の総数の面積
である。The broken line represents a boundary line (logX = logA, logX = logB, logX = logC) which is one side of the area of the total number of pixels included in the block having the selected limited color. is there. Therefore, this boundary line (logX = logA, logX = log
The area surrounded by the right side of (B, logX = logC) is the area of the total number of pixels included in the block having the selected limited color.
【0084】ここで×印は、勾配変化点P(P-A、P-B、
P-C)を表わしたものである。即ち、実験例2―Aで
は、勾配変化点P―Aに対して右側に上記境界線(logX
=logA)があり、実験例2―Bでは、勾配変化点P―B
に対してほぼ等しい位置に上記境界線(logX=logB)が
あり、実験例2―Cでは勾配変化点P―Cに対して左側
に上記境界線(logX=logC)がある。従って、これら3
通りの実験例で得られた選択色で再現した場合には、実
験例2―A、2―Cは縞模様がでたり、原画に対して大
きく色が違ったりする。しかしながら、実験例2-Bにお
いては、限定色によって再現しても入力されたカラー画
像に比べてバランスのよい画像を再現することができ
る。Here, the X mark indicates the gradient change point P (PA, PB,
PC). That is, in Experimental Example 2-A, the boundary line (logX
= logA), and in Experimental Example 2-B, the slope change point P-B
The boundary line (logX = logB) is located at almost the same position as the above, and in Experimental Example 2-C, the boundary line (logX = logC) is located on the left side of the gradient change point P-C. Therefore, these 3
When reproduced with the selected color obtained in the above experimental example, Experimental Examples 2-A and 2-C have a striped pattern or a large difference in color from the original image. However, in Experimental Example 2-B, it is possible to reproduce a well-balanced image compared to the input color image even if the limited color is reproduced.
【0085】表7は、入力するカラー画像の対象が静止
している3体の人形を中心とした被写体であるところの
実験例3であって、任意に3通りのブロックサイズで分
割したものを表わしたものである。即ち、従来例であれ
ば実験例3(原画)に示すように、Rブロックサイズを
64階調、Gブロックサイズを64階調、Bブロックサ
イズを64階調で分割して、色の数は約26000色必要で
ある。Table 7 shows Experimental Example 3 in which the target of the input color image is a subject centering on three stationary dolls, which are arbitrarily divided into three block sizes. It is a representation. That is, in the conventional example, as shown in Experimental Example 3 (original image), the R block size is divided into 64 gradations, the G block size is divided into 64 gradations, and the B block size is divided into 64 gradations. About 26000 colors are needed.
【0086】[0086]
【表7】[Table 7]
【0087】これに対して、実験例3―A(図2のf1
(x)に対応)は、Rブロックサイズを16階調、Gブ
ロックサイズ32階調、Bブロックサイズを16階調で
RGB空間を分割して、限定色の色数は256色に限定
したものである。On the other hand, Experimental Example 3-A (f1 in FIG. 2)
(Corresponding to (x)) is one in which the RGB space is divided into 16 gradations of R block size, 32 gradations of G block size, and 16 gradations of B block size, and the number of limited colors is limited to 256 colors. Is.
【0088】実験例3―B(図1のf(x)に対応)
は、Rブロックサイズを16階調、Gブロックサイズを
16階調、Bブロックサイズを16階調でRGB空間を
分割して、限定色の色数は256色にしたものである。Experimental Example 3-B (corresponding to f (x) in FIG. 1)
Is an R block size divided into 16 gradations, a G block size divided into 16 gradations, and a B block size divided into 16 gradations so that the RGB space is divided into 256 limited colors.
【0089】実験例3―C(図2のf2(x)に対応)
は、Rブロックサイズを16階調、Gブロックサイズを
8通り、Bブロックサイズを16階調でRGB空間を分
割して、限定色の色数は256色に限定したものであ
る。尚、RGBブロックサイズの内Gブロックサイズだ
け変化させたのは、実験例1、2と同様に緑(G)の変
化が他の赤(R)や青(B)に比べて人間の視覚に与え
る影響が一番大きいからである。Experimental Example 3-C (corresponding to f2 (x) in FIG. 2)
The R block size is 16 gradations, the G block size is 8 patterns, and the B block size is 16 gradations, so that the RGB space is divided and the number of limited colors is limited to 256 colors. It should be noted that only the G block size of the RGB block size is changed because the change of green (G) is similar to that of the other red (R) and blue (B) as in Experiments 1 and 2 and is more human vision. This is because it has the greatest effect.
【0090】表8は、表7で示したブロックサイズで分
割した場合に、限定色を有するブロックに内含する画素
の度数範囲と、該画素の度数範囲に対応するブロックの
数の実験で得られたデータを表で表わしたものである。Table 8 is obtained by an experiment of the frequency range of pixels included in the block having the limited color and the number of blocks corresponding to the frequency range of the pixel when divided by the block size shown in Table 7. This is a table showing the obtained data.
【0091】[0091]
【表8】[Table 8]
【0092】実験例3―Aは、画素の度数範囲が”0〜
(21−1)”から”27〜(28―1)”までは略同じ
値のブロック数であり、”28〜(29―1)”から徐々
にブロック数が減少する傾向が明らかにわかる。In Experimental Example 3-A, the pixel frequency range is from "0".
From (21-1) "to" 27- (28-1) ", the number of blocks is almost the same, and it is clear that the number of blocks gradually decreases from" 28- (29-1) ".
【0093】実験例3―Bは、画素の度数範囲が”0〜
(21−1)”から”28〜(29―1)”までは略同じ
値のブロック数であり、”29〜(210―1)”から徐
々にブロック数が減少する傾向が明らかにわかる。In Experimental Example 3-B, the pixel frequency range is from "0".
From (21-1) "to" 28 to (29-1) ", the number of blocks is almost the same, and it is clear that the number of blocks gradually decreases from" 29 to (210-1) ".
【0094】実験例3―Cは、画素の度数範囲が”0〜
(21−1)”から”28〜(29―1)”までは略同じ
値のブロック数であり、”29〜(210―1)”から徐
々にブロック数が減少する傾向が明らかにわかる。In Experimental Example 3-C, the pixel frequency range is from "0".
From (21-1) "to" 28 to (29-1) ", the number of blocks is almost the same, and it is clear that the number of blocks gradually decreases from" 29 to (210-1) ".
【0095】図5は、入力するカラー画像を、カラー画
像の対象を人物を中心とせず、3体の人形を中心とした
被写体とした実験例3で求めたデータ(表7、表8参
照)に基づいて、図1及び図2で示した方法によって画
素の度数範囲とブロック数の関係をグラフに表わしたも
のである。FIG. 5 shows data obtained in Experimental Example 3 in which the input color image is a subject whose main object is not a person but a three dolls (see Tables 7 and 8). 3 is a graph showing the relationship between the frequency range of pixels and the number of blocks by the method shown in FIGS.
【0096】図3で示した実験例1と同様に、実験例3
―Aは○印、実験例3―Bは△印、実験例3―Cは□印
で示し、画素の度数範囲の対数を横軸にとり、ブロック
数の対数を縦軸にとり、この両者の関数関係の近似値を
線で結んでグラフにしたものである。Similar to Experimental Example 1 shown in FIG. 3, Experimental Example 3
-A is indicated by a circle, Experimental Example 3-B is indicated by a triangle, and Experimental Example 3-C is indicated by a square, and the logarithm of the pixel frequency range is plotted on the horizontal axis and the logarithm of the block number is plotted on the vertical axis. It is a graph in which the approximate values of the relationship are connected by a line.
【0097】また、破線は、選択された限定色を有する
ブロックに内含する画素の総数の境界線(logX=logA、l
ogX=logB、logX=logC)である。従って、この境界線(l
ogX=logA、logX=logB、logX=logC)の右側によって囲ま
れた面積が選択された限定色を有するブロックに内含す
る画素の総数の面積である。Further, the broken line is a boundary line (logX = logA, l) of the total number of pixels included in the block having the selected limited color.
ogX = logB, logX = logC). Therefore, this boundary line (l
The area enclosed by the right side of (ogX = logA, logX = logB, logX = logC) is the area of the total number of pixels included in the block having the selected limited color.
【0098】ここで×印は、勾配変化点P(P-A、P-B、
P-C)を表わしたものである。即ち、実験例3―Aで
は、勾配変化点P―Aに対して右側に上記境界線(logX
=logA)があり、実験例3―Bでは、勾配変化点P―B
に対してほぼ等しい位置に上記境界線(logX=logB)が
あり、実験例3―Cでは勾配変化点P―Cに対して左側
に上記境界線(logX=logC)がある。従って、これら3
通りの実験例で得られた選択色で再現した場合には、実
験例3―A、3―Cは縞模様がでたり、原画に対して大
きく色が違ったりする。しかしながら、実験例3―Bに
おいては、限定色によって再現しても入力されたカラー
画像に比べてバランスのよい画像を再現することができ
る。Here, the X mark indicates the gradient change point P (PA, PB,
PC). That is, in Experimental Example 3-A, the boundary line (logX
= LogA), and in Experimental Example 3-B, the slope change point P-B
The boundary line (logX = logB) is located at substantially the same position as the above, and in Experimental Example 3-C, the boundary line (logX = logC) is located on the left side of the gradient change point P-C. Therefore, these 3
When reproduced with the selected color obtained in the same experimental example, Experimental Examples 3-A and 3-C have a striped pattern or a large color difference from the original image. However, in Experimental Example 3-B, even if a limited color is reproduced, a well-balanced image can be reproduced as compared with the input color image.
【0099】上記実験例からわかるように、対象とする
カラー画像を3種類選び、各カラー画像に対して3通り
の実験例のデータから、勾配変化点Pと、選択した限定
色を有するブロックに内含する画素の総数から求めた境
界線(logX=logT)がほぼ同一位置にあるように、ブロ
ックサイズ(△r△g△b)を分割すれば、入力したカ
ラー画像50を限定色で再現してもバランスのとれた画
像を得ることができる。As can be seen from the above experimental example, three kinds of target color images are selected, and from each of the three types of experimental data for each color image, a gradient change point P and a block having the selected limited color are selected. If the block size (ΔrΔgΔb) is divided so that the boundary line (logX = logT) obtained from the total number of included pixels is almost at the same position, the input color image 50 is reproduced with limited colors. Even with this, a well-balanced image can be obtained.
【0100】上述の通り、入力した各画素のR、G、B
の値とブロックサイズ(△r△g△b)とにより関数f
(x)を求めこれにより、勾配変化点P点(logX=P)
及びT点(logX=logT)が求められる。従って、ブロッ
クサイズ(△r△g△b)を変えて最適条件(P=lo
gT)となるブロックサイズをコンピユーターで演算処
理することにより求めることができる。As described above, R, G, B of each input pixel
Value f and the block size (ΔrΔgΔb)
(X) is calculated and the gradient change point P point (logX = P)
And T point (logX = logT) are obtained. Therefore, by changing the block size (ΔrΔgΔb), the optimum condition (P = lo
The block size of gT) can be obtained by arithmetic processing with a computer.
【0101】[0101]
【発明の効果】本発明に係る限定色選択方法によれば、
入力したカラー画像の画素を3次元空間からなるRGB
空間に配置して、適宜サイズで分割されたブロックに内
含する画素の分布密度の多い順から一定数の限定色を選
択し、前記ブロック数と画素の度数範囲から勾配変化点
を求めると共に、限定色を有するブロックに内含する画
素の総数から境界線を求めて、該境界線が勾配変化点と
ほぼ同一位置になるようにブロックサイズを適宜分割し
て選択されたブロックの代表色を限定色とし、その限定
色で再現をすることにより、入力されたカラー画像に対
してバランスのよい画像を得ることができる。 しか
も、本発明の方法はコンピューター処理をする際にソフ
トで自動的に行なうことができる。According to the limited color selection method of the present invention,
The pixels of the input color image are converted into RGB that consists of a three-dimensional space.
Arranged in space, select a fixed number of limited colors from the order of the distribution density of pixels contained in the block divided by an appropriate size, and determine the gradient change point from the block number and the frequency range of pixels, The boundary line is obtained from the total number of pixels included in the block having the limited color, and the block size is appropriately divided so that the boundary line is almost at the same position as the gradient change point, and the representative color of the selected block is limited. An image having a good balance with respect to the input color image can be obtained by using the color and reproducing with the limited color. Moreover, the method of the present invention can be automatically performed by software when it is processed by a computer.
【図1】本発明の方法に対応する限定色選択の理論値
を、画素の度数範囲とブロック数との対数関係で表わし
たものである。FIG. 1 shows a theoretical value of limited color selection corresponding to the method of the present invention in a logarithmic relationship between a pixel frequency range and the number of blocks.
【図2】本発明の方法を比較するために画素の度数範囲
とブロック数とをブロックサイズの大小による対数関係
で表わしたものである。FIG. 2 shows a frequency range of pixels and the number of blocks in a logarithmic relationship according to the size of a block size for comparison with the method of the present invention.
【図3】本発明に係る方法と、比較のためにブロックサ
イズを大小に変えたものとにおいて、画素の度数範囲と
ブロック数とを対数関係で表わした実験例1である。FIG. 3 is an experimental example 1 in which the frequency range of pixels and the number of blocks are represented by a logarithmic relationship in the method according to the present invention and in which the block size is changed for comparison.
【図4】本発明に係る方法と、比較のためにブロックサ
イズを大小に変えたものとにおいて、画素の度数範囲と
ブロック数とを対数関係で表わした実験例2である。FIG. 4 is an experimental example 2 in which the frequency range of pixels and the number of blocks are represented by a logarithmic relationship in the method according to the present invention and in which the block sizes are changed for comparison.
【図5】本発明に係る方法と、比較のためにブロックサ
イズを大小に変えたものとにおいて、画素の度数範囲と
ブロック数とを対数関係で表わした実験例3である。FIG. 5 is an experimental example 3 in which the frequency range of pixels and the number of blocks are represented by a logarithmic relationship in the method according to the present invention and in which the block sizes are changed for comparison.
【図6】一般的に知られているルック・アップ・テーブ
ル(LUT)を使用した限定色による再現方法の概略図
である。FIG. 6 is a schematic diagram of a limited color reproduction method using a generally known look-up table (LUT).
【図7】一般的に知られている表示エリアから得られた
RGB空間に配置された一例の画素の総数を表わした概
略図である。FIG. 7 is a schematic diagram showing an example of the total number of pixels arranged in an RGB space obtained from a generally known display area.
【図8】図7で示したRGB空間に配置された画素を適
宜ブロックサイズで均等に分割した概略図である。FIG. 8 is a schematic diagram in which pixels arranged in the RGB space shown in FIG. 7 are equally divided into appropriate block sizes.
【図9】従来の方法により表示エリアにカラー画像を表
示するための理論を示す概略図である。FIG. 9 is a schematic view showing a theory for displaying a color image in a display area by a conventional method.
5 選択されたブロックに内含する総画素数 10 選択されたブロックに内含する総画素数 20 選択されたブロックに内含する総画素数 40 データ領域 42 ルック・アップ・テーブル(LUT) 44 パレット番号 46 色番号 48 D/A変換 52 RGB空間に配置された画素 60 RGB空間 83 表示エリア 5 Total number of pixels included in the selected block 10 Total number of pixels included in the selected block 20 Total number of pixels included in the selected block 40 Data area 42 Look-up table (LUT) 44 Palette Number 46 Color number 48 D / A conversion 52 Pixels arranged in RGB space 60 RGB space 83 Display area
【表2】 [Table 2]
【表2】 [Table 2]
【表4】 [Table 4]
【表4】 [Table 4]
【表6】 [Table 6]
【表6】 [Table 6]
【表8】 [Table 8]
【表8】 [Table 8]
───────────────────────────────────────────────────── フロントページの続き (51)Int.Cl.5 識別記号 庁内整理番号 FI 技術表示箇所 G09G 5/36 9177−5G ─────────────────────────────────────────────────── ─── Continuation of the front page (51) Int.Cl. 5 Identification code Internal reference number FI technical display location G09G 5/36 9177-5G
Claims (1)
B各色を各々直交する座標軸とする3次元空間からなる
RGB空間にRGBデータに基づいて前記画素を配置
し、前記RGB空間をRGB方向にそれぞれ等間隔に割
り当てた複数のブロックに分割し、該各ブロック内に存
在する画素の代表色から複数の限定色を選択する方法に
おいて、 前記各ブロック内に存在する画素の分布密度に基づき、
ブロック数をY軸にとり画素の度数範囲をX軸にとった
時に、画素の度数範囲とブロック数との関係から勾配変
化点を求め、選択した前記限定色を有する全てのブロッ
クに内含する画素の総数によってY軸と略平行する境界
線を求め、該境界線が前記勾配変化点を含む勾配変化点
の近傍位置になるように前記RGB空間を適宜サイズの
ブロックに分割して限定色を選択することを特徴とする
カラー画像の限定色選択方法。1. A color image composed of a group of pixels
B The pixels are arranged on the basis of RGB data in an RGB space formed of a three-dimensional space in which each color is a coordinate axis orthogonal to each other, and the RGB space is divided into a plurality of blocks allocated at equal intervals in the RGB direction. In the method of selecting a plurality of limited colors from the representative color of the pixels present in the block, based on the distribution density of the pixels present in each block,
When the number of blocks is on the Y-axis and the frequency range of pixels is on the X-axis, the gradient change point is obtained from the relationship between the frequency range of pixels and the number of blocks, and the pixels included in all the blocks having the selected limited color are included. A boundary line that is substantially parallel to the Y-axis is obtained by the total number of the, and the RGB space is divided into blocks of appropriate sizes so that the boundary line is in the vicinity of the gradient change point including the gradient change point, and the limited color is selected. A limited color selection method for a color image, comprising:
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP3356484A JPH05188899A (en) | 1991-12-25 | 1991-12-25 | Method for selecting limited color for color image |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP3356484A JPH05188899A (en) | 1991-12-25 | 1991-12-25 | Method for selecting limited color for color image |
Publications (1)
Publication Number | Publication Date |
---|---|
JPH05188899A true JPH05188899A (en) | 1993-07-30 |
Family
ID=18449251
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP3356484A Pending JPH05188899A (en) | 1991-12-25 | 1991-12-25 | Method for selecting limited color for color image |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPH05188899A (en) |
-
1991
- 1991-12-25 JP JP3356484A patent/JPH05188899A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US5398120A (en) | Ordered dither image rendering with non-linear luminance distribution palette | |
US5278678A (en) | Color table display for interpolated color and anti-aliasing | |
US5455600A (en) | Method and apparatus for mapping colors in an image through dithering and diffusion | |
JP3095818B2 (en) | Method and apparatus for mapping a color image to a black and white image | |
US5341464A (en) | Luminance emphasized color image rendering | |
JP4363720B2 (en) | A device for creating color palettes | |
US5204665A (en) | Color editing with simple encoded images | |
JP2566670B2 (en) | Color mapping device and method | |
US5404427A (en) | Video signal processing with added probabilistic dither | |
US5398123A (en) | Image processing method and apparatus capable of automatic color masking | |
US5254977A (en) | Color display | |
EP0270259A2 (en) | Improvements relating to video signal processing systems | |
US5966461A (en) | Reduction of false contours by chrominance modulation | |
JPH08147453A (en) | Method and device for look-up table generation | |
EP0403081B1 (en) | Colour display | |
JPH05188899A (en) | Method for selecting limited color for color image | |
EP0557639B1 (en) | Method for amending colour nonuniformity of colour images | |
US6980221B2 (en) | Method for representing a digital color image using a set of palette colors | |
JP2002519878A (en) | Video processing on PC using statistically tuned color cubes | |
JP2775748B2 (en) | Method and apparatus for expressing limited color of color image | |
Lehn et al. | Greyscale and Colour Representation | |
JP3215156B2 (en) | Color image processing method | |
JPH0887256A (en) | Color reduction method | |
JPH09127924A (en) | Image subtractive color display method | |
JP3318436B2 (en) | Automatic pallet sorting method |