JP2012134807A - Image processing device, and image processing method - Google Patents

Image processing device, and image processing method Download PDF

Info

Publication number
JP2012134807A
JP2012134807A JP2010285755A JP2010285755A JP2012134807A JP 2012134807 A JP2012134807 A JP 2012134807A JP 2010285755 A JP2010285755 A JP 2010285755A JP 2010285755 A JP2010285755 A JP 2010285755A JP 2012134807 A JP2012134807 A JP 2012134807A
Authority
JP
Japan
Prior art keywords
color
image
representative
information
compressed data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2010285755A
Other languages
Japanese (ja)
Other versions
JP5549937B2 (en
Inventor
Shinya Asakura
眞也 朝倉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Konica Minolta Business Technologies Inc
Original Assignee
Konica Minolta Business Technologies Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Konica Minolta Business Technologies Inc filed Critical Konica Minolta Business Technologies Inc
Priority to JP2010285755A priority Critical patent/JP5549937B2/en
Publication of JP2012134807A publication Critical patent/JP2012134807A/en
Application granted granted Critical
Publication of JP5549937B2 publication Critical patent/JP5549937B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

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

Abstract

PROBLEM TO BE SOLVED: To compress an image so as to secure reproducibility of colors without using an original image even when the number of colors used is more than the number of predetermined representative colors.SOLUTION: When compressing an image using a representative color compressing method, the number of the representative colors extracted in each block are compared with the number of the predetermined representative colors, color reduction information is produced for prescribed blocks where the number of extracted representative colors exceeds the number of the representative colors to reversibly compress the image and count the number of the prescribed blocks by a first counter, and when the count value of the first counter exceeds a predetermined count threshold, the size of the color reduction information is compared with a predetermined size threshold, when the size of the color reduction information is not more than the size threshold, the compressed data of the image and reversibly compressed color reduction information are output. When expanding the image, after the compressed data of the image and the reversibly compressed color reduction information are expanded, the color of a prescribed pixel in the prescribed block is replaced with the original color to restore the image.

Description

本発明は、画像処理装置及び画像処理方法に関し、特に、代表色に置き換えることによって画像を圧縮する画像処理装置及び当該画像処理装置における画像処理方法に関する。   The present invention relates to an image processing apparatus and an image processing method, and more particularly to an image processing apparatus that compresses an image by replacing it with a representative color, and an image processing method in the image processing apparatus.

画像を特定のブロックに分割して、ブロック毎に代表的な色(代表色と呼ぶ。)を抽出して、ブロック内の各ピクセルの色を抽出した代表色のいずれかに置き換えるという方式は、一般的な画像の圧縮方法として知られている。   The method of dividing an image into specific blocks, extracting a representative color (referred to as a representative color) for each block, and replacing the color of each pixel in the block with one of the extracted representative colors is as follows: It is known as a general image compression method.

通常、この方式では、一定のブロック内の代表色の色数は固定として制御する。これは代表色に置き換えた後の各ブロックのサイズを一定にするためであり、ブロックサイズを一定にすることにより、圧縮後のサイズが固定になり、任意の領域に対してアドレス計算が可能になり、画像回転、裏面用上下反転出力等の制御が比較的容易に実現できる、というメリットが得られる。   Normally, in this method, the number of representative colors in a certain block is controlled to be fixed. This is to keep the size of each block after replacement with the representative color constant. By making the block size constant, the size after compression becomes fixed, and address calculation can be performed for an arbitrary area. Thus, it is possible to obtain a merit that the control of the image rotation, the upside-down reverse output, etc. can be realized relatively easily.

このような画像の圧縮方法に関して、例えば、下記特許文献1には、ドット毎に色データを有する画像データに対して圧縮及び伸長を行う画像処理装置において、前記画像データから、所定領域内のドット群の色数を検出し、前記検出された色数が第1の色数の時に、当該所定領域のドット群の画像データを可逆圧縮方式で圧縮、伸長し、前記検出された色数が前記第1の色数よりも多い第2の色数の時に、当該所定領域のドット群の画像データを非可逆圧縮方式で圧縮、伸長する技術が開示されている。   With regard to such an image compression method, for example, in Patent Document 1 below, in an image processing apparatus that compresses and decompresses image data having color data for each dot, dots within a predetermined region are obtained from the image data. When the number of colors of the group is detected and the detected number of colors is the first number of colors, the image data of the dot group in the predetermined area is compressed and expanded by a lossless compression method, and the detected number of colors is A technique is disclosed that compresses and expands image data of a dot group in the predetermined area by an irreversible compression method when the second number of colors is larger than the first number of colors.

特開2000−333017号公報JP 2000-333017 A

ここで、ブロック内の代表色をN色に固定した場合、ブロック内で使用されている色数がN色以下の場合は正確に色を再現することができるが、ブロック内で使用されている色数がN色よりも多い場合、代表色として選択されなかった色は、代表色Nのうちのどれかに書き換えられる(減色処理が発生する)ことになり、結果的に色の再現性が犠牲になってしまう。   Here, when the representative color in the block is fixed to N colors, the color can be accurately reproduced when the number of colors used in the block is N or less, but it is used in the block. When the number of colors is greater than N, the color that has not been selected as the representative color is rewritten to one of the representative colors N (color reduction processing occurs), resulting in color reproducibility. It will be sacrificed.

色の再現性を確保するためには、実際に使用されている色数に応じて代表色数Nを設定する必要があるが、圧縮対象となる画像内に、減色が発生するブロックがどの程度存在するかは、実際に圧縮処理を行ってみなくては分からない。そのため、減色が発生したブロックの数によっては、代表色数Nの値を変更して再度圧縮処理を行わなければならず、その結果、圧縮処理が完了するまで圧縮対象となる元の画像を保持しなければならなくなり、メモリを占有してしまう。   In order to ensure color reproducibility, it is necessary to set the number of representative colors N according to the number of colors actually used. How many blocks in the image to be compressed have reduced color? Whether it exists or not cannot be known without actually performing compression processing. Therefore, depending on the number of blocks where color reduction has occurred, the value of the representative color number N must be changed and the compression process must be performed again. As a result, the original image to be compressed is retained until the compression process is completed. Will have to do and will take up memory.

本発明は、上記問題点に鑑みてなされたものであって、その主たる目的は、使用されている色の数が予め定めた代表色数より多い場合であっても、元の画像を使用することなく、色の再現性を確保できるように画像を圧縮することができる画像処理装置及び画像処理方法を提供することにある。   The present invention has been made in view of the above problems, and its main purpose is to use an original image even when the number of colors used is larger than a predetermined number of representative colors. It is another object of the present invention to provide an image processing apparatus and an image processing method capable of compressing an image so as to ensure color reproducibility.

上記目的を達成するため、本発明は、処理対象の画像を複数の領域に分割し、分割した領域毎に代表色を抽出し、領域内の各ピクセルを、抽出した代表色のいずれかに割り当てて圧縮する画像圧縮方式を用いて、前記画像を圧縮して圧縮データを生成する圧縮部と、前記圧縮データを伸張して出力画像を生成する伸張部と、を備える画像処理装置において、前記圧縮部は、前記画像を圧縮する際に、各々の領域で抽出した代表色の数と予め定めた代表色数とを比較し、前記抽出した代表色の数が前記代表色数を超える所定の領域に対して、前記所定の領域を特定する情報と、前記抽出した代表色から外れた色の所定のピクセルを特定する情報と、前記所定のピクセルの元の色を特定する情報と、を含む減色情報を生成して可逆圧縮すると共に、前記所定の領域の数を第1のカウンタでカウントし、前記第1のカウンタのカウント値が予め定めたカウント閾値を超える場合は、前記減色情報のサイズと予め定めたサイズ閾値とを比較し、前記減色情報のサイズが前記サイズ閾値以下の場合は、前記画像の圧縮データと可逆圧縮した減色情報とを出力し、前記伸張部は、前記画像の圧縮データと前記可逆圧縮した減色情報とを伸張した後、前記所定の領域の前記所定のピクセルの色を前記元の色に置き換えて前記画像を復元するものである。   To achieve the above object, the present invention divides an image to be processed into a plurality of areas, extracts representative colors for each divided area, and assigns each pixel in the area to one of the extracted representative colors. An image processing apparatus comprising: a compression unit that compresses the image to generate compressed data using an image compression method that compresses the image; and a decompression unit that decompresses the compressed data to generate an output image. When compressing the image, the unit compares the number of representative colors extracted in each region with a predetermined number of representative colors, and the predetermined number of regions where the number of extracted representative colors exceeds the number of representative colors In contrast, the subtractive color includes information for specifying the predetermined area, information for specifying a predetermined pixel of a color deviating from the extracted representative color, and information for specifying an original color of the predetermined pixel Generate information and reversibly compress it The number of the predetermined area is counted by a first counter, and when the count value of the first counter exceeds a predetermined count threshold, the size of the color reduction information is compared with a predetermined size threshold, When the size of the color reduction information is equal to or smaller than the size threshold, the compressed data of the image and the losslessly compressed color reduction information are output, and the decompression unit decompresses the compressed data of the image and the losslessly compressed color reduction information. Then, the image is restored by replacing the color of the predetermined pixel in the predetermined area with the original color.

また、本発明は、処理対象の画像を複数の領域に分割し、分割した領域毎に代表色を抽出し、領域内の各ピクセルを、抽出した代表色のいずれかに割り当てて圧縮する画像圧縮方式を用いて、前記画像を圧縮して圧縮データを生成し、前記圧縮データを伸張して出力画像を生成する装置における画像処理方法であって、前記画像を圧縮する際に、各々の領域で抽出した代表色の数と予め定めた代表色数とを比較し、前記抽出した代表色の数が前記代表色数を超える所定の領域に対して、前記所定の領域を特定する情報と、前記抽出した代表色から外れた色の所定のピクセルを特定する情報と、前記所定のピクセルの元の色を特定する情報と、を含む減色情報を生成して可逆圧縮すると共に、前記所定の領域の数を第1のカウンタでカウントする第1の処理と、前記第1のカウンタのカウント値が予め定めたカウント閾値を超える場合は、前記減色情報のサイズと予め定めたサイズ閾値とを比較し、前記減色情報のサイズが前記サイズ閾値以下の場合は、前記画像の圧縮データと可逆圧縮した減色情報とを出力する第2の処理と、前記画像の圧縮データと前記可逆圧縮した減色情報とを伸張した後、前記所定の領域の前記所定のピクセルの色を前記元の色に置き換えて前記画像を復元する第3の処理と、を実行するものである。   Further, the present invention divides an image to be processed into a plurality of areas, extracts representative colors for each divided area, and assigns each pixel in the area to one of the extracted representative colors for compression. An image processing method in an apparatus for generating compressed data by compressing the image using a method, and generating an output image by decompressing the compressed data, wherein each area is compressed when the image is compressed. Comparing the number of extracted representative colors with a predetermined number of representative colors, and for specifying a predetermined area for the predetermined area where the number of extracted representative colors exceeds the representative color number; and The color reduction information including information specifying a predetermined pixel of a color deviating from the extracted representative color and information specifying the original color of the predetermined pixel is generated and losslessly compressed. Count the number with the first counter When the count value of the first process and the first counter exceeds a predetermined count threshold value, the size of the color reduction information is compared with a predetermined size threshold value, and the size of the color reduction information is equal to the size threshold value. In the following cases, after the second processing for outputting the compressed data of the image and the losslessly compressed color reduction information, the compressed data of the image and the losslessly compressed color reduction information are expanded, and then the predetermined area And a third process for restoring the image by replacing the color of a predetermined pixel with the original color.

本発明の画像処理装置及び画像処理方法によれば、使用されている色の数が予め定めた代表色数より多い場合であっても、元の画像を使用することなく、色の再現性を確保できるように画像を圧縮することができる。   According to the image processing apparatus and the image processing method of the present invention, even when the number of colors used is larger than the predetermined representative color number, the color reproducibility can be achieved without using the original image. The image can be compressed so that it can be secured.

その理由は、画像処理装置の圧縮部では、処理対象の画像を分割した各領域に対して予め定めた代表色数で圧縮して代表色圧縮データを生成する際に、代表色以外の色に関する減色情報を生成し、減色が発生した領域の数や減色情報のサイズ、回転処理の要否に基づいて、代表色圧縮データのみを出力するか、代表色圧縮データと減色情報を出力するか、代表色圧縮データと減色情報を用い、代表色数を変更した代表色圧縮データを生成して出力するか、のいずれかの処理を実施し、代表色圧縮データと減色情報とが出力された場合には、伸張部では、減色が発生した部分を減色情報で上書きして画像を復元するからである。   The reason is that the compression unit of the image processing apparatus relates to colors other than the representative color when generating the representative color compressed data by compressing each region obtained by dividing the image to be processed with a predetermined number of representative colors. Generate subtractive color information and output only representative color compression data or representative color compression data and subtractive color information based on the number of areas where subtractive color occurs, the size of subtractive color information, and the necessity of rotation processing, When representative color compression data and subtractive color information are output using representative color compression data and subtractive color information, and generating or outputting representative color compressed data with the number of representative colors changed. This is because the decompression unit overwrites the portion where the color reduction has occurred with the color reduction information and restores the image.

代表色数が4の場合の画像処理方法を説明する図である。It is a figure explaining the image processing method in case the number of representative colors is 4. 減色が生じた場合の従来の処理を説明する図である。It is a figure explaining the conventional process when color reduction arises. 本発明の第1の実施例に係る減色情報のフォーマットを示す図である。It is a figure which shows the format of the color reduction information which concerns on 1st Example of this invention. 代表色数が5の場合の画像処理方法を説明する図である。It is a figure explaining the image processing method in case the number of representative colors is 5. 本発明の第1の実施例に係る画像処理装置の構成を示すブロック図である。1 is a block diagram illustrating a configuration of an image processing apparatus according to a first embodiment of the present invention. 本発明の第1の実施例に係る画像処理装置の圧縮モジュールの構成を示すブロック図である。1 is a block diagram illustrating a configuration of a compression module of an image processing apparatus according to a first embodiment of the present invention. 本発明の第1の実施例に係る圧縮部(圧縮モジュール)の動作を示すフローチャート図である。It is a flowchart figure which shows operation | movement of the compression part (compression module) which concerns on 1st Example of this invention. 本発明の第2の実施例に係る圧縮部(圧縮モジュール)の動作を示すフローチャート図である。It is a flowchart figure which shows operation | movement of the compression part (compression module) which concerns on 2nd Example of this invention. 本発明の第3の実施例に係る圧縮部(圧縮モジュール)の動作を示すフローチャート図である。It is a flowchart figure which shows operation | movement of the compression part (compression module) which concerns on the 3rd Example of this invention.

背景技術で示したように、一般的な画像の圧縮方法として、ブロック内の各ピクセルの色を代表色に置き換えるという画像圧縮方式が用いられているが、ブロック内で使用されている色数が予め定めた代表色数よりも多い場合は、代表色に当てはまらない色をいずれかの代表色に置き換える(すなわち、減色が発生する)ため、色の再現性が犠牲になってしまう。色の再現性を保つためには、代表色数を増やして再度圧縮処理を実施する必要があるが、減色が発生するか否かは実際に圧縮処理を行ってみなければ分からないため、代表色数を増やして再度圧縮処理を実施できるようにするためには、圧縮処理が完了するまで元の画像を保持しなくてはならず、メモリを占有してしまう。   As shown in the background art, as a general image compression method, an image compression method in which the color of each pixel in a block is replaced with a representative color is used, but the number of colors used in the block is When the number of representative colors is larger than a predetermined number, the color that does not fall under the representative color is replaced with one of the representative colors (that is, color reduction occurs), so that the color reproducibility is sacrificed. In order to maintain color reproducibility, it is necessary to increase the number of representative colors and perform compression processing again. However, since it is not known whether or not subtractive color will occur, the compression processing must be actually performed. In order to increase the number of colors so that the compression process can be performed again, the original image must be retained until the compression process is completed, which occupies memory.

そこで、本発明の一実施の形態では、画像を特定のサイズの領域(例えば、矩形ブロック)に分割し、矩形ブロック内で代表色を抽出し、ブロック内の各ピクセルの色を抽出した代表色のいずれかに置き換えることで画像を圧縮する画像圧縮方式を採用して画像を圧縮する際に、処理対象のブロックから抽出した代表色数と予め定めた代表色数Nとを比較し、ブロックから抽出した代表色数がNを超えた場合に、矩形ブロックを一意に特定する情報と、色の置き換えが発生したピクセルを特定する情報と、そのピクセルの置き換え前の色の情報と、を含む減色情報を可逆圧縮形式によって生成する。   Therefore, in one embodiment of the present invention, an image is divided into regions of a specific size (for example, rectangular blocks), representative colors are extracted in the rectangular blocks, and the colors of the pixels in the blocks are extracted. When the image is compressed by adopting an image compression method that compresses the image by replacing any of the above, the representative color number extracted from the block to be processed is compared with a predetermined representative color number N, and When the number of extracted representative colors exceeds N, the subtractive color includes information for uniquely identifying a rectangular block, information for identifying a pixel in which color replacement has occurred, and color information before the pixel replacement Generate information in a lossless compression format.

そして、減色が発生したブロック数、減色情報のサイズ、回転処理の要否に基づいて、(1)減色が発生したブロック数が予め定めた閾値以下の場合は、減色情報は破棄して代表色数Nの圧縮データのみを出力し、(2)減色が発生したブロック数が閾値を超えた場合で、減色情報のサイズが予め定めた閾値以下であり、かつ、圧縮データに回転処理を施す必要がない場合は、代表色数Nの圧縮データと圧縮した減色情報の2つを出力し、(3)減色が発生したブロック数が閾値を超えた場合で、減色情報のサイズが予め定めた閾値を超えた場合、または、圧縮データに回転処理を施す必要がある場合は、代表色数Nの圧縮データと減色情報とを用いて代表色数N+1の圧縮データを生成して出力する。   Based on the number of blocks in which color reduction has occurred, the size of color reduction information, and the necessity of rotation processing, (1) if the number of blocks in which color reduction has occurred is less than a predetermined threshold, the color reduction information is discarded and the representative color Only the number N of compressed data is output. (2) When the number of blocks in which color reduction has occurred exceeds the threshold, the size of the color reduction information is equal to or smaller than a predetermined threshold, and the compressed data needs to be rotated. In the case where there is no color, the compressed data of the representative color number N and the compressed color reduction information are output. (3) The number of blocks where color reduction has occurred exceeds the threshold, and the size of the color reduction information is a predetermined threshold. If it exceeds the above, or if it is necessary to perform rotation processing on the compressed data, the compressed data of the representative color number N + 1 is generated and output using the compressed data of the representative color number N and the color reduction information.

このような制御を行うことにより、ブロックに使用されている色の数が予め定めた代表色数Nより多い場合であっても、元の画像を使用することなく、色の再現性を確保することができる。   By performing such control, color reproducibility is ensured without using the original image even when the number of colors used in the block is larger than the predetermined representative color number N. be able to.

上記した本発明の一実施の形態についてさらに詳細に説明すべく、本発明の第1の実施例に係る画像処理装置及び画像処理方法について、図1乃至図7を参照して説明する。図1は、代表色数が4の場合の画像処理方法を説明する図であり、図2は、使用されている色数が代表色数を超える場合の従来の画像処理方法を説明する図である。また、図3は、本実施例の減色情報のフォーマットを示す図であり、図4は、代表色数が5の場合の画像処理方法を説明する図である。また、図5は、本実施例の画像処理装置の構成を示すブロック図であり、図6は、圧縮モジュールの構成を示すブロック図、図7は、圧縮部10b(圧縮モジュール)の動作を示すフローチャート図である。   In order to describe the above-described embodiment of the present invention in more detail, an image processing apparatus and an image processing method according to the first embodiment of the present invention will be described with reference to FIGS. FIG. 1 is a diagram illustrating an image processing method when the number of representative colors is 4, and FIG. 2 is a diagram illustrating a conventional image processing method when the number of colors used exceeds the number of representative colors. is there. FIG. 3 is a diagram illustrating a format of the color reduction information according to the present exemplary embodiment, and FIG. 4 is a diagram illustrating an image processing method when the number of representative colors is five. FIG. 5 is a block diagram showing the configuration of the image processing apparatus of the present embodiment, FIG. 6 is a block diagram showing the configuration of the compression module, and FIG. 7 shows the operation of the compression unit 10b (compression module). It is a flowchart figure.

本実施例の画像処理装置及び画像処理方法を説明する前に、代表色を用いて画像を圧縮する方法について説明する。   Before describing the image processing apparatus and the image processing method of this embodiment, a method for compressing an image using representative colors will be described.

図1(a)は、代表色の構成(ハッチングの種類で色の違いを表現している。)を示し、図1(b)は、処理対象の画像を分割した領域(本実施例ではブロックとする。)の各ピクセルに代表色を当てはめた画像の例を示している。この例では、1つのブロックを構成するピクセル数を8×8とし、1つのブロックが最大4色(代表色数をNとしたときに、N=4)の代表色を持つとしている。この場合、ブロック内の各ピクセルがどの代表色を使用するかは、2bitで表現できることになる。   FIG. 1A shows a configuration of representative colors (a color difference is expressed by the type of hatching), and FIG. 1B shows an area (block in this embodiment) obtained by dividing an image to be processed. An example of an image in which a representative color is applied to each pixel is shown. In this example, the number of pixels constituting one block is 8 × 8, and one block has a maximum of four colors (N = 4 when the number of representative colors is N). In this case, which representative color each pixel in the block uses can be expressed by 2 bits.

このような構成の場合、圧縮対象となるブロックに含まれる色の数(厳密には、RGB値が所定の範囲内の色を同一色とした場合の色の数)が4色以下であれば、それらの色を代表色として、各ピクセルにどの代表色を使用しているかの情報を2bitで示すことによって、対象となるブロックを可逆圧縮することができる。   In such a configuration, if the number of colors included in the block to be compressed (strictly, the number of colors when the RGB values are the same color within a predetermined range) is 4 or less, By using those colors as representative colors and indicating which representative color is used for each pixel in 2 bits, the target block can be reversibly compressed.

しかしながら、図2(a)に示すように、圧縮対象となるブロックに含まれる色の数が5色以上(図では7色)となった場合には、ブロックの中での出現頻度の高い方から順に4色を代表色として設定するため、4つの代表色以外の色を使用しているピクセル(図2(b)の黒四角で示したピクセル)については、4つの代表色の中で最も色の近い代表色を選択することになり(図2(c)参照)、圧縮対象のブロックは非可逆圧縮となる。   However, as shown in FIG. 2A, when the number of colors included in the block to be compressed is 5 or more (seven colors in the figure), the one with the higher appearance frequency in the block Since the four colors are set as representative colors in order, the pixel using a color other than the four representative colors (the pixel indicated by the black square in FIG. 2B) is the most representative of the four representative colors. A close representative color is selected (see FIG. 2C), and the block to be compressed is irreversibly compressed.

この問題を回避するためには、ブロックに含まれる色数に合わせて代表色数を設定すればよいが、各ブロックの代表色として何色必要であるかは圧縮する画像に依存するため、通常、圧縮前に最適な代表色数Nを設定することは困難である。そのため、代表色による圧縮処理の実行中に減色が発生したブロックが大量に生じた場合には、代表色数Nを増やして最初から再度、圧縮処理を行わなければならず、再度、圧縮処理を行うためには、圧縮処理が終了するまで圧縮元の画像を保持しなければならず、その間、メモリを占有してしまう。   In order to avoid this problem, the number of representative colors may be set according to the number of colors included in the block, but the number of colors required as the representative color of each block depends on the image to be compressed. It is difficult to set the optimum representative color number N before compression. For this reason, when a large number of blocks where color reduction has occurred during execution of compression processing using representative colors, the number of representative colors N must be increased and compression processing must be performed again from the beginning. In order to do this, the compression source image must be held until the compression process is completed, and the memory is occupied during that time.

そこで、本実施例では、上記のような非可逆圧縮となった(使用されている色数が代表色数Nを上回った)ブロックについては、公知の手法を用いて圧縮処理を行った通常の圧縮データ(以下、代表色圧縮データと呼ぶ。)の他に、図3に表されるような減色情報を生成する。この減色情報は、例えば、非可逆圧縮となったブロックを特定する情報(ブロック番号)、代表色以外の色の数を示す減色数、代表色以外の各色の色情報(減色代表色情報)、その色を有するピクセルの数(対応ピクセル数)、各々のピクセルを特定する情報(対応ピクセル情報)などで構成される。   Therefore, in this embodiment, a block that has been irreversibly compressed as described above (the number of colors used exceeds the representative color number N) is subjected to compression processing using a known method. In addition to the compressed data (hereinafter referred to as representative color compressed data), the color reduction information as shown in FIG. 3 is generated. This color reduction information includes, for example, information (block number) for specifying a block that has been irreversibly compressed, a color reduction number indicating the number of colors other than the representative color, color information for each color other than the representative color (color reduction representative color information), The number of pixels having the color (corresponding pixel number), information specifying each pixel (corresponding pixel information), and the like are included.

そして、この減色情報を、通常の代表色圧縮データとは別の領域に可逆圧縮形式によって出力を行う。その際、代表色圧縮データは圧縮後のデータサイズが固定であるため、通常、減色情報は代表色圧縮データの格納領域の直後の領域に出力される。   The subtractive color information is output in a reversible compression format in a region different from normal representative color compression data. At this time, since the data size after compression of the representative color compressed data is fixed, the color reduction information is usually output to an area immediately after the storage area of the representative color compressed data.

但し、代表色圧縮データに合わせて減色情報を出力する場合、減色情報のサイズが大きい場合は、やはりメモリを占有してしまう。また、代表色圧縮データに回転処理が適用されて、減色情報との対応づけが困難になった場合は、代表色圧縮データと減色情報によって圧縮前の画像を復元することができない。そのような場合は、代表色数を増やした新たな代表色圧縮データを生成することになるが、その際、元の画像を用いて代表色圧縮データを生成するのではなく、代表色圧縮データと減色情報を用いて、代表色数を増やした新たな代表色圧縮データを生成する。   However, when the subtractive color information is output in accordance with the representative color compression data, if the size of the subtractive color information is large, the memory is still occupied. Further, when the rotation processing is applied to the representative color compression data and it becomes difficult to associate with the subtractive color information, the image before compression cannot be restored using the representative color compression data and the subtractive color information. In such a case, new representative color compressed data with an increased number of representative colors is generated. At that time, instead of generating representative color compressed data using the original image, representative color compressed data is generated. Using the subtractive color information, new representative color compression data with an increased number of representative colors is generated.

以下、代表色の色数を4から5に増やした代表色圧縮データを生成する手法を説明する。   Hereinafter, a method of generating representative color compressed data in which the number of representative colors is increased from 4 to 5 will be described.

まず、図2(b)のように、代表色以外の色を最も色の近い代表色に置き換えた代表色圧縮データに対して先頭からデータ伸張を行い、代表色数を5、位置情報表現ビット数を3のフォーマット(図4(a)参照)に変換する。その際、元々の画像は4色分の情報しか持たないため、この状態では代表色5はブランクで、位置情報の最上位ビットも0のままである。   First, as shown in FIG. 2B, the representative color compression data obtained by replacing colors other than the representative color with the closest representative color is subjected to data decompression from the beginning, the number of representative colors is 5, and the position information expression bit The number is converted into a format of 3 (see FIG. 4A). At that time, since the original image has information for only four colors, the representative color 5 is blank in this state, and the most significant bit of the position information remains zero.

次に、このフォーマットデータに対して、減色情報から各ブロックの5番目の代表色情報を抜き出し、上書きを実施することで、図4(b)に示すように、代表色5の部分と、対応するピクセルの位置の情報を更新する。最後に、減色情報の6番目以降のデータをチェックして、代表色の1から5のどれに最も近いかを判断し、対応するピクセルのデータを最も近い代表色を示す位置情報に置き換える。この一連の処理を行なうことによって、代表色N=5のデータを生成することができる。   Next, the fifth representative color information of each block is extracted from this format data from the subtractive color information and is overwritten. As shown in FIG. Update pixel location information. Finally, the sixth and subsequent data of the color reduction information is checked to determine which of the representative colors 1 to 5 is closest, and the corresponding pixel data is replaced with position information indicating the closest representative color. By performing this series of processing, data of the representative color N = 5 can be generated.

このように、本実施例では、通常の代表色圧縮データの他に可逆圧縮した減色情報も合わせて出力されるため、使用されている色数が代表色数Nを超えた場合であっても、代表色圧縮データと減色情報を使用する(代表色圧縮データを先に伸張して、減色情報によって上書きする)ことによって、圧縮前の画像を復元することができる。また、減色情報のサイズが大きい場合や代表色圧縮データに回転処理が適用されている場合は、代表色圧縮データと減色情報を用いて代表色数を変更した代表色圧縮データを生成して出力するため、元の画像を保持する必要がなくなり、メモリの占有を抑制することができる。   As described above, in this embodiment, since the reversible compressed color reduction information is also output in addition to the normal representative color compression data, even when the number of colors used exceeds the representative color number N. By using the representative color compressed data and the subtractive color information (the representative color compressed data is first expanded and overwritten with the subtractive color information), the image before compression can be restored. Also, if the size of the color reduction information is large or rotation processing is applied to the representative color compression data, representative color compression data with the representative color number changed using the representative color compression data and the color reduction information is generated and output. Therefore, it is not necessary to hold the original image, and the occupation of the memory can be suppressed.

次に、上記制御を行うための装置構成について説明する。図5は、本実施例の画像処理装置の構成を示すブロック図であり、図6は、画像処理装置に含まれる圧縮モジュールの構成を示すブロック図である。   Next, an apparatus configuration for performing the above control will be described. FIG. 5 is a block diagram illustrating a configuration of the image processing apparatus according to the present exemplary embodiment, and FIG. 6 is a block diagram illustrating a configuration of a compression module included in the image processing apparatus.

本実施例の画像処理装置10は、プリンタやスキャナなどであり、図5に示すように、制御部10aと、圧縮部10bと、伸張部10cと、原稿をスキャンした画像を圧縮部10bに渡したり、伸張部10cで伸張した画像を用いて印刷等を実行する処理部10dなどで構成される。   The image processing apparatus 10 according to the present embodiment is a printer, a scanner, or the like. As illustrated in FIG. 5, the control unit 10a, the compression unit 10b, the expansion unit 10c, and an image obtained by scanning a document are transferred to the compression unit 10b. Or a processing unit 10d that executes printing using the image expanded by the expansion unit 10c.

制御部10aは、CPU(Central Processing Unit)とROM(Read Only Memory)やRAM(Random Access Memory)などのメモリとで構成され、CPUは、ROMに記憶したプログラムをRAMに展開して実行し、画像処理装置10全体を制御する。   The control unit 10a includes a CPU (Central Processing Unit) and a memory such as a ROM (Read Only Memory) and a RAM (Random Access Memory). The CPU expands and executes a program stored in the ROM, The entire image processing apparatus 10 is controlled.

圧縮部10bは、処理対象となる画像(例えば、処理部(画像読取部)で読み取った画像や他の装置から取得した画像)をブロックに分割し、各ブロックを代表色によって圧縮する部分であり、例えば、圧縮部10bをハードウェアで構成した圧縮モジュールは、図6に示すように、入力バッファ11、代表色抽出回路12、第1ワークメモリ13、第2ワークメモリ14、代表色数比較回路15、データ制御回路16、第1出力バッファ17、第2出力バッファ18、ピクセル評価回路19、可逆圧縮回路20、カウンタ21、代表色数N設定レジスタ22、ブロックカウンタ23などで構成される。この圧縮モジュールの各部の動作については後述する。   The compression unit 10b is a part that divides an image to be processed (for example, an image read by the processing unit (image reading unit) or an image acquired from another device) into blocks and compresses each block with a representative color. For example, the compression module in which the compression unit 10b is configured by hardware includes an input buffer 11, a representative color extraction circuit 12, a first work memory 13, a second work memory 14, and a representative color number comparison circuit, as shown in FIG. 15, a data control circuit 16, a first output buffer 17, a second output buffer 18, a pixel evaluation circuit 19, a lossless compression circuit 20, a counter 21, a representative color number N setting register 22, a block counter 23, and the like. The operation of each part of this compression module will be described later.

伸張部10cは、代表色圧縮データを伸張して処理部10d(印刷部)で処理可能なデータに復元する部分であり、例えば、伸張部10cをハードウェアで構成した伸張モジュールは、代表色圧縮データや減色情報を伸張する可逆伸張回路、伸張したデータを記録するメモリ、減色情報に基づいてブロック内のピクセルの色を変換する変換回路、ブロックを並び替えるセレクタ回路などで構成される。   The decompression unit 10c is a part that decompresses the representative color compressed data and restores it to data that can be processed by the processing unit 10d (printing unit). For example, the decompression module that includes the decompression unit 10c in hardware is a representative color compressing unit. The circuit includes a reversible decompression circuit that decompresses data and color reduction information, a memory that records the decompressed data, a conversion circuit that converts the color of the pixels in the block based on the color reduction information, a selector circuit that rearranges the blocks, and the like.

処理部10dは、画像読取部や印刷部などで構成される。画像読取部は、原稿を走査する光源と、原稿で反射された光を電気信号に変換するCCD(Charge Coupled Devices)等のイメージセンサと、電気信号をA/D変換して画像データとして出力するA/D変換器等により構成される。印刷部は、伸張部10cで伸張した画像を用紙に転写する。具体的には、帯電装置により帯電された感光体ドラムに露光装置から画像に応じた光を照射して静電潜像を形成し、現像装置で帯電したトナーを付着させて現像し、そのトナー像を転写ベルトに1次転写し、転写ベルトから紙媒体に2次転写し、更に定着装置で紙媒体にトナー像を定着させる処理を行う。   The processing unit 10d includes an image reading unit, a printing unit, and the like. The image reading unit scans an original, an image sensor such as a CCD (Charge Coupled Devices) that converts light reflected from the original into an electric signal, and A / D converts the electric signal to output it as image data. It is composed of an A / D converter or the like. The printing unit transfers the image expanded by the expansion unit 10c to a sheet. Specifically, the photosensitive drum charged by the charging device is irradiated with light corresponding to the image from the exposure device to form an electrostatic latent image, and the toner charged by the developing device is attached and developed. The image is primarily transferred to a transfer belt, secondarily transferred from the transfer belt to a paper medium, and a fixing device fixes the toner image onto the paper medium.

なお、図5及び図6は、本実施例の画像処理装置10の一例であり、その構成は適宜変更可能である。例えば、図5では、圧縮部10bと伸張部10cとを別々に設けているが、これらは1つにまとめてもよい。   5 and 6 show an example of the image processing apparatus 10 of the present embodiment, and the configuration thereof can be changed as appropriate. For example, in FIG. 5, the compression unit 10b and the expansion unit 10c are provided separately, but these may be combined into one.

次に、本実施例の特徴部分である圧縮モジュールの動作について、図6のブロック図及び図7のフローチャート図を参照して説明する。なお、以下の説明において、圧縮する画像は予め所定のサイズのブロックに分割され、代表色数N、減色ブロック数に対する閾値、減色情報のサイズに対する閾値などは予め設定されているものとし、カウンタのカウント値はリセットされているものとする。   Next, the operation of the compression module, which is a characteristic part of the present embodiment, will be described with reference to the block diagram of FIG. 6 and the flowchart of FIG. In the following description, it is assumed that the image to be compressed is divided into blocks of a predetermined size, the number of representative colors N, the threshold for the number of subtractive blocks, the threshold for the size of subtractive color information, etc. are set in advance. It is assumed that the count value has been reset.

まず、圧縮対象となるブロックの各ピクセルに使用されている色を抽出し、ブロック内の色数が予め定めた代表色数N以下であるかを判断する(S101)。具体的には、代表色抽出回路12は、入力バッファ11内に格納されている対象ブロックの各ピクセルの色をチェックして、出現頻度順に、代表色数N設定レジスタ22に設定されているN色分の代表色を抽出する。この時、抽出した代表色の情報を、代表色情報として第1ワークメモリ13上に出力する。同時に、対象となるブロックから抽出された色が合計何色であったかを示す情報を代表色数比較回路15に渡す。代表色数比較回路15では、ブロック内で抽出された代表色数と、代表色数N設定レジスタ22に設定されている値Nとの比較を行う。   First, a color used for each pixel of a block to be compressed is extracted, and it is determined whether the number of colors in the block is equal to or less than a predetermined representative color number N (S101). Specifically, the representative color extraction circuit 12 checks the color of each pixel of the target block stored in the input buffer 11, and sets the representative color number N setting register 22 in the order of appearance frequency. Extract representative colors. At this time, the extracted representative color information is output to the first work memory 13 as representative color information. At the same time, information indicating the total number of colors extracted from the target block is passed to the representative color number comparison circuit 15. The representative color number comparison circuit 15 compares the representative color number extracted in the block with the value N set in the representative color number N setting register 22.

ブロック内で抽出された代表色数が予め定めた代表色数Nよりも大きい場合は、減色ブロック数カウンタをカウントアップし(S102)、減色情報を抽出して圧縮結果別領域に出力する(S103)。具体的には、代表色数比較回路15は、カウンタ21の値を1つインクリメントする。また、代表色数比較回路15は、何色の減色が発生したか(代表色数N設定レジスタ22に設定されている値Nとブロック内で抽出された代表色数との差)をデータ制御回路16に減色数Mとして送ると共に、減色情報の“減色数”として第2ワークメモリ14上に出力する。上記カウンタ21の値は、最終的に、圧縮データの中に減色が発生したブロックがいくつ存在するかを示す値となり、圧縮が完了した後、カウンタ21の値によって、どのデータを圧縮結果として採用するかの判断材料として使用する。   When the representative color number extracted in the block is larger than the predetermined representative color number N, the subtractive color block number counter is counted up (S102), and the subtractive color information is extracted and outputted to the compression result region (S103). ). Specifically, the representative color number comparison circuit 15 increments the value of the counter 21 by one. The representative color number comparison circuit 15 controls how many colors are reduced (difference between the value N set in the representative color number N setting register 22 and the representative color number extracted in the block). While being sent to the circuit 16 as the color reduction number M, it is output on the second work memory 14 as the “color reduction number” of the color reduction information. The value of the counter 21 finally becomes a value indicating how many blocks in which the color reduction has occurred in the compressed data. After the compression is completed, which data is adopted as the compression result depending on the value of the counter 21. It is used as a material for judging whether to do.

