JPH0934429A - Image processing device - Google Patents

Image processing device

Info

Publication number
JPH0934429A
JPH0934429A JP7180263A JP18026395A JPH0934429A JP H0934429 A JPH0934429 A JP H0934429A JP 7180263 A JP7180263 A JP 7180263A JP 18026395 A JP18026395 A JP 18026395A JP H0934429 A JPH0934429 A JP H0934429A
Authority
JP
Japan
Prior art keywords
image
color space
palette
partial color
partial
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP7180263A
Other languages
Japanese (ja)
Inventor
Jun Sato
順 佐藤
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.)
Fujifilm Business Innovation Corp
Original Assignee
Fuji Xerox 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 Fuji Xerox Co Ltd filed Critical Fuji Xerox Co Ltd
Priority to JP7180263A priority Critical patent/JPH0934429A/en
Publication of JPH0934429A publication Critical patent/JPH0934429A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

PROBLEM TO BE SOLVED: To display in colors similar to original ones to some extent even as for an image code of low frequency of use, in an image processing device in which a pallet is made based on the image data of a color original image. SOLUTION: The number of partial color spaces including an image code used in an original image is measured by a measuring means 12, and when the number is larger than the number of registrable ones on a pallet, the whole color space is divided by a dividing means 13. When the measuring means 12 judges that the number of the partial color spaces divided by the dividing means 13 is smaller than the number of registrable ones on a pallet, a first registering means 14 selects an image code to be a representative color from the divided partial color spaces, and registers it onto the pallet.

Description

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

【0001】[0001]

【産業上の利用分野】この発明は、コンピュータシステ
ムに接続される画像出力装置に対して、フルカラー元画
像の色情報を限定色化して出力する際に用いられるパレ
ットに関し、詳しくはイメージスキャナ等で読み込んだ
カラー原画像(以下、原画像ともいう)の画像データに
基づいてパレットを作成する画像処理装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a palette used when outputting color information of a full-color original image with limited color to an image output device connected to a computer system. The present invention relates to an image processing device that creates a palette based on image data of a read color original image (hereinafter also referred to as an original image).

【0002】[0002]

【従来の技術】近年、コンピュータシステムでは表示装
置のカラー化が進むとともに、より原画像に近い表示が
求められている。表示装置の画質を向上させるには、1
画素当たりの情報量を増やすことが一般的であるが、こ
の方法では記憶装置の大型化、データ転送時間の増大を
招いてしまう。そこで、カラーの表示装置を備えたコン
ピュータシステムには、パレット機能を有する画像処理
装置が用いられている。パレット機能とは、画面に表示
される画像コードを直接指定するのではなく、画像コー
ドとその画像コードを指定する情報をパレットと呼ばれ
るテーブル上に登録しておき、少ない情報量で多くの画
像コードを指定できるようにしたものである。
2. Description of the Related Art In recent years, with the progress of colorization of display devices in computer systems, display closer to the original image is required. To improve the image quality of the display device, 1
It is common to increase the amount of information per pixel, but this method causes an increase in the size of the storage device and an increase in the data transfer time. Therefore, an image processing device having a palette function is used in a computer system equipped with a color display device. The palette function does not directly specify the image code to be displayed on the screen, but registers the image code and the information specifying the image code in a table called a palette so that many image codes can be created with a small amount of information. This allows you to specify.

【0003】この方法では、一般にフルカラーと呼ばれ
る約1670万色(1画素24ビット)を、256色
(1画素8ビット)のパレットを使って表示することが
多い。これは、1画素当たりの出力色として256色あ
れば、画質的にある程度満足できる出力が得られるとい
う知見に基づいている。ただし、必要とする画像コード
がパレットに必ず存在するとは限らないため、場合によ
っては他の画像コードを代用しなくてはならず、これが
表示画面における誤差となって表れていた。
In this method, about 16.7 million colors (24 bits per pixel), which are generally called full-color, are often displayed using a palette of 256 colors (8 bits per pixel). This is based on the knowledge that if the number of output colors per pixel is 256, an output that satisfies image quality to some extent can be obtained. However, since the required image code does not always exist in the palette, it is necessary to substitute another image code in some cases, and this appears as an error in the display screen.

【0004】このパレット機能を有効に利用するため
に、従来では表示すべき画像内で使用されている画像コ
ードについて、画像コード毎に使用頻度を計測し、使用
頻度の高い画像コードからパレットに登録していく方法
が一般的である。しかし、この方法には次に述べるよう
な2つの問題がある。
In order to effectively use this palette function, the frequency of use is conventionally measured for each image code used in the image to be displayed, and the image code with the highest frequency of use is registered in the palette. The general method is to do so. However, this method has the following two problems.

【0005】一つめは、使用頻度の低い画像コードが無
視される点である。例えば画像のほとんどが青系の色で
あり、その中にわずかに赤い色が含まれているような画
像データの場合、パレットは青系の色だけで埋められて
しまい、本来赤く表示されるべき画素までが青系の色に
なってしまうことがある。
The first is that image codes that are rarely used are ignored. For example, in the case of image data in which most of the image is bluish and contains a slightly reddish color, the palette is filled with only bluish colors and should be displayed in red. Sometimes even the pixels become bluish.

【0006】二つめは、本来は使用頻度が高い色の使用
頻度が低くとられてしまう場合がある点である。例えば
入力する画像のほとんどが一色の青色であるのに、入力
装置におけるノイズ等により、一色の青色が極めて近似
している数色の青系の色に認識されてしまうと、その数
色の青系の色のそれぞれの使用頻度は最初の一色の青色
に比べてかなり落ちるため、パレットに本来の青色が選
択されないことになってしまう。
Secondly, there is a case where a color that is originally frequently used is used less frequently. For example, if most of the images to be input are blue of one color, but noise of the input device or the like causes the blue of one color to be recognized as several blue-based colors that are very close to each other, the blue of those colors will be recognized. Since the frequency of use of each color of the system is considerably lower than that of the first color blue, the original blue color is not selected in the palette.

【0007】[0007]

【発明が解決しようとする課題】これに対して特開平4
−257984号公報には、全色空間を幾つかの部分色
空間に分け、各部分色空間の出現頻度の合計の比率によ
り、パレットに割り当てる部分色空間の色数を決め、各
部分色空間内の色の頻度の上位のものから順に、決めら
れた色数分だけ色を割り当ててパレットを作成するよう
にした画像出力装置が提案されている。
On the other hand, Japanese Unexamined Patent Publication No. Hei 4
In Japanese Patent Publication No. 2579884, the entire color space is divided into several partial color spaces, the number of colors of the partial color spaces to be assigned to the palette is determined based on the total ratio of the appearance frequencies of the partial color spaces. An image output device has been proposed in which the palette is created by allocating colors by a predetermined number of colors in order from the highest color frequency.

【0008】この画像出力装置によれば、ある色が入力
装置のノイズ等により数色の同系の色に認識されても、
その数色の同系の色は大きく異なることは無く、元の色
と同じ部分色空間に入ることでノイズ等の影響をなくす
ことができる。
According to this image output apparatus, even if a certain color is recognized as several similar colors due to noise of the input apparatus,
The similar colors of the several colors do not greatly differ, and the influence of noise or the like can be eliminated by entering the same partial color space as the original color.