データ制御回路16は、代表色数比較回路15から減色数Mを受け取ると、代表色抽出回路12を制御して、N+1番目の代表色を第2ワークメモリ14上に減色情報の“減色代表色情報1”として出力させる。次に、このN+1番目の代表色の情報を、ピクセル評価回路19に送り、ピクセル評価回路19は、N+1番目の代表色に対応するピクセルの数とその位置情報を、第2ワークメモリ14上に減色情報の“対応ピクセル情報1”として出力する。そして、この動作をN+M番目の代表色の出力が完了するまで繰り返す。   When the data control circuit 16 receives the color reduction number M from the representative color number comparison circuit 15, the data control circuit 16 controls the representative color extraction circuit 12 to place the (N + 1) th representative color on the second work memory 14 as “reduction color representative color” of the color reduction information. Output as information 1 ". Next, the information of the (N + 1) th representative color is sent to the pixel evaluation circuit 19, and the pixel evaluation circuit 19 stores the number of pixels corresponding to the (N + 1) th representative color and the position information thereof on the second work memory 14. Output as “corresponding pixel information 1” of the color reduction information. This operation is repeated until the output of the N + Mth representative color is completed.

減色情報を出力した後、若しくは、ブロック内の色数がN以下の場合は、予め定めた代表色数Nで代表色圧縮を実施する(S104)。具体的には、ピクセル評価回路19は、ブロック内の各ピクセルに対して、上記の代表色抽出回路12が抽出したN色の代表色のうち、最も色が近いものを選択し、選択した代表色を表すバイナリコードを位置情報として、第1ワークメモリ14上に出力する。この代表色情報と位置情報の組み合わせが代表色圧縮情報となる。そして、上記S101〜S103の処理を最終ブロックまで実施する(S105)。   After outputting the color reduction information, or when the number of colors in the block is N or less, representative color compression is performed with a predetermined representative color number N (S104). Specifically, the pixel evaluation circuit 19 selects the closest representative color among the N representative colors extracted by the representative color extraction circuit 12 for each pixel in the block, and selects the selected representative. A binary code representing a color is output as position information on the first work memory 14. A combination of the representative color information and the position information becomes representative color compression information. Then, the processing of S101 to S103 is performed up to the final block (S105).

次に、減色ブロック数(カウンタ21の値)が予め定めた閾値以下であるかを判断する(S106)。   Next, it is determined whether the number of subtractive blocks (the value of the counter 21) is equal to or less than a predetermined threshold (S106).

減色ブロック数が閾値以下の場合は、色の再現性が確保できると考えられることから、代表色数Nで代表色圧縮した結果を出力する(S107)。具体的には、データ制御回路16は、第1出力バッファ17を操作して、第1ワークメモリ13に格納されているデータを、代表色圧縮データとして外部に出力する。   If the number of subtractive blocks is less than or equal to the threshold value, it is considered that the color reproducibility can be ensured, so that the result of the representative color compression with the representative color number N is output (S107). Specifically, the data control circuit 16 operates the first output buffer 17 and outputs the data stored in the first work memory 13 to the outside as representative color compressed data.

一方、減色ブロック数が閾値を超えている場合は、回転処理が必要であるかを判断し(S108)、回転処理が必要ない場合は、減色情報のサイズが予め定めた閾値以下であるかを判断する(S109)。   On the other hand, if the number of color-reduction blocks exceeds the threshold, it is determined whether rotation processing is necessary (S108). If rotation processing is not necessary, it is determined whether the size of the color-reduction information is equal to or smaller than a predetermined threshold. Judgment is made (S109).