【0009】しかしながら、この画像出力装置において
も、前述した一つめの問題点は解決されていない。ま
た、原画像で使用されている画像コードの分布のしかた
によっては有効でないこともある。例えば、原画像で使
用されている画像コードが色空間内の特定の色の周りに
集中している場合には、一つの部分色空間内に原画像で
使用する画像コードがすべて入ってしまうことがある。
しかし、上述した特開平4−257984号の画像出力
装置では、全色空間を複数の部分色空間に分けることを
特徴としているので、画像コードが上述のような条件で
分布している場合は、部分色空間を作成しても無駄とな
るため、余計な計算時間がかかるという問題点があっ
た。
However, even in this image output device, the above-mentioned first problem has not been solved. Further, it may not be effective depending on the distribution method of the image code used in the original image. For example, if the image codes used in the original image are concentrated around a specific color in the color space, all the image codes used in the original image should be included in one partial color space. There is.
However, the image output apparatus of Japanese Patent Laid-Open No. 4-257984 described above is characterized in that the entire color space is divided into a plurality of partial color spaces. Therefore, when the image codes are distributed under the above conditions, Even if the partial color space is created, it is useless, and there is a problem that extra calculation time is required.

【0010】この発明は、原画像の画像コードの分布に
適した全色空間の分割を行うことにより、使用頻度の低
い画像コードについても、ある程度本来の色に類似した
表示を行うことができる画像処理装置を提供することを
目的とする。
According to the present invention, by dividing the entire color space suitable for the distribution of the image code of the original image, it is possible to display an image code which is rarely used, similar to the original color. An object is to provide a processing device.

【0011】[0011]

【課題を解決するための手段】第1の発明に係わる画像
処理装置は、カラー原画像より得られた全色空間を所定
の分割数に従って複数の部分色空間に分割する分割手段
と、前記分割手段で分割された部分色空間の数がパレッ
ト登録可能数より少ないかどうかを判定する判定手段
と、前記分割手段により分割された部分色空間の代表色
を決定する決定手段と、前記判定手段において部分色空
間の数がパレット登録可能数と同じあるいは少ないと判
定されたときは、前記決定手段で決定された代表色をパ
レットに登録する登録手段と、前記判定手段において部
分色空間の数がパレット登録可能数より多いと判定され
たときは、前記分割手段での分割数を前回とは異なる分
割数に変更する変更手段とを備え、部分色空間の数がパ
レット登録可能数と同じあるいは少ないと判定されるま
で前記分割手段での分割を行うようにしたことを特徴と
する。
An image processing apparatus according to a first aspect of the present invention is a division means for dividing an entire color space obtained from a color original image into a plurality of partial color spaces according to a predetermined division number, and the division means. Determining means for determining whether or not the number of partial color spaces divided by the means is smaller than the palette registerable number, determining means for determining a representative color of the partial color spaces divided by the dividing means, and the determining means When it is determined that the number of partial color spaces is the same as or smaller than the number of palettes that can be registered, the registration means that registers the representative color determined by the determining means in the palette, and the determining means determines that the number of partial color spaces is the palette. When it is determined that the number of registrations is greater than the number that can be registered, the number of divisions in the division means is changed to a number of divisions different from the previous number, and the number of partial color spaces is equal to the number of palettes that can be registered. Characterized in that to perform the division in the division means until it is determined that the Flip or less.

【0012】第2の発明に係わる画像処理装置は、上記
第1の発明の構成において、前記決定手段に、分割され
た各部分色空間内に原画像で使用されている画像コード
が存在するかどうかを確認するための確認手段を備えた
ことを特徴とする。
In the image processing apparatus according to the second aspect of the present invention, in the configuration of the first aspect of the present invention, is there any image code used in the original image in each of the divided partial color spaces in the determining means? It is characterized by having a confirmation means for confirming whether or not.

【0013】第3の発明に係わる画像処理装置は、上記
第1の発明の構成において、前記決定手段の機能とし
て、各部分色空間に含まれる画像コードのうち、最も使
用頻度の高い画像コードを代表色とし、また前記使用頻
度が等しいときは、全色空間における原点からの距離が
最も遠い画像コードを代表色とすることを特徴とする。
第4の発明に係わる画像処理装置は、上記第1の発明の
構成において、前記変更手段の機能として、前記分割手
段の分割数を、前回よりも大きな分割数に変更すること
を特徴とする。
In the image processing apparatus according to the third aspect of the invention, in the configuration of the first aspect of the invention, the function of the determining means is to use the image code most frequently used among the image codes included in each partial color space. A representative color is used, and when the frequencies of use are equal, the image code having the longest distance from the origin in the entire color space is set as the representative color.
An image processing apparatus according to a fourth aspect of the present invention is characterized in that, in the configuration of the first aspect of the invention, the function of the changing unit is to change the number of divisions of the dividing unit to a larger number of divisions than the last time.

【0014】[0014]

【発明の実施の形態】第1の発明に係わる画像処理装置
において、カラー原画像より得られた全色空間を所定の
分割数に従って複数の部分色空間に分割する分割手段、
および判定手段において部分色空間の数がパレット登録
可能数より多いと判定されたときは、前記分割手段での
分割数を前回とは異なる分割数に変更する変更手段とし
て、実施例においては分割手段13が用いられている。
なお分割数とは、全色空間を分割する際の除数であり、
この分割数が増える毎に分割された一つの部分色空間の
空間領域は大きくなる。また、前記分割手段で分割され
た部分色空間の数がパレット登録可能数より少ないかど
うかを判定する判定手段として、実施例においては計測
手段12が用いられている。さらに、前記分割手段によ
り分割された部分色空間の代表色を決定する決定手段、
および前記判定手段において部分色空間の数がパレット
登録可能数と同じあるいは少ないと判定されたときは、
前記決定手段で決定された代表色をパレットに登録する
登録手段として第1の登録手段14が用いられている。
BEST MODE FOR CARRYING OUT THE INVENTION In the image processing apparatus according to the first invention, a dividing means for dividing the entire color space obtained from a color original image into a plurality of partial color spaces according to a predetermined division number,
And when the determining means determines that the number of partial color spaces is greater than the number that can be registered in the palette, the dividing means in the embodiment changes the dividing number in the dividing means to a different dividing number from the previous one. 13 is used.
The number of divisions is the divisor when dividing the entire color space,
As the number of divisions increases, the space area of one divided partial color space becomes larger. Further, the measuring means 12 is used in the embodiment as a determining means for determining whether or not the number of the partial color spaces divided by the dividing means is smaller than the palette registerable number. Furthermore, a determining unit that determines a representative color of the partial color space divided by the dividing unit,
When the number of partial color spaces is determined to be the same as or smaller than the number of palettes that can be registered in the determination means,
The first registration unit 14 is used as a registration unit that registers the representative color determined by the determination unit in the palette.

【0015】この発明に係わる画像処理装置では、全色
空間を複数の部分色空間に分割する際に、その部分色空
間の数がパレットに登録可能な数になるまで分割を行
い、分割された各部分色空間から代表色を選出してパレ
ットに登録するようにしているので、原画像で使用され
ている色を含む部分色空間については、その部分色空間
に含まれている色の少なくとも一つが代表色としてパレ
ットに登録されることになる。したがって、例えば画像
のほとんどが青系の色で、その中に小領域の赤系の色が
存在する画像について見てみると、従来の方法ではパレ
ットには青系の色のみを登録してしまうため、赤系の色
で表現されるべき画素が青系の色に表現されてしまう
が、この発明に係わる画像処理装置では、分割された部
分色空間内に、原画像で使用されている色が1つでも存
在すれば、その部分色空間に意味があるものとして、そ
の中から代表色が選出されるので、小領域の赤系の色に
ついても、その色が含まれている部分色空間からパレッ
トに登録された代表色で表現されることになり、従来の
ように大きく異なる色で表現されることがない。
In the image processing apparatus according to the present invention, when the entire color space is divided into a plurality of partial color spaces, the division is performed until the number of the partial color spaces reaches the number that can be registered in the palette. Since a representative color is selected from each partial color space and registered in the palette, at least one of the colors included in the partial color space should be selected for the partial color space that includes the colors used in the original image. Will be registered in the palette as a representative color. Therefore, for example, if you look at an image in which most of the images are bluish colors and there are small regions of reddish colors in them, the conventional method would register only bluish colors in the palette. Therefore, a pixel that should be expressed in a red color is expressed in a blue color, but in the image processing device according to the present invention, the colors used in the original image are stored in the divided partial color space. If there is at least one, the representative color is selected from among the partial color spaces that have meaning, and therefore, even for reddish colors in a small area, the partial color space that includes that color is also selected. Since it is represented by the representative color registered in the palette, it is not represented by a significantly different color as in the past.

【0016】[0016]

【実施例】以下、この発明に係わる画像処理装置の一実
施例を図面を参照しながら説明する。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment of an image processing apparatus according to the present invention will be described below with reference to the drawings.

【0017】図1に示すブロック図は、本実施例におけ
る画像処理装置10の機能的な構成を表している。この
画像処理装置10は、入力手段11、計測手段12、分
割手段13、第1の登録手段14、ヒストグラム作成手
段15、第2の登録手段16とから構成されている。
The block diagram shown in FIG. 1 shows the functional configuration of the image processing apparatus 10 in this embodiment. The image processing apparatus 10 includes an input unit 11, a measuring unit 12, a dividing unit 13, a first registering unit 14, a histogram creating unit 15, and a second registering unit 16.

【0018】入力手段11は、画像の入力を行うための
手段であり、一般的にはスキャナーによる画像の読み込
みやファイルからの画像データの読み込みが用いられ
る。この実施例の入力手段11では、ファイルからの画
像データの読み込みを行うものとする。また、入力手段
11では画像データの読み込みに加えて、読み込んだ画
像データで使用されている画像コードを全色空間へ展開
する処理と、画像コードの使用頻度のヒストグラムを作
成する処理を行っている。
The input means 11 is a means for inputting an image, and generally, reading of an image by a scanner or reading of image data from a file is used. The input means 11 of this embodiment reads image data from a file. In addition to the reading of the image data, the input means 11 performs a process of expanding the image code used in the read image data into the entire color space and a process of creating a histogram of the frequency of use of the image code. .

【0019】なお、画像データは1画素24ビットで表
現され、全色空間はR、G、B各方向に256の点を持
つ大きさになる。全色空間の実質上の大きさは一点で持
つ情報の量により変化するが、この実施例では一点に1
ビットの情報を持つので全色空間は256の3乗(約1
670万)ビットとなる。
The image data is represented by 24 bits per pixel, and the entire color space has a size having 256 points in each of the R, G, and B directions. The substantial size of the entire color space varies depending on the amount of information held at one point, but in this embodiment, one point at a point.
Since it has bit information, the total color space is 256 cubed (about 1
6.7 million) bits.

【0020】計測手段12は、全色空間に含まれる画像
コードの数や、原画像で使用されている画像コードを含
む部分色空間の数を計測し、前記画像コードの数や部分
色空間の数が図示せぬパレットの登録可能数より少ない
かどうかを判定する。ここでは、最初に全色空間に含ま
れる画像コードの数を計測し、二回目以降は原画像で使
用されている画像コードを含む部分色空間の数を計測す
るようにしている。
The measuring means 12 measures the number of image codes included in the entire color space and the number of partial color spaces including the image code used in the original image, and measures the number of image codes and the partial color space. It is determined whether the number is smaller than the number of pallets that can be registered (not shown). Here, first, the number of image codes included in the entire color space is measured, and from the second time onward, the number of partial color spaces including the image code used in the original image is measured.

【0021】最初に全色空間に含まれる画像コードの数
を計測したときに、その数が図示せぬパレットの登録可
能数と同じかあるいは少ないときは、分割手段13によ
り全色空間を分割する必要がないので、第1の登録手段
14に処理を移行し、原画像で使用されている画像コー
ドを全てパレットに登録させる。一方、全色空間に含ま
れる画像コードの数がパレットの登録可能数より多いと
きは、分割手段13に処理を移行する。そして、この分
割手段13により分割された部分色空間の数がパレット
の登録可能数より少ないかどうかを判定し、画像コード
を含む部分色空間の数がパレットの登録可能数と同じか
あるいは少ないときは、第1の登録手段14に処理を移
行し、各部分色空間から選出した代表色をパレットに登
録させる。
When the number of image codes included in the entire color space is first measured and the number is equal to or smaller than the registerable number of a palette (not shown), the dividing means 13 divides the entire color space. Since it is not necessary, the processing is transferred to the first registration means 14 and all the image codes used in the original image are registered in the palette. On the other hand, when the number of image codes included in the entire color space is larger than the number of palettes that can be registered, the process moves to the dividing unit 13. Then, it is judged whether or not the number of partial color spaces divided by the dividing means 13 is smaller than the registerable number of palettes. When the number of partial color spaces including the image code is equal to or smaller than the registerable number of palettes. Shifts the processing to the first registration means 14 and registers the representative color selected from each partial color space in the palette.

【0022】なお、計測手段12では、分割手段13に
処理を移行する毎に所定の分割数を指示している。分割
手段13に指示する分割数は、分割を指示する毎に前回
よりも大きな分割数を指示する。
The measuring means 12 gives an instruction for a predetermined number of divisions each time the processing is transferred to the dividing means 13. As the number of divisions to be instructed to the dividing means 13, a larger number of divisions than the previous time is instructed each time division is instructed.

【0023】分割手段13は、前記計測手段12から指
示された所定の分割数に従って、全色空間を複数の部分
色空間に分割する。この分割手段13では、前記計測手
段12から指示された分割数を保持しており、計測手段
12から分割の指示を受けたときは、現在保持している
分割数を新しい数値に変更する。
The dividing means 13 divides the entire color space into a plurality of partial color spaces in accordance with the predetermined division number instructed by the measuring means 12. The dividing unit 13 holds the number of divisions instructed by the measuring unit 12, and when receiving the instruction of division from the measuring unit 12, changes the currently held number of divisions to a new numerical value.

【0024】この実施例では、最初に計測手段12から
指示される分割数はR、G、B各方向「2」であり、全
色空間をR、G、B各方向に128(256/2)に分
割する。次回からは分割数がR、G、B各方向に2倍大
きくなり、分割数はR、G、B各方向「4」となり、全
色空間をR、G、B各方向に64(256/4)に分割
する。このように分割数が段階的に大きくなってゆく
と、全色空間は前回分割された部分色空間の数よりも、
段階的に少ない数の部分色空間に分割されることにな
る。
In this embodiment, the number of divisions first instructed by the measuring means 12 is "2" in each of the R, G, B directions, and the total color space is 128 (256/2 in each of the R, G, B directions). ). From the next time, the number of divisions will be twice as large in each direction of R, G, B, and the number of divisions will be “4” in each direction of R, G, B, and the total color space will be 64 (256/256/256) in each direction of R, G, B. Divide into 4). When the number of divisions gradually increases in this way, the total color space becomes larger than the number of partial color spaces previously divided.
It is divided into a small number of partial color spaces in stages.

【0025】第1の登録手段14は、前記計測手段12
において全色空間に含まれる画像コードの数が図示せぬ
パレットの登録可能数と同じあるいは少ないと判定され
たときは、原画像で使用されている画像コードを全て図
示せぬパレットに登録する。また、前記計測手段12に
おいて画像コードを含む部分色空間の数がパレットの登
録可能数と同じかあるいは少ないと判定されたときは、
各部分色空間の中から代表色となる画像コードを選出
し、パレットに登録する。
The first registration means 14 is the measurement means 12 described above.
When it is determined that the number of image codes included in the entire color space is equal to or smaller than the number of registrants that can be registered in the palette (not shown), all the image codes used in the original image are registered in the palette (not illustrated). When the measuring means 12 determines that the number of partial color spaces including the image code is equal to or smaller than the number of registrants that can be registered in the palette,
An image code as a representative color is selected from each partial color space and registered in the palette.