減色情報のサイズが閾値以下の場合は、代表色数Nで代表色圧縮した結果と減色情報を合わせて圧縮結果として出力する(S110)。具体的には、データ制御回路16は、第1出力バッファ17、第2出力バッファ18を操作して、第1ワークメモリ13、第2ワークメモリ14に格納されているデータを、代表色圧縮データと、圧縮済み減色情報として外部に出力する。この際に、第2ワークメモリ14側のデータについては、可逆圧縮回路20によって、可逆データ圧縮が実行される。   If the size of the color reduction information is equal to or smaller than the threshold, the result of the representative color compression with the number of representative colors N and the color reduction information are combined and output as a compression result (S110). Specifically, the data control circuit 16 operates the first output buffer 17 and the second output buffer 18 to convert the data stored in the first work memory 13 and the second work memory 14 into representative color compressed data. To the outside as compressed color reduction information. At this time, the reversible compression circuit 20 performs reversible data compression on the data on the second work memory 14 side.

一方、回転処理が必要な場合(S108のYes)、若しくは、減色情報のサイズが閾値を超えている場合(S109のNo)は、代表色数Nで代表色圧縮を行った結果と減色情報とを用いて、代表色数N+1の代表色圧縮データを生成して出力する(S111)。   On the other hand, when the rotation process is necessary (Yes in S108) or the size of the color reduction information exceeds the threshold (No in S109), the result of performing the representative color compression with the number of representative colors N and the color reduction information Is used to generate and output representative color compressed data of N + 1 representative colors (S111).