【0026】この第1の登録手段14での代表色の選出
は、前記分割手段13で分割された各部分色空間を順に
見て、その空間内に原画像で使用されている画像コード
が存在するかどうかを確認し、画像コードが含まれてい
るときには、その部分色空間の中で最も使用頻度の高い
画像コードを代表色として選出するようにしている。た
だし、使用頻度が等しいときには、全色空間における原
点からの距離が遠い画像コードを代表色としている。
The selection of the representative color by the first registration means 14 is performed by sequentially looking at each partial color space divided by the division means 13, and the image code used in the original image exists in the space. If an image code is included, the most frequently used image code in the partial color space is selected as the representative color. However, when the frequencies of use are the same, the image code that is far from the origin in the entire color space is the representative color.

【0027】ヒストグラム作成手段15は、各部分色空
間のヒストグラムを作成する。ここでは、前記第1の登
録手段14により各部分色空間を代表する画像コードが
パレットに登録された後に、パレットの残りのエントリ
に他の画像コードを割り当てる際に使用するヒストグラ
ムを作成する。
The histogram creating means 15 creates a histogram for each partial color space. Here, after the image code representing each partial color space is registered in the palette by the first registration means 14, a histogram used when allocating another image code to the remaining entries of the palette is created.

【0028】第2の登録手段16は、前記第1の登録手
段14で登録されなかったパレットのエントリに画像コ
ードを登録する。ここではヒストグラム作成手段15で
作成されたヒストグラムに比例して、残っているパレッ
トのエントリを各部分色空間に割り当てていく。割り当
てられたエントリには、その部分色空間内での優先順位
に従って画像コードを登録する。この実施例では、部分
色空間内の優先順位は原画像での使用頻度の大きい順と
なっている。
The second registration means 16 registers the image code in the entry of the palette not registered by the first registration means 14. Here, the remaining palette entries are assigned to the respective partial color spaces in proportion to the histogram created by the histogram creating means 15. Image codes are registered in the assigned entries according to the priority order within the partial color space. In this embodiment, the order of priority in the partial color space is the order of the frequency of use in the original image.

【0029】図2は、図1に示した画像処理装置10を
実現するための具体例を示したもので、画像処理機能を
有するパソコンやワークステーションのハードウェア構
成を示している。
FIG. 2 shows a concrete example for realizing the image processing apparatus 10 shown in FIG. 1, and shows a hardware configuration of a personal computer or a workstation having an image processing function.

【0030】ディスプレイ21は、CRTからなるカラ
ー表示装置であり、画面上に各種文書のほか、図形や表
などの画像イメージを表示する。ディスプレイ21での
表示は表示制御部22により制御されている。
The display 21 is a color display device composed of a CRT and displays various documents as well as image images such as figures and tables on the screen. The display on the display 21 is controlled by the display control unit 22.

【0031】キーボード23は、コマンドや文字列など
のデータ入力用の入力装置であり、マウス24から入力
された選択指示内容は、キーボード/マウス制御部25
を通じて後述するプロセッサ部30に送られる。
The keyboard 23 is an input device for inputting data such as commands and character strings, and the selection instruction content input from the mouse 24 is stored in the keyboard / mouse control unit 25.
Through a processor unit 30 described later.

【0032】ハードディスク26は、磁気ディスクなど
の二次記憶装置で構成され、各種データをファイル形式
で格納している。
The hard disk 26 is composed of a secondary storage device such as a magnetic disk, and stores various data in a file format.

【0033】実メモリ27は、RAMなどのメモリ装置
で構成されるバッファ記憶であり、各種プログラムのほ
か、キーボード23およびマウス24から入力された各
種のデータや命令などを一時的に記憶する。
The real memory 27 is a buffer memory composed of a memory device such as a RAM, and temporarily stores various programs and various data and commands input from the keyboard 23 and the mouse 24.

【0034】画像データ記憶メモリ28は、ディスプレ
イ21へ表示される画像データが書き込まれるビットマ
ップメモリであり、後述するイメージスキャナ29で読
み取られたカラー元画像の画像データが蓄積される。
The image data storage memory 28 is a bit map memory in which the image data displayed on the display 21 is written, and the image data of the color original image read by the image scanner 29 described later is accumulated.

【0035】イメージスキャナ29は、対象となるカラ
ー元画像を走査して画像データに変換するイメージ入力
手段である。
The image scanner 29 is image input means for scanning a target color original image and converting it into image data.

【0036】プロセッサ部30は、CPUおよびその周
辺回路により構成される中央処理装置であり、制御プロ
グラムに従って上記各部の動作を制御/管理する。
The processor section 30 is a central processing unit composed of a CPU and its peripheral circuits, and controls / manages the operations of the above sections in accordance with a control program.

【0037】上述した図2の構成において、ハードディ
スク26、イメージスキャナ29およびプロセッサ部3
0は図1の入力手段11の機能を実現している。また、
プロセッサ部30は図1の計測手段12、分割手段1
3、第1の登録手段14、ヒストグラム作成手段15、
第2の登録手段16の機能を実現している。
In the configuration of FIG. 2 described above, the hard disk 26, the image scanner 29 and the processor unit 3
0 implements the function of the input means 11 of FIG. Also,
The processor unit 30 includes the measuring unit 12 and the dividing unit 1 shown in FIG.
3, first registration means 14, histogram creation means 15,
The function of the second registration means 16 is realized.

【0038】次に、上述した画像処理装置10における
パレット作成処理の流れを図3〜図5のフローチャート
を参照しながら説明する。なお、ここではパレットのエ
ントリを256とする。
Next, the flow of the palette creating process in the image processing apparatus 10 described above will be described with reference to the flowcharts of FIGS. Note that here, the entry of the palette is 256.

【0039】このフローチャートはステップAからステ
ップDまでの4つのステップに分けることができる。ス
テップAは画像の読み込みを行い、読み込んだ画像で使
用されている画像コードを全色空間に展開する。ステッ
プBは全色空間の分割であり、全色空間の分割数を段階
的に大きくしていき、画像コードを含む部分色空間の数
がパレットに登録可能な数になるまで分割を行う。ステ
ップCは画像コードの登録であり、分割された部分色空
間内から選出した画像コードをパレットに登録する。こ
のステップCまでがこの発明の特徴的な部分である。ス
テップD以降は登録されなかったパレットのエントリを
各部分色空間に割り当てて、各部分色空間の画像コード
を登録するための処理であり、既存の手法を用いてい
る。
This flowchart can be divided into four steps from step A to step D. In step A, the image is read, and the image code used in the read image is developed in the entire color space. Step B is the division of the entire color space. The division number of the entire color space is gradually increased until the number of partial color spaces including the image code reaches the number that can be registered in the palette. In step C, the image code is registered, and the image code selected from the divided partial color space is registered in the palette. Up to this step C is a characteristic part of the present invention. After step D, the unregistered palette entry is assigned to each partial color space and the image code of each partial color space is registered, and the existing method is used.