その後、伸張部では、圧縮モジュールから、代表色数Nで圧縮した代表色圧縮データ、若しくは代表色数Nで圧縮した代表色圧縮データと減色情報、若しくは代表色数N+1で圧縮した代表色圧縮データを取得する。そして、代表色圧縮データのみを取得した場合は、代表色圧縮データを伸張して画像データを復元し、代表色圧縮データと減色情報を取得した場合は、代表色圧縮データを先に伸張して、減色情報によって上書きすることによって画像データを復元する。   Thereafter, in the decompression unit, the representative color compressed data compressed with the representative color number N, the representative color compressed data compressed with the representative color number N and the color reduction information, or the representative color compressed data compressed with the representative color number N + 1 from the compression module. To get. When only the representative color compression data is acquired, the representative color compression data is expanded to restore the image data. When the representative color compression data and the color reduction information are acquired, the representative color compression data is first expanded. The image data is restored by overwriting with the color reduction information.

そして、処理部(印刷部)では、伸張部から画像データを取得し、その画像データに基づいて印刷処理を行う。   Then, the processing unit (printing unit) acquires image data from the decompression unit, and performs printing processing based on the image data.

このように、本実施例によれば、代表色圧縮データと減色情報と別々に保持することによって、圧縮処理が完了した後に、減色が発生したブロックの数が閾値を越えたか、減色情報のサイズが閾値を超えたか、圧縮データに対して回転処理が必要かなどの条件に応じて、(1)代表色数Nで代表色圧縮を行なったデータのみを圧縮結果として出力する、(2)代表色数Nの代表色圧縮データと圧縮した減色情報の両方を圧縮結果として出力する、(3)代表色数N+1で代表色圧縮を行なった代表色圧縮データを生成して、これを圧縮結果として出力する、という3種類の形態から最適なものを選択することができ、これにより、使用されている色の数が予め定めた代表色数Nより多い場合であっても、元の画像を使用することなく、色の再現性を確保することができる。   As described above, according to the present embodiment, the representative color compression data and the color reduction information are held separately, so that after the compression process is completed, the number of blocks where color reduction has occurred exceeds the threshold or the size of the color reduction information. (1) Only data that has undergone representative color compression with the number of representative colors N is output as a compression result, depending on conditions such as whether or not the image data exceeds a threshold value or whether or not rotation processing is necessary for compressed data. Both the representative color compression data of the number of colors N and the compressed subtractive color information are output as compression results. (3) Representative color compression data subjected to representative color compression with the number of representative colors N + 1 is generated, and this is used as the compression result. The optimum output can be selected from the three types of output, so that the original image can be used even when the number of colors used is larger than the predetermined number N of representative colors. Without re-coloring It is possible to ensure the sex.

なお、上記実施例では、代表色数が4の場合を例にして説明したが、任意の代表色数に対して同様に適用することができる。   In the above embodiment, the case where the number of representative colors is four has been described as an example, but the present invention can be similarly applied to any number of representative colors.

次に、本発明の第2の実施例に係る画像処理装置及び画像処理方法について、図8を参照して説明する。図8は、本実施例の画像処理装置の圧縮モジュールの動作を示すフローチャート図である。   Next, an image processing apparatus and an image processing method according to the second embodiment of the present invention will be described with reference to FIG. FIG. 8 is a flowchart showing the operation of the compression module of the image processing apparatus of this embodiment.

前記した第1の実施例では、減色が発生したブロックの数を単純にカウントして、その値が予め定めた閾値を超えた場合に、代表色を1色増やす制御を行ったが、本実施例では、減色が発生したブロックの数をカウントするカウンタG1の他に、代表色を1色増やした場合でも減色が発生してしまうブロックの数をカウントするカウンタG2を設けて、代表色数を増やす場合に、カウンタG2のカウンタ値によって代表色を1色増やすのか、2色増やすのかの判定を行う。   In the first embodiment described above, the number of blocks in which color reduction has occurred is simply counted, and when the value exceeds a predetermined threshold, control is performed to increase the representative color by one. In the example, in addition to the counter G1 that counts the number of blocks in which color reduction has occurred, a counter G2 that counts the number of blocks in which color reduction occurs even when the representative color is increased by one is provided. In the case of increasing, it is determined whether the representative color is increased by one color or by two colors according to the counter value of the counter G2.

この場合の圧縮モジュールの動作について、図8のフローチャート図を参照して説明する。なお、以下の説明においても、圧縮する画像は予め所定のサイズのブロックに分割され、代表色数N、減色ブロック数に対する閾値、減色情報のサイズに対する閾値は予め設定されているものとし、カウンタのカウント値はリセットされているものとする。   The operation of the compression module in this case will be described with reference to the flowchart of FIG. In the following description, it is assumed that the image to be compressed is divided into blocks of a predetermined size in advance, the threshold for the number of representative colors N, the number of subtractive blocks, and the threshold for the size of subtractive color information are set in advance. It is assumed that the count value has been reset.

まず、圧縮対象となるブロックの各ピクセルに使用されている色を抽出し、ブロック内の色数が予め定めた代表色数N以下であるかを判断する(S201)。ブロック内で抽出された代表色数が予め定めた代表色数Nよりも大きい場合は、減色ブロック数カウンタG1をカウントアップする(S202)。   First, a color used for each pixel of a block to be compressed is extracted, and it is determined whether the number of colors in the block is equal to or less than a predetermined representative color number N (S201). If the representative color number extracted in the block is larger than the predetermined representative color number N, the subtractive color block number counter G1 is counted up (S202).

次に、本実施例では、ブロック内の色数がN+1以下であるかを判断し(S203)、ブロック内で抽出された代表色数がN+1よりも大きい場合は、減色ブロック数カウンタG2をカウントアップする(S204)。そして、減色情報を抽出して圧縮結果別領域に出力する(S205)。   Next, in this embodiment, it is determined whether the number of colors in the block is N + 1 or less (S203). If the number of representative colors extracted in the block is larger than N + 1, the subtractive color block number counter G2 is counted. Up (S204). Then, the color-reduction information is extracted and output to the compression result area (S205).

減色情報を出力した後、若しくは、ブロック内の色数がN以下の場合は、予め定めた代表色数Nで代表色圧縮を実施し(S206)、上記S201〜S206の処理を最終ブロックまで実施する(S207)。   After outputting the color-reduction information or when the number of colors in the block is N or less, representative color compression is performed with a predetermined representative color number N (S206), and the processing of S201 to S206 is performed up to the final block. (S207).

次に、減色ブロック数G1(減色ブロック数カウンタG1のカウント値)が予め定めた閾値以下であるかを判断する(S208)。   Next, it is determined whether the color reduction block number G1 (count value of the color reduction block number counter G1) is equal to or smaller than a predetermined threshold value (S208).