【0040】まず、入力手段11において、原画像の画
像データの読み込みと全色空間の初期化を行う(図3の
ステップ101)。続いて、読み込んだ画像データで使
用されている画像コードを全色空間へ展開するととも
に、使用されている画像コードの使用頻度のヒストグラ
ムを作成する(ステップ102、ステップ103)。次
に、計測手段12において、画像データで使用されてい
る画像コードの数を計測し、原画像の全色空間に含まれ
る画像コードの数が256より多いかどうかを判断する
(ステップ104)。ここで、原画像の全色空間に含ま
れる画像コードの数が256と同じかあるいは少なけれ
ば、これを第1の登録手段14に通知する。第1の登録
手段14では、原画像で使用されている画像コード全て
をパレットに登録して(ステップ105)、処理を終了
する。
First, the input means 11 reads the image data of the original image and initializes the entire color space (step 101 in FIG. 3). Then, the image code used in the read image data is expanded to the entire color space, and a histogram of the frequency of use of the used image code is created (steps 102 and 103). Next, the measuring means 12 measures the number of image codes used in the image data, and judges whether the number of image codes included in the entire color space of the original image is larger than 256 (step 104). If the number of image codes included in the entire color space of the original image is equal to or less than 256, the first registration unit 14 is notified of this. The first registration means 14 registers all the image codes used in the original image in the palette (step 105) and ends the process.

【0041】一方、原画像の全色空間に含まれる画像コ
ードの数が256より多いときは、分割手段13に対し
て全色空間の分割を指示する(同時に分割数も指示す
る)。分割手段13では部分色空間の大きさをR、G、
B各方向「2」とし(ステップ106)、全色空間を複
数の部分色空間に分割する(ステップ107)。次に、
計測手段12は前記分割手段13で分割された、原画像
で使用されている画像コードを含む部分色空間の数が2
56より多いかどうかを判断する(ステップ108)。
ここで、画像コードを含む部分色空間の数が256より
多いときは、さらに分割手段13に対して全色空間の分
割を指示する。分割手段13では部分色空間の大きさを
R、G、B各方向に2倍とし(ステップ109)、全色
空間を所定の分割数に従って複数の部分色空間に分割す
る(ステップ107)。
On the other hand, when the number of image codes included in the entire color space of the original image is more than 256, the dividing means 13 is instructed to divide the entire color space (at the same time, the number of divisions is also instructed). The dividing means 13 sets the sizes of the partial color spaces to R, G, and
B Each direction is set to "2" (step 106), and the entire color space is divided into a plurality of partial color spaces (step 107). next,
The measuring unit 12 divides the number of partial color spaces including the image code used in the original image by the dividing unit 13 into two.
It is determined whether the number is more than 56 (step 108).
Here, when the number of partial color spaces including the image code is larger than 256, the dividing unit 13 is further instructed to divide the entire color space. The dividing unit 13 doubles the size of the partial color space in each of the R, G, and B directions (step 109), and divides the entire color space into a plurality of partial color spaces according to a predetermined division number (step 107).

【0042】ステップ108で画像コードを含む部分色
空間の数が256より少なくなったときは、第1の登録
手段14において、注目する(対象とする)部分色空間
を一つ設定し(図4のステップ110)、この注目して
いる部分色空間に原画像で使用されている画像コードが
含まれているかどうかを判断する(ステップ111)。
ここで、部分色空間に画像コードが含まれているとき
は、その部分色空間内で最も使用頻度の高い画像コード
を代表色として選出し(ステップ112)、パレットに
登録する(ステップ113)。そして、注目している部
分色空間が最後の部分色空間でなければ(ステップ11
4)、次の部分色空間を注目する部分色空間として(ス
テップ115)、ステップ111へ戻る。また、ステッ
プ111で注目する部分色空間に画像コードが含まれて
いないときはステップ114へ進む。
When the number of partial color spaces including the image code is less than 256 in step 108, the first registration means 14 sets one target (target) partial color space (see FIG. 4). (Step 110) of step 1), it is determined whether or not the partial color space of interest includes the image code used in the original image (step 111).
Here, when the image code is included in the partial color space, the image code most frequently used in the partial color space is selected as the representative color (step 112) and registered in the palette (step 113). Then, the partial color space of interest is not the final partial color space (step 11
4) Then, the next partial color space is set as the focused partial color space (step 115), and the process returns to step 111. When the image code is not included in the partial color space of interest in step 111, the process proceeds to step 114.

【0043】ステップ114において、注目している部
分色空間が最後の部分色空間と判断されると、各部分色
空間を代表する画像コードが全てパレットに登録された
ことになる。
When it is determined in step 114 that the partial color space of interest is the last partial color space, it means that all image codes representing each partial color space have been registered in the palette.

【0044】ステップ106からステップ114までの
処理を経ることにより、原画像で使用されている画像コ
ードを含む部分色空間については、その部分色空間に含
まれている画像コードの少なくとも一つが代表色として
パレットに登録されることになる。したがって、ここま
での処理で得られたパレットを使用することにより、こ
の実施例の画像処理装置による必要最低限の品質の表示
が可能となる。しかしながら、これ以降の処理におい
て、登録されなかったパレットのエントリを各部分色空
間に割り当てて、各部分色空間の画像コードを登録する
処理を行うことにより、原画像により近い品質の表示を
行うことが可能となる。
By performing the processing from step 106 to step 114, with respect to the partial color space including the image code used in the original image, at least one of the image codes included in the partial color space is the representative color. Will be registered in the palette. Therefore, by using the palette obtained by the processing up to this point, it is possible to display the minimum necessary quality by the image processing apparatus of this embodiment. However, in the subsequent processing, the unregistered palette entry is assigned to each partial color space and the image code of each partial color space is registered to display a quality closer to the original image. Is possible.

【0045】まず、ヒストグラム作成手段15におい
て、部分色空間毎のヒストグラムを作成する(ステップ
116)。そして、第2の登録手段16において、ヒス
トグラム作成手段15で作成されたヒストグラムに比例
して、残っているパレットのエントリを各部分色空間に
割り当てる(ステップ117)。次に、注目する部分色
空間を設定し(ステップ図5の118)、この注目して
いる部分色空間に残りのパレットが割り当てられている
かどうかを判断する(ステップ119)。ここで、部分
色空間が残りのパレットに割り当てられているときは、
注目している部分色空間内の画像コードに使用頻度に応
じて優先順位をつけ(ステップ120)、この優先順位
を元にして、割り当てられたエントリの数だけ画像コー
ドを登録する(ステップ121)。そして、注目してい
る部分色空間が最後の部分色空間であれば処理を終了し
(ステップ122)、最後の部分色空間でなければ、次
の部分色空間を注目する部分色空間として(ステップ1
23)、ステップ119へ戻る。また、ステップ119
で注目する部分色空間に画像コードが含まれていないと
きはステップ122へ進む。
First, the histogram creating means 15 creates a histogram for each partial color space (step 116). Then, the second registration means 16 allocates the remaining palette entries to each partial color space in proportion to the histogram created by the histogram creation means 15 (step 117). Next, the partial color space of interest is set (118 in FIG. 5), and it is determined whether or not the remaining palette is assigned to this partial color space of interest (step 119). Here, when the partial color space is assigned to the rest of the palette,
Image codes in the partial color space of interest are prioritized according to the frequency of use (step 120), and based on this priority, image codes are registered by the number of allocated entries (step 121). . Then, if the partial color space of interest is the final partial color space, the process is terminated (step 122). If it is not the final partial color space, the next partial color space is set as the partial color space of interest (step 122). 1
23) and returns to step 119. In addition, step 119
If the partial color space of interest does not include an image code, the process proceeds to step 122.