減色ブロック数G1が閾値以下の場合は、色の再現性が担保できると考えられることから、代表色数Nで代表色圧縮した結果を出力する(S209)。一方、減色ブロック数G1が閾値を超えている場合は、回転処理が必要であるかを判断し(S210)、回転処理が必要ない場合は、減色情報のサイズが予め定めた閾値以下であるかを判断する(S211)。そして、減色情報のサイズが閾値以下の場合は、代表色数Nで代表色圧縮した結果と減色情報を合わせて圧縮結果として出力する(S212)。   If the number of subtractive color blocks G1 is equal to or less than the threshold value, it is considered that the color reproducibility can be secured, and therefore the result of the representative color compression with the representative color number N is output (S209). On the other hand, if the number of color-reduction blocks G1 exceeds the threshold value, it is determined whether rotation processing is necessary (S210). If rotation processing is not necessary, the size of the color-reduction information is equal to or smaller than a predetermined threshold value. Is determined (S211). If the size of the color reduction information is equal to or smaller than the threshold, the result of the representative color compression with the number of representative colors N and the color reduction information are combined and output as a compression result (S212).

一方、回転処理が必要な場合(S210のYes)、若しくは、減色情報のサイズが閾値を超えている場合(S211のNo)は、減色ブロック数G2(減色ブロック数カウンタG2のカウント値)が予め定めた閾値(減色ブロック数G1の判定に使用する閾値と同じであっても異なっていてもよい。)以下であるかを判断する(S213)。そして、減色ブロック数G2が閾値以下の場合は、代表色数Nで代表色圧縮を行った結果と減色情報とを用いて、代表色数N+1の代表色圧縮データを生成して出力し(S215)、減色ブロック数G2が閾値を超えている場合は、代表色数Nで代表色圧縮を行った結果と減色情報とを用いて、代表色数N+2の代表色圧縮データを生成して出力する(S214)。   On the other hand, when the rotation process is necessary (Yes in S210) or the size of the color reduction information exceeds the threshold (No in S211), the number of color reduction blocks G2 (count value of the color reduction block number counter G2) is set in advance. It is determined whether the threshold value is equal to or less than a predetermined threshold value (which may be the same as or different from the threshold value used for determining the number of subtractive color blocks G1) (S213). If the number of subtractive color blocks G2 is equal to or less than the threshold value, the representative color compression data of the representative color number N + 1 is generated and output using the result of the representative color compression performed with the representative color number N and the subtractive color information (S215). ) If the number of subtractive color blocks G2 exceeds the threshold, the representative color compression data of the representative color number N + 2 is generated and output using the result of the representative color compression performed with the representative color number N and the subtractive color information. (S214).

このように、減色が発生したブロックの内、代表色を1色増やした場合でも減色が発生するブロックの数をカウントすることにより、代表色数N+1の代表色圧縮データを生成すべきか、代表色数N+2の代表色圧縮データを生成すべきかを判断することができるため、色の再現性を高めることができる。   In this way, it is determined whether the representative color compression data of the number of representative colors N + 1 should be generated by counting the number of blocks where the color reduction occurs even when the representative color is increased by one among the blocks where the color reduction has occurred. Since it is possible to determine whether or not several N + 2 representative color compression data should be generated, color reproducibility can be improved.

なお、上記実施例では、カウンタG1とカウンタG2の2つのカウンタを用いる場合について説明したが、例えば、代表色を2色増やした場合でも減色が発生してしまうブロックの個数をカウントするG3、代表色を3色増やした場合でも減色が発生してしまうブロックの個数をカウントするG4、とカウンタの数を増やしていき、増やす代表色の色数の最適化を図ることも可能である。   In the above embodiment, the case of using two counters, the counter G1 and the counter G2, has been described. For example, G3, which counts the number of blocks in which color reduction occurs even when the representative color is increased by two, is representative. It is also possible to optimize the number of representative colors to be increased by increasing the number of counters and G4 that counts the number of blocks in which color reduction occurs even when the number of colors is increased.

次に、本発明の第3の実施例に係る画像処理装置及び画像処理方法について、図9を参照して説明する。図9は、本実施例の画像処理装置の圧縮モジュールの動作を示すフローチャート図である。   Next, an image processing apparatus and an image processing method according to the third embodiment of the present invention will be described with reference to FIG. FIG. 9 is a flowchart showing the operation of the compression module of the image processing apparatus of this embodiment.

前記した第2の実施例では、代表色を1色増やした場合でも減色が発生してしまうブロックの個数をカウントするG2を設けたが、本実施例では、第2の実施例とは逆に、代表色数をN−1に減らしても減色が発生しないブロックの数をカウントするカウンタG3を実装し、このカウンタG3のカウンタ値が予め定めた閾値以上であれば、代表色圧縮情報から代表色数を1色減らした代表色圧縮情報を生成し、圧縮結果として出力する。   In the second embodiment described above, G2 is provided to count the number of blocks in which subtractive color occurs even when the representative color is increased by one. In this embodiment, however, the reverse of the second embodiment. When a counter G3 for counting the number of blocks in which color reduction does not occur even if the number of representative colors is reduced to N-1, if the counter value of the counter G3 is equal to or greater than a predetermined threshold value, the representative color compression information is used as a representative. Representative color compression information with the number of colors reduced by one is generated and output as a compression result.

この場合の圧縮モジュールの動作について、図9のフローチャート図を参照して説明する。なお、以下の説明においても、圧縮する画像は予め所定のサイズのブロックに分割され、代表色数N、減色ブロック数及び減色可能ブロック数に対する閾値、減色情報のサイズに対する閾値は予め設定されているものとし、カウンタのカウント値はリセットされているものとする。   The operation of the compression module in this case will be described with reference to the flowchart of FIG. Also in the following description, the image to be compressed is divided into blocks of a predetermined size in advance, and the threshold for the number of representative colors N, the number of subtractive blocks and the number of subtractable blocks, and the threshold for the size of subtractive color information are set in advance. Assume that the count value of the counter has been reset.

まず、圧縮対象となるブロックの各ピクセルに使用されている色を抽出し、ブロック内の色数が予め定めた代表色数N以下であるかを判断する(S301)。ブロック内で抽出された代表色数が代表色数Nよりも大きい場合は、減色ブロック数カウンタG1をカウントアップし(S302)、減色情報を抽出して圧縮結果別領域に出力する(S303)。   First, a color used for each pixel of a block to be compressed is extracted, and it is determined whether the number of colors in the block is equal to or less than a predetermined representative color number N (S301). If the representative color number extracted in the block is larger than the representative color number N, the subtractive color block number counter G1 is counted up (S302), and the subtractive color information is extracted and output to the compression result region (S303).

一方、ブロック内で抽出された代表色数が代表色数N以下の場合は、ブロック内の色数がN−1以下であるかを判断し(S304)、ブロック内で抽出された代表色数がN−1以下の場合は、減色可能ブロック数カウンタG3をカウントアップする(S305)。   On the other hand, if the number of representative colors extracted in the block is less than or equal to N, it is determined whether the number of colors in the block is N−1 or less (S304), and the number of representative colors extracted in the block. If N is equal to or smaller than N-1, the color-reducible block number counter G3 is counted up (S305).

減色情報を出力した後、若しくは減色可能ブロック数カウンタG3をカウントアップした後、若しくは、ブロック内の色数がN−1を超えている場合は、予め定めた代表色数Nで代表色圧縮を実施する(S306)。そして、上記S301〜S306の処理を最終ブロックまで実施する(S307)。   After outputting the color-reduction information, or after counting up the color-reducible block number counter G3, or when the number of colors in the block exceeds N-1, representative color compression is performed with a predetermined number N of representative colors. Implement (S306). Then, the processes of S301 to S306 are performed up to the final block (S307).

次に、減色ブロック数G1(減色ブロック数カウンタG1のカウント値)が予め定めた閾値以下であるかを判断する(S308)。   Next, it is determined whether the color reduction block number G1 (count value of the color reduction block number counter G1) is equal to or smaller than a predetermined threshold value (S308).

減色ブロック数G1が閾値以下の場合は、減色可能ブロック数G3(減色可能ブロック数カウンタG3のカウント値)が予め定めた閾値(減色ブロック数G1の判定に使用する閾値と同じであっても異なっていてもよい。)以上であるかを判断する(S309)。そして、減色可能ブロック数G3が閾値以上の場合は、代表色数Nで代表色圧縮を行った結果と減色情報とを用いて、代表色数N−1の代表色圧縮データを生成して出力し(S310)、減色可能ブロック数G3が閾値より小さい場合は、代表色数Nで代表色圧縮した結果を出力する(S311)。   When the number G1 of subtractive color blocks is less than or equal to the threshold value, the number G3 of subtractable color blocks (count value of the subtractable color block counter G3) is different even if it is the same as a predetermined threshold value (the threshold value used to determine the number of subtractive color blocks G1). It may be determined) (S309). If the number of color-reducible blocks G3 is equal to or greater than the threshold, the representative color compression data of the representative color number N-1 is generated and output using the result of the representative color compression performed with the representative color number N and the color reduction information. If the number of color-reducible blocks G3 is smaller than the threshold (S310), the result of the representative color compression with the representative color number N is output (S311).

一方、減色ブロック数G1が閾値を超えている場合は、回転処理が必要であるかを判断し(S312)、回転処理が必要ない場合は、減色情報のサイズが予め定めた閾値以下であるかを判断する(S313)。   On the other hand, if the number of color-reduction blocks G1 exceeds the threshold value, it is determined whether rotation processing is necessary (S312). If rotation processing is not necessary, the size of the color-reduction information is equal to or smaller than a predetermined threshold value. Is determined (S313).

減色情報のサイズが閾値以下の場合は、代表色数Nで代表色圧縮した結果と減色情報を合わせて圧縮結果として出力し(S314)、回転処理が必要な場合(S312のYes)、若しくは、減色情報のサイズが閾値を超えている場合(S313のNo)は、代表色数Nで代表色圧縮を行った結果と減色情報とを用いて、代表色数N+1の代表色圧縮データを生成して出力する(S315)。   If the size of the color reduction information is equal to or smaller than the threshold value, the result of compression of the representative color with the number of representative colors N and the color reduction information are combined and output as the compression result (S314). If rotation processing is necessary (Yes in S312), If the size of the color reduction information exceeds the threshold value (No in S313), representative color compression data of the number of representative colors N + 1 is generated using the result of the representative color compression performed with the number of representative colors N and the color reduction information. And output (S315).

このように、代表色を1色減らしても減色が発生しないブロックの数をカウントすることにより、代表色数Nの代表色圧縮データを生成すべきか、代表色数N−1の代表色圧縮データを生成すべきかを判断することができるため、圧縮データのサイズを縮小することができる。   In this way, by counting the number of blocks in which color reduction does not occur even if the representative color is reduced by one color, representative color compression data with the representative color number N should be generated, or representative color compression data with the representative color number N-1. Therefore, the size of the compressed data can be reduced.

なお、第2の実施例では、代表色を増やした場合でも減色が発生してしまうブロックの数をカウントするカウンタを実装し、本実施例では、代表色数を減らした場合でも減色が発生しないブロックの数をカウントするカウンタを実装したが、双方のカウンタを同時に実装して制御することも可能である。   In the second embodiment, a counter that counts the number of blocks where color reduction occurs even when the representative color is increased is implemented. In this embodiment, no color reduction occurs even when the number of representative colors is reduced. Although a counter that counts the number of blocks is implemented, both counters can be implemented and controlled simultaneously.

また、本発明は上記実施例に限定されるものではなく、本発明の趣旨を逸脱しない限りおいて、その構成や制御は適宜変更可能である。   Further, the present invention is not limited to the above-described embodiments, and the configuration and control thereof can be appropriately changed without departing from the spirit of the present invention.

例えば、前記した第1乃至第3の実施例では、回転処理が発生したら、減色情報のデータは代表色圧縮情報にフィードバック後に、破棄することを前提としている。これは、代表色圧縮データはブロック単位でサイズが固定であるため、データに対して90°単位の回転処理を行う場合でも回転後のアドレス計算が容易であり、ブロック内のデータの位置情報のみを回転させれば良いため、比較的単純な処理で回転可能であるのに対して、減色情報のデータはデータ先頭からの圧縮であり、ブロック毎にサイズが不定であるため、圧縮状態での回転は非常に困難であるからである。   For example, in the first to third embodiments described above, it is assumed that when rotation processing occurs, the color reduction information data is discarded after being fed back to the representative color compression information. This is because the size of the representative color compressed data is fixed in units of blocks, so that even if rotation processing is performed on the data in units of 90 °, it is easy to calculate the address after rotation, and only the position information of the data in the block Can be rotated by a relatively simple process, while the data for color reduction information is compressed from the beginning of the data, and the size of each block is indefinite, so in the compressed state This is because rotation is very difficult.

しかしながら、回転後の代表色圧縮データを伸張した結果に対して、伸張結果が連続した領域としてメモリ上に存在する場合には、ブロック番号から、対応するブロックが配置されているアドレスを計算で求めることは可能であり、求めたアドレスに対応するピクセル情報を、回転を考慮して上書きすることで、可逆伸張が可能となる。従って、回転処理が発生した場合であっても、代表色圧縮データと減色情報を出力することも可能である。   However, if the decompressed result of the representative color compressed data after rotation exists in the memory as a continuous area, the address where the corresponding block is arranged is calculated from the block number. It is possible to perform reversible decompression by overwriting pixel information corresponding to the obtained address in consideration of rotation. Therefore, even when rotation processing occurs, it is possible to output representative color compressed data and subtractive color information.

本発明は、圧縮/伸張した画像を用いて処理を行う装置、例えば、プリンタやスキャナ、複合機(MFP:Multi Function Peripheral)などに利用可能である。   The present invention can be used in apparatuses that perform processing using compressed / expanded images, such as printers, scanners, and multi-function peripherals (MFPs).

10 画像処理装置
10a 制御部
10b 圧縮部
10c 伸張部
10d 処理部
11 入力バッファ
12 代表色抽出回路
13 第1ワークメモリ
14 第2ワークメモリ
15 代表色数比較回路
16 データ制御回路
17 第1出力バッファ
18 第2出力バッファ
19 ピクセル評価回路
20 可逆圧縮回路
21 カウンタ
22 代表色数N設定レジスタ
23 ブロックカウンタ
DESCRIPTION OF SYMBOLS 10 Image processing apparatus 10a Control part 10b Compression part 10c Expansion part 10d Processing part 11 Input buffer 12 Representative color extraction circuit 13 1st work memory 14 2nd work memory 15 Representative color number comparison circuit 16 Data control circuit 17 1st output buffer 18 Second output buffer 19 Pixel evaluation circuit 20 Lossless compression circuit 21 Counter 22 Representative color number N setting register 23 Block counter

Claims (10)