【0046】次に、上述したフローチャートによるパレ
ット作成処理の具体例を図6を参照しながら説明する。
以後の説明において、原画像は各画素24ビットのデー
タで表されるフルカラーであり、パレットのエントリは
256とする。また、RGBによる全色空間はメモリ空
間内の一点を1ビットに対応させて表現し、フルカラー
のRGBによる全色空間はR、G、B各方向に256の
座標点(以下、点という)を有する。さらに、ヒストグ
ラムは画像コードとその使用頻度が対になるか、部分色
空間を示すコードとその部分色空間に含まれる原画像が
使用している画像コードの数が対になってメモリ空間に
表現される。
Next, a specific example of the pallet creating process according to the above-mentioned flowchart will be described with reference to FIG.
In the following description, the original image is a full color represented by 24-bit data for each pixel, and the palette entry is 256. In addition, the RGB full color space represents one point in the memory space in correspondence with 1 bit, and the full color RGB full color space has 256 coordinate points (hereinafter referred to as points) in the R, G, and B directions. Have. Furthermore, the histogram is expressed in the memory space as a pair of the image code and the frequency of use, or a pair of the code indicating the partial color space and the number of image codes used by the original image included in the partial color space. To be done.

【0047】まず、フルカラーの全色空間を用意し、各
座標点に0を設定する。この全色空間には、原画像が使
用できる全ての画像コードと対応した点が存在してい
る。「0」はその点の画像コードが原画像で使用されて
いない状態を表し、「1」はその点の画像コードが原画
像で使用されていることを示す。ここでは初期化のため
に全ての点に0を設定している。
First, a full color full color space is prepared, and 0 is set at each coordinate point. In this all-color space, there are points corresponding to all the image codes that can be used for the original image. "0" indicates that the image code at that point is not used in the original image, and "1" indicates that the image code at that point is used in the original image. Here, 0 is set to all points for initialization.

【0048】次に、に示すような原画像を入力して、
フルカラーの画像データとする。続いて、に示すよう
に原画像で使用されている画像コードを調べ、その画像
コードに対応する点の値を1に変更していく。このと
き、原画像で使用されている画像コードがヒストグラム
に登録されているかどうかを判別し、登録されていなけ
れば登録して使用頻度を1とし、また登録されていれば
使用頻度に1を加える。この処理を原画像の各画素につ
いて行うことにより、原画像で使用されている画像コー
ドが分布している全色空間とその画像コードの使用頻度
のヒストグラムが作成されることになる。このヒストグ
ラムは分割された部分色空間に含まれる画像コードの中
から、最も使用頻度の高い画像コードを選出する際に使
用する。ここまでが図3のステップAに相当する。
Next, input an original image as shown in,
Use full-color image data. Subsequently, as shown in, the image code used in the original image is checked, and the value of the point corresponding to the image code is changed to 1. At this time, it is determined whether or not the image code used in the original image is registered in the histogram. If it is not registered, it is registered and the usage frequency is set to 1. If it is registered, 1 is added to the usage frequency. . By performing this process for each pixel of the original image, a histogram of the entire color space in which the image code used in the original image is distributed and the frequency of use of the image code is created. This histogram is used when selecting the image code most frequently used from the image codes included in the divided partial color space. Up to this point corresponds to step A in FIG.

【0049】次に、作成された全色空間内で1となって
いる点の数から、原画像で使用されている画像コードの
数を計測する。この結果、使用されている画像コードの
数が256以下であれば、使用されている画像コードを
全てパレットに登録してパレット作成を終了する。一
方、使用されている画像コードの数が256を越える場
合は、全色空間を分割する。分割方法としては、まず、
部分色空間の分割数をR、G、B各方向にそれぞれ
「2」とし、に示すように全色空間をR、G、B各方
向に128分割する。そして、分割された各部分色空間
を調べ、空間内に1になっている点が含まれているかど
うかを判別する。ここで、「1」の点が含まれている場
合は、その部分色空間を「1」とし、含まれていない場
合は「0」とする。次に、「1」になっている(画像コ
ードを含んでいる)部分色空間の個数を計測する。その
結果、「1」になっている部分色空間の数が256を越
える場合は、部分色空間の分割数をR、G、B各方向に
それぞれ「4」とし、に示すように全色空間をR、
G、B各方向に64分割する。再び「1」になっている
部分色空間の個数を計測して、その数が256を越えた
かどうかを判別する。このようにして、「1」になって
いる点を含む部分色空間の数が256以下になるまで全
色空間を段階的に分割していく。ここまでが図3のステ
ップBに相当する。
Next, the number of image codes used in the original image is measured from the number of points that are 1 in the created entire color space. As a result, if the number of used image codes is 256 or less, all the used image codes are registered in the palette and the palette creation is completed. On the other hand, when the number of image codes used exceeds 256, the entire color space is divided. As a dividing method, first,
The number of divisions of the partial color space is set to “2” in the R, G, and B directions, respectively, and the entire color space is divided into 128 in the R, G, and B directions, as shown in. Then, each of the divided partial color spaces is examined, and it is determined whether or not a point having a value of 1 is included in the space. Here, when the point of "1" is included, the partial color space is set to "1", and when not included, it is set to "0". Next, the number of partial color spaces that are "1" (including the image code) is measured. As a result, when the number of partial color spaces that are "1" exceeds 256, the number of divisions of the partial color spaces is set to "4" in each of the R, G, and B directions, and as shown in R,
It is divided into 64 in each of the G and B directions. The number of partial color spaces that are "1" again is measured, and it is determined whether or not the number exceeds 256. In this way, the entire color space is divided stepwise until the number of partial color spaces including the point of "1" becomes 256 or less. The process up to this point corresponds to step B in FIG.

【0050】さて、「1」になっている点を含む部分色
空間の数が256以下になったところで、に示すよ
うに、各部分色空間内に含まれる画像コードのうち、最
も使用頻度の高い画像コードをヒストグラムにより選出
してパレットに登録する。ただし、最も使用頻度が高い
画像コードが複数存在する場合は、各部分色空間におい
て、原点からの距離が最も遠い画像コードをパレットに
登録する。この処理を「1」になっている部分色空間全
てについて実施することで、原画像で使用されている画
像コードを含む部分色空間については、その部分色空間
に含まれている画像コードの少なくとも一つが代表色と
してパレットに登録されることになる。次に、パレット
の残りのエントリ数を計算し、残りエントリ数が0のと
きはパレット作成を終了する。残り画像コードが1以上
あるときは、各部分色空間において、すでにパレットに
登録された画像コードを除いて、原画像で使用されてい
る画像コードの数を計測して、ヒストグラムを作成す
る。作成されたヒストグラムを用い、各部分色空間内の
原画像で使用されている画像コードの数に応じて、パレ
ットの残りのエントリを割り当てていく。次に、各部分
色空間に割り当てられた画像コードの数だけパレットに
登録する。この場合は、ヒストグラムで2番目に使用頻
度の高い画像コードから順にパレットに登録していく。
Now, when the number of partial color spaces including the point which is "1" becomes 256 or less, as shown in, the most frequently used image code among the image codes contained in each partial color space. Select a high image code from the histogram and register it in the palette. However, when there are a plurality of image codes that are used most frequently, the image code that is the farthest from the origin in each partial color space is registered in the palette. By performing this process for all the partial color spaces that are "1", at least for the partial color space including the image code used in the original image, at least the image code included in the partial color space is used. One will be registered in the palette as a representative color. Next, the number of remaining entries in the palette is calculated, and when the number of remaining entries is 0, the palette creation is completed. When there are one or more remaining image codes, the number of image codes used in the original image is measured in each partial color space, excluding the image codes already registered in the palette, to create a histogram. Using the created histogram, the remaining entries in the palette are allocated according to the number of image codes used in the original image in each partial color space. Next, the number of image codes assigned to each partial color space is registered in the palette. In this case, the image codes that are most frequently used in the histogram are registered in the palette in order.

【0051】上述した実施例の画像処理装置によれば、
使用頻度の低い画像コードが無視される欠点を解消する
ことができる。例えば画像のほとんどが青系の色で、そ
の中に小領域の赤系の色が存在する画像の場合、使用頻
度の高い画像コードからパレットに登録していく従来方
法、および特開平4−257984号の画像出力装置と
もに、パレットには青系の色のみを登録してしまうた
め、実際に表示したときには、赤系の色で表現されるべ
き画素が青系の色に表現されてしまう。これに対して本
実施例の画像処理装置では、全色空間を分割する過程に
おいて、使用頻度が1になっている部分色空間について
は、その空間に意味があるものとして、その中から代表
色となる画像コードを選出するようにしているため、原
画像で使用されている画像コードを含む部分色空間につ
いては、その部分色空間に含まれている画像コードの少
なくとも一つはパレットに登録されていることになる。
したがって、赤系の色はその画像コードが含まれている
部分色空間からパレットに登録された画像コードにより
表現されるため、従来のように大きく異なる色で表現さ
れることはなく、ある程度本来の色に類似した色で表示
されることになる。
According to the image processing apparatus of the above embodiment,
It is possible to eliminate the drawback that image codes that are not frequently used are ignored. For example, in the case of an image in which most of the images are bluish colors and a reddish color of a small area is present in them, a conventional method of registering a palette from a frequently used image code, and JP-A-4-257984. In both the image output devices of No. 1 and No. 2, only the bluish colors are registered in the palette, and therefore when actually displayed, the pixels that should be represented by the reddish colors are represented by the bluish colors. On the other hand, in the image processing apparatus according to the present embodiment, in the process of dividing the entire color space, the partial color space having the usage frequency of 1 is regarded as having a meaning in that space, and the representative color Since the image code to be used is selected, for a partial color space that includes the image code used in the original image, at least one of the image codes included in that partial color space is registered in the palette. Will be.
Therefore, since reddish colors are represented by the image code registered in the palette from the partial color space containing the image code, they are not represented by significantly different colors as in the past, but rather to the original It will be displayed in a color similar to the color.

【0052】この実施例では、全色空間の分割は最大6
回行われることになり、そのときの部分色空間一つの大
きさはR、G、B各方向「64」となる。このときに原
画像で使用されている画像コードとパレットに登録され
ている画像コードが最も大きく離れると、R、G、B各
方向に63離れることになる。これは、最も明るい純粋
な赤(R成分:255、G成分:0、B成分:0)に対
し、最も離れた画像コードでも少し水色かかった赤(R
成分:192、G成分:63、B成分:63)であり、
赤系の色が他の系統の色で表現されることはない。
In this embodiment, the maximum color space division is 6 at maximum.
The size of one partial color space at that time is “64” in each of the R, G, and B directions. At this time, when the image code used in the original image and the image code registered in the pallet are separated by the largest amount, they are separated by 63 in the R, G, and B directions. This is because the brightest pure red (R component: 255, G component: 0, B component: 0) is slightly light blue even at the farthest image code (R component:
Component: 192, G component: 63, B component: 63),
Reddish colors are not represented by other colors.

【0053】上述した実施例のステップDでは、登録さ
れなかったパレットの残りのエントリへ画像コードを登
録する際に、画像コードの使用頻度によるヒストグラム
を部分色空間毎に作成し、このヒストグラムの使用頻度
に応じた優先順位を元にして画像コードを登録するよう
にしている。しかし、残りのエントリへの画像コードの
登録はこの方法だけでなく、他の方法も適用することが
できる。例えば、部分色空間に含まれる画像コードの使
用頻度の合計によるヒストグラムを作成し、このヒスト
グラムの使用頻度に応じた優先順位を元にして画像コー
ドを登録するようにしてもよい。
In the step D of the above-described embodiment, when the image code is registered in the remaining entries of the unregistered palette, a histogram according to the frequency of use of the image code is created for each partial color space, and this histogram is used. The image code is registered based on the priority order according to the frequency. However, the registration of the image code in the remaining entries is not limited to this method, and other methods can be applied. For example, a histogram may be created based on the total usage frequency of the image codes included in the partial color space, and the image codes may be registered based on the priority order according to the usage frequency of the histogram.

【0054】また、部分色空間の特徴を考慮してヒスト
グラムを作成することもできる。例えば、ある部分色空
間に含まれる原画像に使用されている画像コードは、部
分色空間のある一点に集中している場合もあれば、部分
色空間内に均等に存在する場合もある。そのような特徴
を用い、部分色空間に含まれる原画像に使用されている
画像コードそれぞれの距離の合計を使用してヒストグラ
ムを作成することもできる。
It is also possible to create a histogram in consideration of the characteristics of the partial color space. For example, the image code used for the original image included in a certain partial color space may be concentrated on a certain point in the partial color space, or may be evenly present in the partial color space. With such a feature, the histogram can be created by using the sum of the distances of the respective image codes used in the original image included in the partial color space.

【0055】さらに、上記実施例では、RGBの三原色
で表現される全色空間を用いているが、他の色空間を用
いることもできる。この場合も、ステップDにおけるパ
レットの残りのエントリへの画像コードの登録方法を用
いることが可能である。
Furthermore, in the above embodiment, the entire color space represented by the three primary colors of RGB is used, but other color spaces can be used. Also in this case, the method of registering the image code in the remaining entries of the palette in step D can be used.

【0056】[0056]

【発明の効果】第1の発明に係わる画像処理装置によれ
ば、全色空間を複数の部分色空間に分割する際に、その
部分色空間の数がパレット登録可能数以下となるまで分
割を行い、分割された各部分色空間から代表色を選出し
てパレットに登録するようにしたため、原画像で使用さ
れている色を含む部分色空間からは、少なくとも一つの
色が代表色としてパレットに登録されることになる。し
たがって、画像のほとんどが青系の色で、その中に小領
域の赤系の色が存在する場合でも、小領域の赤系の色
は、その色が含まれている部分色空間からパレットに登
録された代表色により表現されるので、従来のように大
きく異なる色で表現されることはなく、ある程度本来の
色に類似した色で表示することが可能となる。また、原
画像で使用している画像コードが部分色空間の一つにす
べて入ってしまうような場合は、分割の初期の段階で部
分色空間内に含まれる画像コードが全てパレットに登録
されることになるため、従来のように無駄な部分色空間
を作成することがないので、計算時間を短縮することが
できる。
According to the image processing apparatus of the first invention, when the entire color space is divided into a plurality of partial color spaces, the division is performed until the number of the partial color spaces becomes equal to or smaller than the number that can be registered in the palette. Since the representative color is selected from each of the divided partial color spaces and registered in the palette, at least one color is selected as the representative color from the partial color space containing the colors used in the original image. It will be registered. Therefore, even if most of the image is bluish and there is a small area reddish color in it, the small area reddish color is transferred from the partial color space containing that color to the palette. Since it is represented by the registered representative color, it is possible to display with a color that is similar to the original color to some extent, without being represented with a color that is significantly different from the conventional one. If all the image codes used in the original image are in one of the partial color spaces, all the image codes included in the partial color space will be registered in the palette at the initial stage of division. Therefore, unlike the conventional case, a wasteful partial color space is not created, and the calculation time can be shortened.

【0057】第2の発明に係わる画像処理装置によれ
ば、分割された部分空間の代表色を決定する際に、各部
分色空間内に原画像で使用されている画像コードが存在
するかどうかを確認するようにしているため、原画像で
使用されている画像コードを含まない部分色空間では代
表色の選出は行われないことになるので、処理時間を短
縮することができる。
According to the image processing apparatus of the second aspect of the present invention, when determining the representative color of the divided partial space, whether or not the image code used in the original image exists in each partial color space. Therefore, since the representative color is not selected in the partial color space that does not include the image code used in the original image, the processing time can be shortened.

【0058】第3の発明に係わる画像処理装置によれ
ば、分割された部分色空間に含まれる画像コードのう
ち、最も使用頻度の高い画像コードを代表色として選出
するようにし、また使用頻度の高い画像コードが複数存
在するときには、全色空間における原点からの距離が最
も遠い画像コードを代表色として選出するようにしたた
め、原画像の画像コードの分布に適した表示を行うこと
ができる。
According to the image processing apparatus of the third aspect of the present invention, of the image codes included in the divided partial color space, the image code with the highest frequency of use is selected as the representative color and the frequency of use is determined. When there are a plurality of high image codes, the image code having the longest distance from the origin in the entire color space is selected as the representative color, so that the display suitable for the distribution of the image code of the original image can be performed.

【0059】第4の発明に係わる画像処理装置によれ
ば、全色空間の分割数を変更する際には、前回よりも大
きな分割数に変更するようにしたため、分割する毎に部
分色空間の数は少なくなり、全色空間内に存在する原画
像で使用されている画像コードの数も段階的に少なくす
ることができる。
According to the image processing apparatus of the fourth aspect of the present invention, when changing the division number of the entire color space, the division number is changed to a larger division number than the previous time. The number is reduced, and the number of image codes used in the original image existing in the entire color space can be reduced in stages.

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

【図1】実施例における画像処理装置の機能的な構成を
表すブロック図。
FIG. 1 is a block diagram showing a functional configuration of an image processing apparatus according to an embodiment.

【図2】図1に示した画像処理装置を実現するための具
体例を示す構成図。
FIG. 2 is a configuration diagram showing a specific example for realizing the image processing apparatus shown in FIG.

【図3】パレット作成処理の流れを示すフローチャー
ト。
FIG. 3 is a flowchart showing the flow of palette creation processing.

【図4】パレット作成処理の流れを示すフローチャー
ト。
FIG. 4 is a flowchart showing a flow of palette creation processing.

【図5】パレット作成処理の流れを示すフローチャー
ト。
FIG. 5 is a flowchart showing a flow of palette creation processing.

【図6】パレット作成処理の具体例を示す説明図。FIG. 6 is an explanatory diagram showing a specific example of palette creation processing.

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

10…画像処理装置、11…入力手段、12…計測手
段、13…分割手段、14…第1の登録手段、15…ヒ
ストグラム作成手段、16…第2の登録手段
10 ... Image processing apparatus, 11 ... Input means, 12 ... Measuring means, 13 ... Dividing means, 14 ... First registration means, 15 ... Histogram creating means, 16 ... Second registration means

Claims (4)

【特許請求の範囲】[Claims] 【請求項1】 カラー原画像より得られた全色空間を所
定の分割数に従って複数の部分色空間に分割する分割手
段と、 前記分割手段で分割された部分色空間の数がパレット登
録可能数より少ないかどうかを判定する判定手段と、 前記分割手段により分割された部分色空間の代表色を決
定する決定手段と、 前記判定手段において部分色空間の数がパレット登録可
能数と同じあるいは少ないと判定されたときは、前記決
定手段で決定された代表色をパレットに登録する登録手
段と、 前記判定手段において部分色空間の数がパレット登録可
能数より多いと判定されたときは、前記分割手段での分
割数を前回とは異なる分割数に変更する変更手段と、 を備え、部分色空間の数がパレット登録可能数と同じあ
るいは少ないと判定されるまで前記分割手段での分割を
行うことを特徴とする画像処理装置。
1. A dividing unit that divides an entire color space obtained from a color original image into a plurality of partial color spaces according to a predetermined dividing number, and the number of partial color spaces divided by the dividing unit is the number that can be registered in a palette. Determining means for determining whether the number is smaller, determining means for determining a representative color of the partial color space divided by the dividing means, and if the number of partial color spaces in the determining means is equal to or smaller than the number of palette registration possible When determined, the registration unit that registers the representative color determined by the determination unit in the palette; and when the determination unit determines that the number of partial color spaces is larger than the palette registerable number, the dividing unit Change means for changing the number of divisions in step 1 to a number of divisions different from the previous time, and the number of partial color spaces is the same as or smaller than the number that can be registered in the palette. The image processing apparatus characterized by performing cleavage with.
【請求項2】 前記決定手段は、分割された各部分色空
間内に原画像で使用されている画像コードが存在するか
どうかを確認するための確認手段を備えることを特徴と
する請求項1記載の画像処理装置。
2. The determining means comprises a confirming means for confirming whether or not an image code used in an original image exists in each of the divided partial color spaces. The image processing device described.
【請求項3】 前記決定手段は、各部分色空間に含まれ
る画像コードのうち、最も使用頻度の高い画像コードを
代表色とし、また前記使用頻度が等しいときは、全色空
間における原点からの距離が最も遠い画像コードを代表
色とすることを特徴とする請求項1記載の画像処理装
置。
3. The determining means sets the image code having the highest frequency of use among the image codes included in each partial color space as a representative color, and when the frequency of use is equal, the determining means determines from the origin in the entire color space. The image processing apparatus according to claim 1, wherein the image code having the longest distance is used as a representative color.
【請求項4】 前記変更手段は、前記分割手段の分割数
を、前回よりも大きな分割数に変更することを特徴とす
る請求項1記載の画像処理装置。
4. The image processing apparatus according to claim 1, wherein the changing unit changes the number of divisions of the dividing unit to a larger number of divisions than the last time.
JP7180263A 1995-07-17 1995-07-17 Image processing device Pending JPH0934429A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP7180263A JPH0934429A (en) 1995-07-17 1995-07-17 Image processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP7180263A JPH0934429A (en) 1995-07-17 1995-07-17 Image processing device

Publications (1)

Publication Number Publication Date
JPH0934429A true JPH0934429A (en) 1997-02-07

Family

ID=16080197

Family Applications (1)

Application Number Title Priority Date Filing Date
JP7180263A Pending JPH0934429A (en) 1995-07-17 1995-07-17 Image processing device

Country Status (1)

Country Link
JP (1) JPH0934429A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010250726A (en) * 2009-04-20 2010-11-04 Fujifilm Corp Color-image representative color decision apparatus, and method of controlling operation thereof

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010250726A (en) * 2009-04-20 2010-11-04 Fujifilm Corp Color-image representative color decision apparatus, and method of controlling operation thereof

Similar Documents

Publication Publication Date Title
US6518981B2 (en) Generating and using a color palette
US6927874B1 (en) Image processing method, apparatus and storage medium therefor
US6411730B1 (en) Histogram for generating a palette of colors
US5412766A (en) Data processing method and apparatus for converting color image data to non-linear palette
JPH087553B2 (en) Color image quantization method and apparatus
US6731789B1 (en) Image processing apparatus and method, and storage medium
US6466333B2 (en) Streamlined tetrahedral interpolation
US6693644B1 (en) Graphic accelerator reducing and processing graphics data
US6621498B1 (en) High-speed non-separable color table lookup
JPH0934429A (en) Image processing device
US5768569A (en) Processing data for an image displayed on a computer controlled display system
CN112330768A (en) Image rapid synthesis method based on data characteristics
US6172714B1 (en) Color adjustment table system for YUV to RGB color conversion
US6919898B2 (en) Method and apparatus for ascertaining and selectively requesting displayed data in a computer graphics system
US7106345B2 (en) Mechanism for color-space neutral (video) effects scripting engine
JP3648778B2 (en) Image processing device
EP0177058A2 (en) A method and a device for calculating a histogram
US20030038804A1 (en) Fast drawing method and apparatus for large picture data
JPH08315134A (en) Image processor
JPH0329059A (en) Method and equipment for processing image
JPH09218675A (en) Display control device and method therefor
JPH08202327A (en) Image processor
JPH04175885A (en) Picture feature selecting system for generalized hough transformation
JPH10164377A (en) Color number reduction processor
JPH0721346A (en) Limited color display procession method in image processing