処理対象の画像を複数の領域に分割し、分割した領域毎に代表色を抽出し、領域内の各ピクセルを、抽出した代表色のいずれかに割り当てて圧縮する画像圧縮方式を用いて、前記画像を圧縮して圧縮データを生成する圧縮部と、前記圧縮データを伸張して出力画像を生成する伸張部と、を備える画像処理装置において、
前記圧縮部は、前記画像を圧縮する際に、各々の領域で抽出した代表色の数と予め定めた代表色数とを比較し、前記抽出した代表色の数が前記代表色数を超える所定の領域に対して、前記所定の領域を特定する情報と、前記抽出した代表色から外れた色の所定のピクセルを特定する情報と、前記所定のピクセルの元の色を特定する情報と、を含む減色情報を生成して可逆圧縮すると共に、前記所定の領域の数を第1のカウンタでカウントし、前記第1のカウンタのカウント値が予め定めたカウント閾値を超える場合は、前記減色情報のサイズと予め定めたサイズ閾値とを比較し、前記減色情報のサイズが前記サイズ閾値以下の場合は、前記画像の圧縮データと可逆圧縮した減色情報とを出力し、
前記伸張部は、前記画像の圧縮データと前記可逆圧縮した減色情報とを伸張した後、前記所定の領域の前記所定のピクセルの色を前記元の色に置き換えて前記画像を復元する、
ことを特徴とする画像処理装置。
The image to be processed is divided into a plurality of regions, a representative color is extracted for each divided region, and each pixel in the region is compressed by assigning to one of the extracted representative colors, In an image processing apparatus comprising: a compression unit that compresses an image to generate compressed data; and a decompression unit that decompresses the compressed data to generate an output image.
When the image is compressed, the compression unit compares the number of representative colors extracted in each region with a predetermined number of representative colors, and the number of extracted representative colors exceeds the number of representative colors. Information for specifying the predetermined region, information for specifying a predetermined pixel of a color deviating from the extracted representative color, and information for specifying an original color of the predetermined pixel. The color reduction information is generated and losslessly compressed, and the number of the predetermined areas is counted by a first counter. If the count value of the first counter exceeds a predetermined count threshold, the color reduction information Comparing the size with a predetermined size threshold, and if the size of the subtractive color information is less than or equal to the size threshold, output the compressed data of the image and the losslessly subtracted color information,
The decompression unit decompresses the compressed data of the image and the losslessly compressed color reduction information, and then restores the image by replacing the color of the predetermined pixel in the predetermined region with the original color.
An image processing apparatus.
前記圧縮部は、更に、前記画像の圧縮データに対して回転処理が適用されるかを判断し、前記減色情報のサイズが前記サイズ閾値以下であり、かつ、前記画像の圧縮データに対して回転処理が適用されない場合は、前記画像の圧縮データと前記可逆圧縮した減色情報とを出力する、
ことを特徴とする請求項1に記載の画像処理装置。
The compression unit further determines whether rotation processing is applied to the compressed data of the image, the size of the color reduction information is equal to or smaller than the size threshold value, and is rotated with respect to the compressed data of the image. When processing is not applied, the compressed data of the image and the losslessly compressed color reduction information are output.
The image processing apparatus according to claim 1.
前記圧縮部は、前記減色情報のサイズが前記サイズ閾値を超えるか、若しくは、前記画像の圧縮データに対して回転処理が適用される場合は、前記画像の圧縮データと前記可逆圧縮した減色情報とを用いて、前記代表色数に1を加算した新たな代表色数に基づく圧縮データを生成して出力する、
ことを特徴とする請求項1又は2に記載の画像処理装置。
When the size of the color reduction information exceeds the size threshold or rotation processing is applied to the compressed data of the image, the compression unit includes the compressed data of the image and the losslessly compressed color reduction information. To generate and output compressed data based on a new representative color number obtained by adding 1 to the representative color number,
The image processing apparatus according to claim 1, wherein the image processing apparatus is an image processing apparatus.
前記圧縮部は、更に、前記所定の領域に対して、前記抽出した代表色の数と前記代表色数に1を加算した代表色数とを比較し、前記抽出した代表色の数が前記1を加算した代表色数を超える領域の数を第2のカウンタでカウントし、前記第1のカウンタが前記カウント閾値を超え、かつ、前記第2のカウンタのカウント値が予め定めたカウント閾値を超える場合は、前記画像の圧縮データと前記可逆圧縮した減色情報とを用いて、前記代表色数に2を加算した新たな代表色数に基づく圧縮データを生成して出力する、
ことを特徴とする請求項3に記載の画像処理装置。
The compression unit further compares the number of representative colors extracted with the number of representative colors obtained by adding 1 to the number of representative colors, and the number of representative colors extracted is 1 for the predetermined region. The number of areas exceeding the number of representative colors obtained by adding is counted by a second counter, the first counter exceeds the count threshold, and the count value of the second counter exceeds a predetermined count threshold In this case, using the compressed data of the image and the lossless color-reduced color information, compressed data based on a new representative color number obtained by adding 2 to the representative color number is generated and output.
The image processing apparatus according to claim 3.
前記圧縮部は、更に、前記抽出した代表色の数が前記代表色数以下となる領域に対して、前記抽出した代表色の数と前記代表色数から1を減算した代表色数とを比較し、前記抽出した代表色の数が前記1を減算した代表色数以下となる領域の数を第3のカウンタでカウントし、前記第1のカウンタのカウント値が前記カウント閾値以下であり、かつ、前記第3のカウンタのカウント値が予め定めたカウント閾値以上の場合は、前記画像の圧縮データと前記可逆圧縮した減色情報とを用いて、前記代表色数から1を減算した新たな代表色数に基づく圧縮データを生成して出力する、
ことを特徴とする請求項1又2に記載の画像処理装置。
The compression unit further compares the number of representative colors extracted and the number of representative colors obtained by subtracting 1 from the number of representative colors for an area where the number of representative colors extracted is equal to or less than the number of representative colors. A third counter is used to count the number of areas where the number of extracted representative colors is equal to or less than the number of representative colors obtained by subtracting 1, and the count value of the first counter is equal to or less than the count threshold; If the count value of the third counter is greater than or equal to a predetermined count threshold value, a new representative color obtained by subtracting 1 from the number of representative colors using the compressed data of the image and the losslessly compressed color reduction information Generate and output compressed data based on numbers,
The image processing apparatus according to claim 1, wherein the image processing apparatus is an image processing apparatus.
処理対象の画像を複数の領域に分割し、分割した領域毎に代表色を抽出し、領域内の各ピクセルを、抽出した代表色のいずれかに割り当てて圧縮する画像圧縮方式を用いて、前記画像を圧縮して圧縮データを生成し、前記圧縮データを伸張して出力画像を生成する装置における画像処理方法であって、
前記画像を圧縮する際に、各々の領域で抽出した代表色の数と予め定めた代表色数とを比較し、前記抽出した代表色の数が前記代表色数を超える所定の領域に対して、前記所定の領域を特定する情報と、前記抽出した代表色から外れた色の所定のピクセルを特定する情報と、前記所定のピクセルの元の色を特定する情報と、を含む減色情報を生成して可逆圧縮すると共に、前記所定の領域の数を第1のカウンタでカウントする第1の処理と、
前記第1のカウンタのカウント値が予め定めたカウント閾値を超える場合は、前記減色情報のサイズと予め定めたサイズ閾値とを比較し、前記減色情報のサイズが前記サイズ閾値以下の場合は、前記画像の圧縮データと可逆圧縮した減色情報とを出力する第2の処理と、
前記画像の圧縮データと前記可逆圧縮した減色情報とを伸張した後、前記所定の領域の前記所定のピクセルの色を前記元の色に置き換えて前記画像を復元する第3の処理と、を実行する、
ことを特徴とする画像処理方法。
The image to be processed is divided into a plurality of regions, a representative color is extracted for each divided region, and each pixel in the region is compressed by assigning to one of the extracted representative colors, An image processing method in an apparatus for compressing an image to generate compressed data and decompressing the compressed data to generate an output image,
When compressing the image, the number of representative colors extracted in each region is compared with a predetermined number of representative colors, and for a predetermined region where the number of extracted representative colors exceeds the number of representative colors. Generating subtractive color information including information for specifying the predetermined region, information for specifying a predetermined pixel of a color deviating from the extracted representative color, and information for specifying an original color of the predetermined pixel And reversibly compressing, and a first process of counting the number of the predetermined areas by a first counter;
When the count value of the first counter exceeds a predetermined count threshold, the size of the color reduction information is compared with a predetermined size threshold, and when the size of the color reduction information is equal to or smaller than the size threshold, A second process for outputting compressed image data and losslessly compressed color reduction information;
Performing a third process of decompressing the compressed data of the image and the losslessly compressed color reduction information, and then restoring the image by replacing the color of the predetermined pixel in the predetermined region with the original color To
An image processing method.
前記第2の処理では、更に、前記画像の圧縮データに対して回転処理が適用されるかを判断し、前記減色情報のサイズが前記サイズ閾値以下であり、かつ、前記画像の圧縮データに対して回転処理が適用されない場合は、前記画像の圧縮データと前記可逆圧縮した減色情報とを出力する、
ことを特徴とする請求項6に記載の画像処理方法。
In the second process, it is further determined whether a rotation process is applied to the compressed data of the image, the size of the color reduction information is equal to or smaller than the size threshold, and the compressed data of the image If the rotation process is not applied, the compressed data of the image and the losslessly compressed color reduction information are output.
The image processing method according to claim 6.
前記第2の処理では、前記減色情報のサイズが前記サイズ閾値を超えるか、若しくは、前記画像の圧縮データに対して回転処理が適用される場合は、前記画像の圧縮データと前記可逆圧縮した減色情報とを用いて、前記代表色数に1を加算した新たな代表色数に基づく圧縮データを生成して出力する、
ことを特徴とする請求項6又は7に記載の画像処理方法。
In the second processing, when the size of the color reduction information exceeds the size threshold or when rotation processing is applied to the compressed data of the image, the compressed data of the image and the losslessly compressed color reduction are applied. Generating and outputting compressed data based on a new representative color number obtained by adding 1 to the representative color number using the information,
The image processing method according to claim 6, wherein the image processing method is an image processing method.
前記第1の処理では、更に、前記所定の領域に対して、前記抽出した代表色の数と前記代表色数に1を加算した代表色数とを比較し、前記抽出した代表色の数が前記1を加算した代表色数を超える領域の数を第2のカウンタでカウントし、
前記第2の処理では、前記第1のカウンタが前記カウント閾値を超え、かつ、前記第2のカウンタのカウント値が予め定めたカウント閾値を超える場合は、前記画像の圧縮データと前記可逆圧縮した減色情報とを用いて、前記代表色数に2を加算した新たな代表色数に基づく圧縮データを生成して出力する、
ことを特徴とする請求項8に記載の画像処理方法。
In the first process, for the predetermined region, the number of representative colors extracted is compared with the number of representative colors obtained by adding 1 to the number of representative colors. The number of areas exceeding the representative color number obtained by adding 1 is counted by the second counter,
In the second process, when the first counter exceeds the count threshold and the count value of the second counter exceeds a predetermined count threshold, the compressed data of the image and the lossless compression are performed. Generating and outputting compressed data based on a new representative color number obtained by adding 2 to the representative color number using the subtractive color information;
The image processing method according to claim 8.
前記第1の処理では、更に、前記抽出した代表色の数が前記代表色数以下となる領域に対して、前記抽出した代表色の数と前記代表色数から1を減算した代表色数とを比較し、前記抽出した代表色の数が前記1を減算した代表色数以下となる領域の数を第3のカウンタでカウントし、
前記第2の処理では、前記第1のカウンタのカウント値が前記カウント閾値以下であり、かつ、前記第3のカウンタのカウント値が予め定めたカウント閾値以上の場合は、前記画像の圧縮データと前記可逆圧縮した減色情報とを用いて、前記代表色数から1を減算した新たな代表色数に基づく圧縮データを生成して出力する、
ことを特徴とする請求項6又7に記載の画像処理方法。
In the first process, for the region where the number of representative colors extracted is equal to or less than the number of representative colors, the number of representative colors extracted and the number of representative colors obtained by subtracting 1 from the number of representative colors; And the third counter counts the number of areas where the number of extracted representative colors is equal to or less than the number of representative colors obtained by subtracting 1;
In the second process, when the count value of the first counter is less than or equal to the count threshold value and the count value of the third counter is greater than or equal to a predetermined count threshold value, the compressed data of the image and Generating and outputting compressed data based on a new representative color number obtained by subtracting 1 from the representative color number using the losslessly compressed color reduction information;
The image processing method according to claim 6 or 7,
JP2010285755A 2010-12-22 2010-12-22 Image processing apparatus and image processing method Expired - Fee Related JP5549937B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2010285755A JP5549937B2 (en) 2010-12-22 2010-12-22 Image processing apparatus and image processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2010285755A JP5549937B2 (en) 2010-12-22 2010-12-22 Image processing apparatus and image processing method

Publications (2)

Publication Number Publication Date
JP2012134807A true JP2012134807A (en) 2012-07-12
JP5549937B2 JP5549937B2 (en) 2014-07-16

Family

ID=46649859

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010285755A Expired - Fee Related JP5549937B2 (en) 2010-12-22 2010-12-22 Image processing apparatus and image processing method

Country Status (1)

Country Link
JP (1) JP5549937B2 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000333017A (en) * 1999-03-12 2000-11-30 Seiko Epson Corp Image processor for compression and expansion and electronic printer utilizing the same
JP2007088687A (en) * 2005-09-21 2007-04-05 Fuji Xerox Co Ltd Image processing apparatus, image processing method and program thereof
JP2007151085A (en) * 2005-10-31 2007-06-14 Konica Minolta Business Technologies Inc Compression method of image data, expansion method, and their devices
JP2008311792A (en) * 2007-06-12 2008-12-25 Canon Inc Device for encoding image and control method therefor

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000333017A (en) * 1999-03-12 2000-11-30 Seiko Epson Corp Image processor for compression and expansion and electronic printer utilizing the same
JP2007088687A (en) * 2005-09-21 2007-04-05 Fuji Xerox Co Ltd Image processing apparatus, image processing method and program thereof
JP2007151085A (en) * 2005-10-31 2007-06-14 Konica Minolta Business Technologies Inc Compression method of image data, expansion method, and their devices
JP2008311792A (en) * 2007-06-12 2008-12-25 Canon Inc Device for encoding image and control method therefor

Also Published As

Publication number Publication date
JP5549937B2 (en) 2014-07-16

Similar Documents

Publication Publication Date Title
US9734439B2 (en) Image processing apparatus and method thereof
EP2481206B1 (en) Image processing apparatus and processing method therefor
JP5132517B2 (en) Image processing apparatus and image processing method
JP4861967B2 (en) Image processing apparatus, image processing method, image processing program, image forming apparatus, and storage medium
JP2008042688A (en) Image processing apparatus and control method thereof, and computer program and computer readable storage medium
JP2010171552A (en) Image forming apparatus, control method, and program
CN101800827A (en) Device and method
JPH04261265A (en) Picture processor
JP5549937B2 (en) Image processing apparatus and image processing method
JPH1070654A (en) Image processor
JP6882043B2 (en) Image processing equipment, programs and image processing methods
JP4901692B2 (en) Image processing apparatus, image processing method, image processing program, and recording medium
JP2010118760A (en) Image processing apparatus
JP3596221B2 (en) Image processing device
JP5696697B2 (en) Image processing apparatus and image processing method
JP2011139162A (en) Image encoding device, control method, and program
JP2001199135A (en) Apparatus and method for controlling printing and memory medium
JP2007281823A (en) Image processing apparatus and image forming apparatus
JP6210354B2 (en) Image processing apparatus and image processing method
US10571840B2 (en) Image processing apparatus, method of controlling the same, and storage medium
JP4973550B2 (en) Image processing device
JP2007286750A (en) Image processing device and image formation device
JP2006231854A (en) Image formation device and its controlling method
JP2001285633A (en) Image processing apparatus and storage medium
JPH06209393A (en) Picture processor and diagnostic method for the same

Legal Events

Date Code Title Description
A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A712

Effective date: 20130417

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20130618

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20140411

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20140425

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20140508

R150 Certificate of patent or registration of utility model

Ref document number: 5549937

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees