JP6206641B2 - Electronic document file compression device - Google Patents

Electronic document file compression device Download PDF

Info

Publication number
JP6206641B2
JP6206641B2 JP2013098092A JP2013098092A JP6206641B2 JP 6206641 B2 JP6206641 B2 JP 6206641B2 JP 2013098092 A JP2013098092 A JP 2013098092A JP 2013098092 A JP2013098092 A JP 2013098092A JP 6206641 B2 JP6206641 B2 JP 6206641B2
Authority
JP
Japan
Prior art keywords
image data
electronic document
data
document file
resolution
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.)
Expired - Fee Related
Application number
JP2013098092A
Other languages
Japanese (ja)
Other versions
JP2014220629A (en
Inventor
茂出木 敏雄
敏雄 茂出木
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.)
Dai Nippon Printing Co Ltd
Original Assignee
Dai Nippon Printing 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 Dai Nippon Printing Co Ltd filed Critical Dai Nippon Printing Co Ltd
Priority to JP2013098092A priority Critical patent/JP6206641B2/en
Publication of JP2014220629A publication Critical patent/JP2014220629A/en
Application granted granted Critical
Publication of JP6206641B2 publication Critical patent/JP6206641B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Description

本発明は、電子文書ファイルの圧縮に関し、特に、鮮明さが必要な部分の解像度を落とさずに効率的な圧縮を行うための技術に関する。   The present invention relates to compression of an electronic document file, and more particularly to a technique for performing efficient compression without reducing the resolution of a portion that requires sharpness.

電子文書の標準的な方式としてAdobe Systemsが提案したPDF (Portable Document Format:登録商標)は、ISO標準になり、当初のプリント出力物を画面で閲覧できるようにするといった用途を超えて、ハイエンドでは印刷製版分野でのデータ交換からローエンドでは携帯情報端末での文書閲覧に至るまで広範な分野に普及した。印刷製版分野では、データ量の制約等は考慮せず、できるだけ高精細な画像や文字フォントを埋め込んでデータ交換すれば良い。しかし、PCに比べ画面や処理能力が小さい電子書籍端末やタブレット端末で閲覧される用途においては、データ量をあまり大きくすることができず、表示品質面で新規な問題が生じてきた。   PDF (Portable Document Format (registered trademark)) proposed by Adobe Systems as a standard method for electronic documents has become an ISO standard, and beyond the use of enabling the original printed output to be viewed on the screen, at the high end It has become widespread in a wide range of fields, from data exchange in the printing plate making field to document browsing on a portable information terminal at the low end. In the printing plate making field, data exchange may be performed by embedding a high-definition image or character font as much as possible without considering restrictions on the amount of data. However, in applications where browsing is performed on an electronic book terminal or tablet terminal that has a smaller screen and processing capability than a PC, the amount of data cannot be increased so much that a new problem has arisen in terms of display quality.

印刷物の画像には本文のテキストとは別にキャプション文字が含まれることがあり、近年は画像としてコンピュータ画面をキャプチャしたものが多用され、メニュー画面など小さな文字が付加されていることが多い。このような画像中のキャプション文字に対して、印刷物ではルーペで拡大すれば大抵判読できるが、ディスプレイ画面ではルーペに相当するズーム処理を行うと画素がモザイク状になり、読めないケースが目立つようになった。このような画像中のキャプション文字をディスプレイ画面で判読可能とするためには、元々の画像解像度を比較的高く設定し、圧縮率を大きく(低品質)する必要がある。この場合、画像中の文字部分の輪郭部にモスキートノイズが目立つようになり、デザイン的な美観を損なうという問題がある。   The printed image may include caption characters in addition to the text of the body, and recently, a computer screen captured as an image is often used, and a small character such as a menu screen is often added. For captions in such images, the printed material can often be read by enlarging with a loupe, but on the display screen, if zoom processing equivalent to a loupe is performed, the pixels become mosaic and the case where it cannot be read stands out. became. In order to make caption characters in such an image readable on the display screen, it is necessary to set the original image resolution relatively high and to increase the compression rate (low quality). In this case, there is a problem that mosquito noise becomes conspicuous in the outline portion of the character portion in the image, and the design aesthetics are impaired.

図7に、内容として文字が表現された原画像と、圧縮後に伸張した画像を比較した表示例を示す。原画像を示す図7(a)と圧縮後に伸張した画像を示す図7(b)を比較すると、図7(b)の圧縮後に伸張した画像では、モスキートノイズが目立つことがわかる。このモスキートノイズは、JPEG符号化方式等、DCT(離散コサイン変換)符号化を用いる圧縮に起因するものであり、DCT符号化を使用しない従来の印刷物では発生せず、電子文書特有の現象であるため、印刷物に比べ品質面で劣るという印象を与えてしまう。   FIG. 7 shows a display example in which an original image in which characters are expressed as contents and an image expanded after compression are compared. 7A showing the original image and FIG. 7B showing the image expanded after compression, it can be seen that the mosquito noise is conspicuous in the image expanded after compression in FIG. 7B. This mosquito noise is caused by compression using DCT (Discrete Cosine Transform) encoding such as JPEG encoding method, and is not generated in the conventional printed matter not using DCT encoding, and is a phenomenon peculiar to electronic documents. Therefore, it gives the impression that the quality is inferior to the printed matter.

JPEG符号化方式では、8×8画素(色成分は16×16画素)のブロック単位に独立してDCT符号化を行う方法をとっている。そのため、ブロック間で段差が発生するブロックノイズ(ブロック歪ともいわれる)と、DCT復号化時に高域成分が欠如することによって生じるモスキートノイズの2種類のノイズが原理的に発生する。これらの問題はJPEG符号化方式が開発された当時から知られており、これを改善したJPEG2000という符号化方式も提案されている。JPEG2000ではJPEGにおけるDCTの代わりにウェーブレット変換を使用するようにしたもので、品質面での優位性は認められているが、計算コスト面での問題を考慮するとコストメリットにおいて今一つで、標準化が進められたが普及がなかなか進まなかった。PDF文書でも規格上はJPEG2000をサポートするが、端末側にJPEG2000のデコーダが搭載されているとは限らないため、PDF作成時には従来のJPEGを使用することが推奨される。また、JPEG復号化された画像のブロックノイズやモスキートノイズを画像処理で削減し、尖鋭化を図る手法が提案されている(特許文献1−3参照)。   The JPEG encoding method employs a method of performing DCT encoding independently for each block of 8 × 8 pixels (color component is 16 × 16 pixels). Therefore, two types of noise are generated in principle: block noise (also referred to as block distortion) in which a step is generated between blocks, and mosquito noise that is generated due to the lack of high-frequency components during DCT decoding. These problems have been known since the time when the JPEG encoding method was developed, and an encoding method called JPEG2000 which improved the problem has been proposed. In JPEG2000, wavelet transform is used instead of DCT in JPEG, and superiority in quality is recognized. However, considering the problem in terms of calculation cost, the cost merit is one more and standardization is proceeding. However, the spread did not progress easily. The PDF document also supports JPEG2000 in the standard, but it is not always equipped with a JPEG2000 decoder on the terminal side, so it is recommended to use conventional JPEG when creating a PDF. In addition, a technique has been proposed in which block noise and mosquito noise in an image subjected to JPEG decoding are reduced by image processing to sharpen the image (see Patent Documents 1-3).

特許第4002599号公報Japanese Patent No. 4002599 特許第4457346号公報Japanese Patent No. 4457346 特開2011-182093号公報JP 2011-182093 A

しかしながら、特許文献1−3に記載の技術では、いずれも、PDF文書内のJPEG画像に対して、これらの技術を適用するために、PDF閲覧ソフトウェア内にこれらの技術を実装する必要があり、現在普及しているAdobe Readerなど既存のPDF閲覧ソフトウェアを使用するだけでは、モスキートノイズを低減することは難しいという問題がある。一方、PDFは、JPEGやJPEG2000等の非可逆圧縮以外に、モスキートノイズの発生が少ないZIP等の可逆圧縮もサポートしている。しかし、可逆圧縮を用いると、データ量が肥大化してしまう(場合により圧縮前より増大することもある)という問題がある。この問題は、画像が貼付されている場合には、PDF以外の電子文書ファイルに符号化する際にも生じる。   However, in any of the techniques described in Patent Documents 1-3, in order to apply these techniques to JPEG images in a PDF document, it is necessary to implement these techniques in PDF viewing software. There is a problem that it is difficult to reduce mosquito noise only by using existing PDF browsing software such as Adobe Reader which is currently popular. On the other hand, PDF supports lossless compression such as ZIP that generates less mosquito noise in addition to lossy compression such as JPEG and JPEG2000. However, when reversible compression is used, there is a problem that the amount of data is enlarged (in some cases, it may increase from before compression). This problem also occurs when encoding an electronic document file other than PDF when an image is attached.

そこで、本発明は、符号化後の符号化電子文書ファイルに適合する可逆画像圧縮方式を使用し、画像中のモスキートノイズの発生を抑えながら、電子文書ファイル全体のデータ量を削減することが可能な電子文書ファイルの圧縮装置を提供することを課題とする。   Therefore, the present invention uses a lossless image compression method suitable for an encoded electronic document file after encoding, and can reduce the data amount of the entire electronic document file while suppressing the occurrence of mosquito noise in the image. It is an object of the present invention to provide a simple electronic document file compression apparatus.

上記課題を解決するため、請求項1に係る発明では、原画像データが貼付された電子文書ファイルを圧縮する装置であって、前記電子文書ファイルに定義されているページ解像度に従いブランク画像データを定義する画像データ定義手段と、前記電子文書ファイルより文字コード、フォントデータ、図形データ、部品画像データのうち、少なくとも1つの文書オブジェクトを順次抽出し、文字コードに対しては指定されたフォントデータを参照しながら文字ラスターデータに変換して前記ブランク画像データの指定された領域を変換された文字ラスターデータと置換し、図形データに対しては図形ラスターデータに変換して前記ブランク画像データの指定された領域を変換された図形ラスターデータと置換し、部品画像データに対しては、指定された倍率および角度で変換し添付されているマスクデータを参照しながら前記ブランク画像データの指定された領域を変換された部品画像データと置換する処理を行うことにより、前記ブランク画像データを更新して更新画像データを作成する画像更新手段と、前記更新画像データに対して、RGB各階調の深さを所定の深さ以下(例えば16階調以下)に低下させることにより全体の色数を所定数以下(例えば256色以下)に低下させた色数削減画像データを作成する色数削減手段と、前記色数削減画像データに対して、可逆圧縮(例えばZIP)を施し、圧縮画像データを作成する画像圧縮手段と、前記圧縮画像データを所定の電子文書形式(例えばPDF)に変換する文書符号化手段と、を有することを特徴とする電子文書ファイルの圧縮装置を提供する。   In order to solve the above-mentioned problem, the invention according to claim 1 is an apparatus for compressing an electronic document file to which original image data is attached, and defines blank image data according to a page resolution defined in the electronic document file. Image data defining means, and at least one document object is sequentially extracted from the character code, font data, graphic data, and component image data from the electronic document file, and the specified font data is referred to for the character code The character raster data is converted into character raster data and the designated area of the blank image data is replaced with the converted character raster data. The graphic data is converted into graphic raster data and the blank image data is designated. Replace the area with the converted graphic raster data, and specify the part image data. The blank image data is updated by performing a process of replacing the designated area of the blank image data with the converted component image data while referring to the mask data attached with the converted magnification and angle. Image updating means for creating updated image data, and reducing the depth of each gradation of RGB to a predetermined depth or less (for example, 16 gradations or less) with respect to the updated image data, thereby determining the total number of colors Color number reduction means for creating color number reduced image data reduced to a number below (eg 256 colors or less) and reversible compression (eg ZIP) on the color number reduced image data to produce compressed image data An electronic document file, comprising: an image compressing unit that converts the compressed image data into a predetermined electronic document format (for example, PDF). Providing compressor Le.

請求項1に係る発明によれば、電子文書ファイル(例えばIllustrator(登録商標))に定義されているページ解像度に従いブランク画像データを定義し、電子文書ファイルより文字コード、フォントデータ、図形データ、部品画像データ等の文書オブジェクトを順次抽出し、文字コードに対しては指定されたフォントデータを参照しながら文字ラスターデータに変換してブランク画像データの指定された領域を変換された文字ラスターデータと置換し、図形データに対しては図形ラスターデータに変換してブランク画像データの指定された領域を変換された図形ラスターデータと置換し、部品画像データに対しては、指定された倍率・角度で変換し添付されているマスクデータを参照しながらブランク画像データの指定された領域を変換された部品画像データと置換する処理を行うことにより、ブランク画像データを更新して更新画像データを作成し、更新画像データに対して、RGB各階調の深さを所定の深さ以下(例えば16階調以下)に低下させることにより全体の色数を所定数以下(例えば256色以下)に低下させた色数削減画像データを作成し、色数削減画像データに対して、可逆圧縮(例えばZIP)を施して圧縮画像データを作成し、圧縮画像データを所定の電子文書形式(例えばPDF)に変換するようにしたので、モスキートノイズの発生を抑えるとともに、電子文書ファイル全体のデータ量を削減することが可能となる。   According to the first aspect of the present invention, blank image data is defined according to the page resolution defined in an electronic document file (for example, Illustrator (registered trademark)), and character codes, font data, graphic data, components are defined from the electronic document file. Document objects such as image data are sequentially extracted and converted to character raster data while referring to the specified font data for the character code to replace the specified area of the blank image data with the converted character raster data. The graphic data is converted to graphic raster data and the specified area of the blank image data is replaced with the converted graphic raster data, and the part image data is converted at the specified magnification and angle. The specified area of the blank image data was converted while referring to the attached mask data. By performing the process of replacing the product image data, the blank image data is updated to create updated image data, and the depth of each RGB gradation is equal to or less than a predetermined depth (for example, 16 gradations) for the updated image data. The color number reduced image data is generated by reducing the total number of colors to a predetermined number or less (for example, 256 colors or less) by reducing the number of colors to the following), and reversible compression (for example, ZIP) is performed on the color number reduced image data. Since the compressed image data is generated and the compressed image data is converted into a predetermined electronic document format (for example, PDF), generation of mosquito noise can be suppressed and the data amount of the entire electronic document file can be reduced. It becomes possible.

また、請求項2に係る発明では、請求項1に係る発明の電子文書ファイルの圧縮装置において、前記電子文書ファイルに貼付されている前記原画像データに対して、RGB各階調の深さを所定の深さ以下(例えば16階調以下)に低下させることにより全体の色数を所定数以下(例えば256色以下)に低下させた第2色数削減画像データを作成する第2色数削減手段と、前記第2色数削減画像データの解像度が所定の解像度である所定解像度を上回る場合、前記第2色数削減画像データを、前記所定解像度より低い値に設定された解像度である設定解像度になるように解像度変換を行う画像解像度変換手段と、前記画像解像度変換手段により解像度変換された第2色数削減画像データまたは前記画像解像度変換手段により解像度変換されなかった第2色数削減画像データのいずれかに対して、可逆圧縮(例えばZIP)を施し、圧縮画像データを作成する第2画像圧縮手段と、前記第2圧縮画像データを前記電子文書ファイルに貼付されていた原画像データに代えて貼付された状態とし、前記電子文書ファイルを所定の電子文書形式(例えばPDF)の符号化電子文書ファイルに変換する第2文書符号化手段と、前記符号化電子文書ファイルと前記電子文書ファイルのデータ量の比較を行うデータ量比較手段と、をさらに有し、前記符号化電子文書ファイルのデータ量が前記電子文書ファイルのデータ量に対して所定の比率以上である場合に、前記画像データ定義手段、画像更新手段、色数削減手段、画像圧縮手段、文書符号化手段による処理が実行されることを特徴とする。   According to a second aspect of the present invention, in the electronic document file compression apparatus according to the first aspect of the present invention, the depth of each RGB gradation is predetermined for the original image data attached to the electronic document file. Second color number reduction means for creating second color number reduced image data in which the total number of colors is reduced to a predetermined number or less (for example, 256 colors or less) When the resolution of the second color number reduced image data exceeds a predetermined resolution which is a predetermined resolution, the second color number reduced image data is set to a set resolution which is a resolution set to a value lower than the predetermined resolution. Image resolution conversion means for performing resolution conversion so that the second color number reduced image data converted by the image resolution conversion means or the image resolution conversion means does not perform resolution conversion. Any one of the second color-reduced image data is subjected to reversible compression (for example, ZIP) to generate compressed image data; and the second compressed image data is stored in the electronic document file. A second document encoding means for converting the electronic document file into an encoded electronic document file in a predetermined electronic document format (for example, PDF), in a state where the electronic document file is pasted instead of the past original image data; Data amount comparing means for comparing the data amount of the electronic document file and the data amount of the electronic document file, wherein the data amount of the encoded electronic document file is greater than or equal to a predetermined ratio with respect to the data amount of the electronic document file In this case, the image data defining means, the image updating means, the color number reducing means, the image compressing means, and the document encoding means are executed.

請求項2に係る発明によれば、電子文書ファイル(例えばIllustrator)に貼付されている原画像データに対して、RGB各階調の深さを所定の深さ以下(例えば16階調以下)に落とすことにより全体の色数を所定数以下(例えば256色以下)に落とした第2色数削減画像データを作成し、第2色数削減画像データの解像度が所定解像度を上回る場合、第2色数削減画像データに対して設定解像度(<所定解像度)になるように解像度変換を行い、解像度変換された色数削減画像データまたは解像度変換されなかった色数削減画像データのいずれかに対して、可逆圧縮(例えばZIP)を施して、第2圧縮画像データを作成し、第2圧縮画像データを電子文書ファイルに貼付されていた原画像データに代えて貼付された状態とし、所定の電子文書形式(例えばPDF)に変換し、符号化電子文書ファイルと電子文書ファイルのデータ量の比較を行って符号化電子文書ファイルのデータ量が電子文書ファイルのデータ量に対して所定の比率以上である場合に、請求項1に係る発明における画像データ定義手段、画像更新手段、色数削減手段、画像圧縮手段、文書符号化手段による処理により符号化電子文書ファイルを作成するようにしたので、文字や図形の品質を高解像度に維持し、文字コードが埋め込まれて全文検索可能とする圧縮手法で十分に圧縮することができない場合に、効率的な圧縮手法により十分な圧縮を行うことが可能となる。   According to the second aspect of the present invention, the RGB gradations are reduced to a predetermined depth or less (for example, 16 gradations or less) with respect to the original image data attached to the electronic document file (for example, Illustrator). Thus, when the second color number reduced image data is generated by reducing the total number of colors to a predetermined number or less (for example, 256 colors or less), and the resolution of the second color number reduced image data exceeds the predetermined resolution, the second color number Resolution conversion is performed so that the reduced image data has a set resolution (<predetermined resolution), and either the color-reduced image data that has undergone resolution conversion or the color-reduced image data that has not undergone resolution conversion is reversible. Compression (for example, ZIP) is performed to create second compressed image data. The second compressed image data is pasted in place of the original image data pasted in the electronic document file, and a predetermined electronic Is converted into a document format (for example, PDF), and the data amount of the encoded electronic document file is compared with the data amount of the electronic document file so that the data amount of the encoded electronic document file is greater than or equal to a predetermined ratio with respect to the data amount of the electronic document file In some cases, the encoded electronic document file is created by the processing by the image data defining means, the image updating means, the color number reducing means, the image compressing means, and the document encoding means in the invention according to claim 1. If the compression method that maintains the quality of images and graphics at a high resolution and the full-text search is possible with embedded character codes, sufficient compression can be performed using an efficient compression method. Become.

また、請求項3に係る発明では、前記文書符号化手段は、前記画像更新手段により前記電子文書ファイルから抽出された文字コードを非描画属性に設定し、指定された割り付け位置を維持しながら電子文書ファイルに付加した後、所定の電子文書形式に変換するようにしていることを特徴とする。   In the invention according to claim 3, the document encoding means sets the character code extracted from the electronic document file by the image update means to a non-drawing attribute, and maintains the designated allocation position while maintaining the specified allocation position. After being added to the document file, it is converted into a predetermined electronic document format.

請求項3に係る発明によれば、電子文書ファイルから抽出された文字コードを非描画属性に設定し、指定された割り付け位置を維持しながら電子文書ファイルに付加した後、PDF等の電子文書形式に変換するようにしたので、PDFファイル等の電子文書ファイルを利用する際、非描画属性に設定された文字コードを利用した全文検索が可能となる。   According to the invention of claim 3, after the character code extracted from the electronic document file is set to the non-drawing attribute and added to the electronic document file while maintaining the designated allocation position, the electronic document format such as PDF Therefore, when an electronic document file such as a PDF file is used, a full text search using a character code set to a non-drawing attribute is possible.

また、請求項4に係る発明では、前記画像圧縮手段は、前記圧縮画像データのデータ量が前記色数削減画像データに比べ所定比率以上に大きい場合、前記色数削減画像データに対して、可逆圧縮(例えばZIP)を施す代わりに、所定の圧縮強度に基づいて非可逆圧縮(例えばJPEG)を施し、非可逆の圧縮画像データを作成するようにしていることを特徴とする。   In the invention according to claim 4, the image compression means is reversible with respect to the color number reduced image data when the data amount of the compressed image data is larger than a predetermined ratio compared to the color number reduced image data. Instead of performing compression (for example, ZIP), irreversible compression (for example, JPEG) is performed based on a predetermined compression strength to generate irreversible compressed image data.

請求項4に係る発明によれば、圧縮画像データのデータ量が色数削減画像データに比べ所定の割合以上に大きい場合、色数削減画像データに対して、ZIP等の可逆圧縮を施す代わりに、所定の圧縮率に基づいてJPEG等の非可逆圧縮を施し、非可逆の圧縮画像データを作成するようにしたので、データ量が際限なく増大することを防止することができる。   According to the fourth aspect of the present invention, when the data amount of the compressed image data is larger than a predetermined ratio compared to the color number reduced image data, instead of performing reversible compression such as ZIP on the color number reduced image data. Since irreversible compression such as JPEG is performed based on a predetermined compression rate and irreversible compressed image data is created, it is possible to prevent the data amount from increasing without limit.

本発明によれば、符号化後の符号化電子文書ファイルに適合する可逆画像圧縮方式を使用し、画像中のモスキートノイズの発生を抑えながら、電子文書ファイル全体のデータ量を削減することが可能となる。   According to the present invention, it is possible to reduce the data amount of the entire electronic document file while using a lossless image compression method suitable for the encoded electronic document file after encoding and suppressing the occurrence of mosquito noise in the image. It becomes.

本発明の一実施形態に係る電子文書ファイルの圧縮装置のハードウェア構成図である。It is a hardware block diagram of the compression apparatus of the electronic document file which concerns on one Embodiment of this invention. 本発明第1の実施形態に係る電子文書ファイルの圧縮装置の構成を示す機能ブロック図である。1 is a functional block diagram showing a configuration of an electronic document file compression apparatus according to a first embodiment of the present invention. 本発明第1の実施形態に係る電子文書ファイルの圧縮装置の処理概要を示すフローチャートである。It is a flowchart which shows the process outline | summary of the compression apparatus of the electronic document file which concerns on the 1st Embodiment of this invention. ステップS13、S25における色数削減を説明するための図である。It is a figure for demonstrating the color number reduction in step S13, S25. 本発明第2の実施形態に係る電子文書ファイルの圧縮装置の構成を示す機能ブロック図である。It is a functional block diagram which shows the structure of the compression apparatus of the electronic document file which concerns on the 2nd Embodiment of this invention. 本発明第2の実施形態に係る電子文書ファイルの圧縮装置の処理概要を示すフローチャートである。It is a flowchart which shows the process outline | summary of the compression apparatus of the electronic document file which concerns on the 2nd Embodiment of this invention. 内容として文字が表現された原画像と、圧縮後に伸張した画像を比較した表示例を示す図である。It is a figure which shows the example of a display which compared the original image in which the character was expressed as a content, and the image expanded after compression. 本発明第3の実施形態に係る電子文書ファイルの圧縮装置の構成を示す機能ブロック図である。It is a functional block diagram which shows the structure of the compression apparatus of the electronic document file which concerns on the 3rd Embodiment of this invention. 本発明第3の実施形態に係る電子文書ファイルの圧縮装置の処理概要を示すフローチャートである。It is a flowchart which shows the process outline | summary of the compression apparatus of the electronic document file which concerns on the 3rd Embodiment of this invention.

以下、本発明の好適な実施形態について図面を参照して詳細に説明する。
<1.第1の実施形態>
<1.1.装置構成>
図1は、本発明第1の実施形態に係る電子文書ファイルの圧縮装置のハードウェア構成図である。本実施形態に係る電子文書ファイルの圧縮装置は、汎用のコンピュータで実現することができ、図1に示すように、CPU(Central Processing Unit)1と、コンピュータのメインメモリであるRAM(Random Access Memory)2と、CPU1が実行するプログラムやデータを記憶するためのハードディスク、フラッシュメモリ等の大容量の記憶装置3と、キーボード、マウス等のキー入力I/F(インターフェース)4と、データ記憶媒体等の外部装置とデータ通信するためのデータ入出力I/F(インターフェース)5と、液晶ディスプレイ等の表示デバイスである表示部6と、を備え、互いにバスを介して接続されている。
DESCRIPTION OF EXEMPLARY EMBODIMENTS Hereinafter, preferred embodiments of the invention will be described in detail with reference to the drawings.
<1. First Embodiment>
<1.1. Device configuration>
FIG. 1 is a hardware configuration diagram of an electronic document file compression apparatus according to the first embodiment of the present invention. The electronic document file compression apparatus according to this embodiment can be realized by a general-purpose computer. As shown in FIG. 1, a CPU (Central Processing Unit) 1 and a RAM (Random Access Memory) which is a main memory of the computer. ) 2, a large-capacity storage device 3 such as a hard disk or flash memory for storing programs and data executed by the CPU 1, a key input I / F (interface) 4 such as a keyboard and a mouse, a data storage medium, etc. A data input / output I / F (interface) 5 for data communication with the external device and a display unit 6 which is a display device such as a liquid crystal display are connected to each other via a bus.

図2は、本実施形態に係る電子文書ファイルの圧縮装置の構成を示す機能ブロック図である。図2において、10は色数削減手段、20は画像解像度変換手段、30は画像圧縮手段、50は文書符号化手段、60は電子文書ファイル記憶手段、70は符号化電子文書ファイル記憶手段である。   FIG. 2 is a functional block diagram showing the configuration of the electronic document file compression apparatus according to this embodiment. In FIG. 2, 10 is a color number reduction unit, 20 is an image resolution conversion unit, 30 is an image compression unit, 50 is a document encoding unit, 60 is an electronic document file storage unit, and 70 is an encoded electronic document file storage unit. .

色数削減手段10は、電子文書ファイル記憶手段60に記憶された電子文書ファイルに貼付されている原画像データに対して、色数を削減して色数削減画像データを作成する処理を行う。画像解像度変換手段20は、色数削減画像データに対して解像度変換を行う。画像圧縮手段30は、画像解像度変換手段20により解像度変換された色数削減画像データと、解像度変換されなかった色数削減画像データの双方に対してZIP圧縮等の可逆圧縮を行い、圧縮画像データを作成する処理を行う。文書符号化手段50は、電子文書ファイルに貼付されていた原画像データに代えて、圧縮画像データを電子文書ファイルに貼付された状態とし、所定の電子文書形式に変換して符号化する処理を行う。   The color number reduction means 10 performs processing for reducing the number of colors and creating color number reduced image data for the original image data attached to the electronic document file stored in the electronic document file storage means 60. The image resolution conversion means 20 performs resolution conversion on the color number reduced image data. The image compression means 30 performs reversible compression such as ZIP compression on both the color-reduced image data whose resolution has been converted by the image resolution conversion means 20 and the color-reduced image data that has not been resolution-converted. Process to create. The document encoding means 50 converts the encoded image data into a state of being attached to the electronic document file in place of the original image data attached to the electronic document file, converts it into a predetermined electronic document format, and encodes it. Do.

電子文書ファイル記憶手段60は、コンピュータで処理可能な電子文書である電子文書ファイルを記憶した記憶手段であり、記憶装置3により実現される。電子文書ファイル記憶手段60に記憶された電子文書ファイルとしては、画像データが貼付された電子文書であれば、MS-Word(登録商標).doc, PowerPoint(登録商標).ppt、Illustrator(登録商標).ai、 InDesign(登録商標).ind等、様々な形式のものが利用可能である。ここで、「貼付」とは、画像データが、電子文書ファイルと論理的に関係付けられていることを意味する。論理的に関係付けられていれば、具体的な態様は限定されない。符号化電子文書ファイル記憶手段70は、圧縮符号化された電子文書ファイルである符号化電子文書ファイルを記憶する記憶手段であり、記憶装置3により実現される。符号化電子文書ファイルとしても、様々な形式のものが利用可能であるが、本実施形態では、汎用的なフォーマットであるPDF形式を用いている。色数削減手段10、画像解像度変換手段20、画像圧縮手段30、文書符号化手段50は、CPU1が、記憶装置3に記憶されているプログラムを実行することにより実現される。   The electronic document file storage unit 60 is a storage unit that stores an electronic document file that is an electronic document that can be processed by a computer, and is realized by the storage device 3. The electronic document file stored in the electronic document file storage means 60 is an MS-Word (registered trademark) .doc, PowerPoint (registered trademark) .ppt, Illustrator (registered trademark) as long as it is an electronic document with image data attached thereto. ) .Ai, InDesign (registered trademark) .ind, etc., can be used in various formats. Here, “attaching” means that the image data is logically related to the electronic document file. As long as it is logically related, a specific aspect is not limited. The encoded electronic document file storage unit 70 is a storage unit that stores an encoded electronic document file that is a compression-encoded electronic document file, and is realized by the storage device 3. Various types of encoded electronic document files can be used, but in this embodiment, the PDF format, which is a general-purpose format, is used. The color number reduction unit 10, the image resolution conversion unit 20, the image compression unit 30, and the document encoding unit 50 are realized by the CPU 1 executing a program stored in the storage device 3.

図2に示した各構成手段は、現実には図1に示したように、コンピュータおよびその周辺機器等のハードウェアに専用のプログラムを搭載することにより実現される。すなわち、コンピュータが、専用のプログラムに従って各手段の内容を実行することになる。なお、本明細書において、コンピュータとは、CPU等の演算処理部を有し、データ処理が可能な装置を意味し、画像品質の確認を行える画面サイズと解像度を備え、画像の解像度変換や圧縮処置などの画像の演算を実用的な応答速度で処理可能な演算速度をもつCPUや記憶装置を備えたデスクトップまたはノート型のパーソナルコンピュータである。   Each component shown in FIG. 2 is actually realized by installing a dedicated program in hardware such as a computer and its peripheral devices as shown in FIG. That is, the computer executes the contents of each means according to a dedicated program. In this specification, a computer means a device that has an arithmetic processing unit such as a CPU and is capable of data processing, and has a screen size and a resolution that can confirm image quality, and performs image resolution conversion and compression. This is a desktop or notebook personal computer having a CPU and a storage device having a calculation speed capable of processing image calculation such as treatment at a practical response speed.

図1に示した記憶装置3には、CPU1を動作させ、コンピュータを、電子文書ファイルの圧縮装置として機能させるための専用のプログラムが実装されている。この専用のプログラムを実行することにより、CPU1は、色数削減手段10、画像解像度変換手段20、画像圧縮手段30、文書符号化手段50としての機能を実現することになる。また、記憶装置3は、電子文書ファイル記憶手段60、符号化電子文書ファイル記憶手段70として機能するだけでなく、電子文書ファイルの圧縮装置としての処理に必要な様々なデータを記憶する。   The storage device 3 shown in FIG. 1 is mounted with a dedicated program for operating the CPU 1 and causing the computer to function as an electronic document file compression device. By executing this dedicated program, the CPU 1 realizes functions as the color number reduction unit 10, the image resolution conversion unit 20, the image compression unit 30, and the document encoding unit 50. The storage device 3 not only functions as the electronic document file storage unit 60 and the encoded electronic document file storage unit 70 but also stores various data necessary for processing as an electronic document file compression device.

<1.2.処理動作>
次に、図1、図2に示した電子文書ファイルの圧縮装置の処理動作について説明する。図3は、本発明第1の実施形態に係る電子文書ファイルの圧縮装置の処理概要を示すフローチャートである。まず、色数削減手段10が、電子文書ファイル記憶手段60に記憶された電子文書ファイルから、文書オブジェクトを抽出する(ステップS11)。具体的には、電子文書ファイルの形式に応じて、電子文書ファイルに貼付されている文字コード、図形データ、画像データ等の文書オブジェクトを抽出する。
<1.2. Processing action>
Next, the processing operation of the electronic document file compression apparatus shown in FIGS. 1 and 2 will be described. FIG. 3 is a flowchart showing an outline of processing of the electronic document file compression apparatus according to the first embodiment of the present invention. First, the color number reduction unit 10 extracts a document object from the electronic document file stored in the electronic document file storage unit 60 (step S11). Specifically, document objects such as character codes, graphic data, and image data attached to the electronic document file are extracted according to the format of the electronic document file.

次に、色数削減手段10は、抽出した文書オブジェクトが画像データであるかどうかを判定する(ステップS12)。抽出した文書オブジェクトが画像データであると判定された場合には、抽出した文書オブジェクトが、電子文書ファイルに貼付されていた原画像データであることを示すので、色数削減手段10は、抽出した文書オブジェクトを原画像データとし、原画像データに対して色数削減処理を行う(ステップS13)。具体的には、RGB等の各色の階調を低下させることにより、全体の色数を削減する。   Next, the color number reduction means 10 determines whether or not the extracted document object is image data (step S12). If it is determined that the extracted document object is image data, it indicates that the extracted document object is original image data attached to the electronic document file. The document object is set as original image data, and the number of colors is reduced with respect to the original image data (step S13). Specifically, the total number of colors is reduced by lowering the gradation of each color such as RGB.

図4は、ステップS13における色数削減処理を説明するための図である。図4(a)は、原画像データを構成するオリジナル画素のビット配列を示しており、図4(b)は、色数削減画像データを構成する画素のビット配列を示している。図4(a)に示すように、本実施形態では、原画像データがR、G、B各色が8ビットで表現されているので、各色は256階調の深さを持っている。ステップS13の色数削減処理において、色数削減手段10は、Rを3ビット8階調、Gを3ビット8階調、Bを2ビット4階調に低下させる。この結果、図4(b)に示すように、全体として8ビット256色の色数削減画像データが得られる。図4の例では、R、G、Bの階調がそれぞれ1/32、1/32、1/64に削減されることになる。画像データは画素あたり24ビットから8ビットで符号化し、新たにカラールックアップテーブル(画素インデックス値からRGB値への変換テーブル)を定義して添付する。図4に示した手法以外にも、公知の色数削減手法を用いることができる。色数削減手段10は、複数の色数削減手法を設定可能に構成されており、色数削減手法設定手段として機能するキー入力I/F4を介した指示に従って、指示された色数削減手法を実行するように、色数削減手段10を設定する。   FIG. 4 is a diagram for explaining the color number reduction processing in step S13. 4A shows a bit arrangement of original pixels constituting the original image data, and FIG. 4B shows a bit arrangement of pixels constituting the color number reduced image data. As shown in FIG. 4A, in this embodiment, since the original image data represents each color of R, G, and B with 8 bits, each color has a depth of 256 gradations. In the color number reduction process in step S13, the color number reduction means 10 reduces R to 3 bits and 8 gradations, G to 3 bits and 8 gradations, and B to 2 bits and 4 gradations. As a result, as shown in FIG. 4B, 8-bit 256 color-reduced image data is obtained as a whole. In the example of FIG. 4, the R, G, and B gradations are reduced to 1/32, 1/32, and 1/64, respectively. The image data is encoded from 24 bits to 8 bits per pixel, and a new color lookup table (pixel index value to RGB value conversion table) is defined and attached. In addition to the method shown in FIG. 4, a known color number reduction method can be used. The color number reduction unit 10 is configured to be able to set a plurality of color number reduction methods, and in accordance with the instruction via the key input I / F 4 functioning as the color number reduction method setting unit, the instructed color number reduction method is performed. The color number reduction means 10 is set so as to be executed.

画像を圧縮伸張した際に、モスキートノイズが目立つのは、ソース画像が実質的に二値に近くコントラストが高いモノクロ画像で、生成されるモスキートノイズはハーフトーンになる。例えば、ソース画像の背景が白色で文字が黒色で表現された文字画像である場合、生成されるモスキートノイズは白または黒に近いグレー色になる。しかし、256階調から数段階の階調に色数制限を施すと、白に近いグレー色は白に、黒に近いグレー色は黒に近似されてしまうため、ハーフトーンのモスキートノイズは表現されなくなる。一方ソースのモノクロ画像は、データ形式上は256階調をもつが、実用上は4〜8階調程度に低下させても問題ない。2階調に低下させると、文字輪郭部にジャギーが発生するので、アンチエイリアシング効果を維持するために4階調以上は必要である。そこで、本実施形態では、カラー画像の場合は、RGB各256階調から各々4〜8階調に低下させ、色数をフルカラーの約1600万色(256の3乗)から256色程度に減少させている。   When the image is compressed and expanded, the mosquito noise is conspicuous when the source image is a monochrome image that is substantially binary and has high contrast, and the generated mosquito noise is halftone. For example, when the source image is a character image in which the background is white and the characters are expressed in black, the generated mosquito noise is white or a gray color close to black. However, if the number of colors is limited from 256 tones, the gray color close to white is approximated to white, and the gray color close to black is approximated to black, so halftone mosquito noise is expressed. Disappear. On the other hand, the monochrome image of the source has 256 gradations in the data format, but there is no problem even if it is reduced to about 4 to 8 gradations in practice. If the gradation is reduced to two gradations, jaggy is generated in the character outline portion, so that four gradations or more are necessary to maintain the anti-aliasing effect. Therefore, in the present embodiment, in the case of a color image, the RGB is reduced from 256 tones to 4 to 8 each, and the number of colors is reduced from about 16 million colors (256 to the cube of 256) to about 256 colors. I am letting.

次に、画像解像度変換手段20が、色数削減画像データの解像度が所定の解像度である所定解像度より大きいか否かを判定する(ステップS14)。所定解像度としては、状況に応じて適宜設定しておくことが可能である。ステップS14において、色数削減画像データの解像度が所定解像度より大きいと判定された場合には、画像解像度変換手段20は、色数削減画像データの解像度を、事前に設定された解像度である設定解像度になるように変換する(ステップS15)。具体的には、(設定解像度)/(色数削減画像データの解像度)の比率で色数削減画像データを縮小する処理を行う。これにより、画素数が減少し、解像度が低下した色数削減画像データが得られる。解像度を低下させるため、色数削減画像データを縮小する手法としては、ニアレストネイバー、バイリニア、バイキュービック等、公知の種々の技術を用いることができるが、本実施形態では、最も品質が良いバイキュービック法を採用している。   Next, the image resolution conversion means 20 determines whether or not the resolution of the color number reduced image data is larger than a predetermined resolution which is a predetermined resolution (step S14). The predetermined resolution can be appropriately set according to the situation. If it is determined in step S14 that the resolution of the color number reduced image data is greater than the predetermined resolution, the image resolution conversion means 20 sets the resolution of the color number reduced image data to a preset resolution that is a preset resolution. (Step S15). Specifically, a process of reducing the color number reduced image data at a ratio of (set resolution) / (resolution of the color number reduced image data) is performed. As a result, color-reduced image data with a reduced number of pixels and reduced resolution is obtained. Various known techniques such as nearest neighbor, bilinear, bicubic, and the like can be used as a technique for reducing the number of color-reduced image data in order to reduce the resolution. The cubic method is adopted.

ステップS14およびS15により、色数削減画像データの解像度が所定解像度より大きい場合に限り、色数削減画像データの解像度は、小さくなるように変換されることになる。このため、色数削減画像データの解像度は、必ず所定解像度以下となり、ある程度見易い解像度を保ったまま、データ量を削減することができる。所定解像度と設定解像度の関係としては、所定解像度が設定解像度より大きいという条件を満たせば、この条件の範囲内で適宜設定することができるが、本実施形態では、設定解像度に1.5を乗じたものを所定解像度としている。したがって、例えば、設定解像度が300PPI(Pixel Per Inch)、所定解像度が450PPIである場合、解像度が450PPIを超える色数削減画像データは、300PPIに解像度変換される。   By steps S14 and S15, only when the resolution of the color number reduced image data is larger than the predetermined resolution, the resolution of the color number reduced image data is converted to be smaller. For this reason, the resolution of the color-reduced image data is always equal to or lower than the predetermined resolution, and the data amount can be reduced while maintaining a resolution that is easy to see to some extent. As a relationship between the predetermined resolution and the set resolution, if the condition that the predetermined resolution is larger than the set resolution is satisfied, it can be appropriately set within the range of this condition. In the present embodiment, the set resolution is multiplied by 1.5. Is set to a predetermined resolution. Therefore, for example, when the set resolution is 300 PPI (Pixel Per Inch) and the predetermined resolution is 450 PPI, the color-reduced image data whose resolution exceeds 450 PPI is converted to 300 PPI.

設定解像度に1.5を乗じたものを所定解像度とした理由は、読み込んだ画像データの解像度が例えば301PPIなど端数をもち、所定解像度が300PPIの場合、ステップS15に進み解像度変換処理が行われてしまう。解像度変換処理は、たとえバイキュービック法を用いても画質の劣化が避けられず、可能な限り実行されないことが望ましい。そこで、読み込んだ色数削減画像データの解像度が301〜450PPIの境界範囲であれば、ステップS15に進まないように所定解像度の値を設定解像度より若干大きくする。   The reason for setting the predetermined resolution by multiplying the set resolution by 1.5 is that if the resolution of the read image data has a fraction such as 301 PPI and the predetermined resolution is 300 PPI, the process proceeds to step S15 and resolution conversion processing is performed. End up. Even if the bicubic method is used, the resolution conversion process cannot avoid deterioration of the image quality, and is preferably not performed as much as possible. Therefore, if the resolution of the read color-reduced image data is within the boundary range of 301 to 450 PPI, the value of the predetermined resolution is made slightly larger than the set resolution so as not to proceed to step S15.

次に、画像圧縮手段30が、色数削減画像データの圧縮符号化を行う(ステップS16)。ステップS16では、画像解像度変換手段20により解像度が変換された色数削減画像データ、解像度が変換されなかった色数削減画像データのいずれについても可逆圧縮方式で圧縮を行い、圧縮画像データを作成する。可逆圧縮方式については、公知の種々の方式を用いることができるが、本実施形態では、ZIP方式を用いている。   Next, the image compression means 30 performs compression encoding of the color number reduced image data (step S16). In step S16, both the color-reduced image data whose resolution has been converted by the image resolution conversion means 20 and the color-reduced image data whose resolution has not been converted are both compressed using the lossless compression method to create compressed image data. . As the lossless compression method, various known methods can be used, but in this embodiment, the ZIP method is used.

ステップS16において、画像圧縮手段30は、さらに、作成した圧縮画像データのデータ量が、圧縮前の色数削減画像データのデータ量に所定比率乗じたものより大きいか否かを判定する。所定比率としては、25%以上、75%以下であることが好ましい。本実施形態では、所定比率を“50%”に設定している。圧縮画像データのデータ量が、圧縮前の色数削減画像データのデータ量に所定比率乗じたものより大きい場合は、圧縮前の色数削減画像データに対して、非可逆圧縮方式で圧縮を行い、圧縮画像データとして作成する。圧縮強度は、事前に設定された所定の圧縮強度で行う。非可逆圧縮方式については、公知の種々の方式を用いることができるが、本実施形態では、JPEG方式を用いている。   In step S16, the image compression means 30 further determines whether or not the data amount of the created compressed image data is larger than the data amount of the color number reduced image data before compression multiplied by a predetermined ratio. The predetermined ratio is preferably 25% or more and 75% or less. In the present embodiment, the predetermined ratio is set to “50%”. If the data amount of compressed image data is larger than the data amount of color-reduced image data before compression multiplied by a predetermined ratio, the color-reduced image data before compression is compressed using the lossy compression method. Created as compressed image data. The compression strength is set at a predetermined compression strength set in advance. As the irreversible compression method, various known methods can be used, but in this embodiment, the JPEG method is used.

フルカラー画像の場合は必ず非可逆圧縮方式の方が、可逆圧縮方式よりもデータ量が小さくなるが、色数削減画像データの場合は逆にもなり得る。しかし、非可逆圧縮方式の方が、可逆圧縮方式よりもデータ量を小さくすることができる場合が多いため、ステップS16における画像圧縮手段30の処理により、圧縮画像データのデータ量は、色数削減画像データのデータ量に所定比率を乗じた値以下となる。   In the case of a full color image, the lossy compression method always has a smaller amount of data than the lossless compression method, but in the case of image data with a reduced number of colors, the reverse is also possible. However, since the irreversible compression method can reduce the data amount more often than the lossless compression method, the data amount of the compressed image data is reduced by the number of colors by the processing of the image compression means 30 in step S16. It is below the value obtained by multiplying the data amount of the image data by a predetermined ratio.

一方、ステップS11において抽出された文書オブジェクトが画像データでないと判定された場合は、その文書オブジェクトに対して、ステップS13〜S16の処理は行われない。1つの文書オブジェクトに対する処理が終了するごとに、全文書オブジェクトに対して処理が終了したかどうかを判定する(ステップS17)。全文書オブジェクトに対して処理が終了していない場合は、ステップS11に戻って、次の文書オブジェクトを抽出する。全文書オブジェクトに対して処理が終了した場合は、文書符号化手段50が、電子文書ファイルの符号化処理を行う(ステップS18)。   On the other hand, when it is determined in step S11 that the document object extracted is not image data, the processes in steps S13 to S16 are not performed on the document object. Each time processing for one document object is completed, it is determined whether processing has been completed for all document objects (step S17). If the processing has not been completed for all document objects, the process returns to step S11 to extract the next document object. When the processing is completed for all the document objects, the document encoding unit 50 performs encoding processing of the electronic document file (step S18).

電子文書ファイルの符号化処理については、公知の種々の形式を用いることができるが、本実施形態では、PDF形式を用いている。具体的には、圧縮画像データを他の文書オブジェクトと同様に、電子文書ファイルに貼付し、PDF形式等の符号化電子文書ファイルに変換する。この処理は、Acrobat(登録商標)等の公知のPDF変換アプリケーションと同様のアルゴリズムを用いて行われる。   Various known formats can be used for the encoding process of the electronic document file, but in this embodiment, the PDF format is used. Specifically, the compressed image data is pasted into an electronic document file in the same manner as other document objects, and converted into an encoded electronic document file such as a PDF format. This process is performed using an algorithm similar to a known PDF conversion application such as Acrobat (registered trademark).

<2.第2の実施形態>
<2.1.装置構成>
次に、本発明第2の実施形態に係る電子文書ファイルの圧縮装置について説明する。図5は、第2の実施形態に係る電子文書ファイルの圧縮装置の構成を示す機能ブロック図である。第2の実施形態では、ハードウェア構成は、第1の実施形態と同一であり、図1に示したようなものとなっている。図5において、11は画像定義手段、21は画像更新手段、31は色数削減手段、41は画像圧縮手段、51は文書符号化手段、61は電子文書ファイル記憶手段、71は符号化電子文書ファイル記憶手段である。
<2. Second Embodiment>
<2.1. Device configuration>
Next, an electronic document file compression apparatus according to the second embodiment of the present invention will be described. FIG. 5 is a functional block diagram showing the configuration of the electronic document file compression apparatus according to the second embodiment. In the second embodiment, the hardware configuration is the same as that of the first embodiment, as shown in FIG. In FIG. 5, 11 is an image definition means, 21 is an image update means, 31 is a color number reduction means, 41 is an image compression means, 51 is a document encoding means, 61 is an electronic document file storage means, and 71 is an encoded electronic document. File storage means.

画像定義手段11は、電子文書ファイルに定義されている解像度に従いブランク画像データを定義する。画像更新手段21は、電子文書ファイルより文書オブジェクトを抽出し、ラスター変換(ビットマップ変換)を施すことにより、ブランク画像データを更新して更新画像データを作成する。色数削減手段31は、画像更新手段21により更新された更新画像データに対して、色数を削減して色数削減画像データを作成する処理を行う。画像圧縮手段41は、色数削減手段31により色数を削減された色数削減画像データに対してZIP圧縮等の可逆圧縮を行い、圧縮画像データを作成する処理を行う。文書符号化手段50は、画像圧縮手段41により圧縮された圧縮画像データを所定の電子文書形式に変換して符号化電子文書ファイルを得る処理を行う。   The image definition means 11 defines blank image data according to the resolution defined in the electronic document file. The image update unit 21 extracts a document object from the electronic document file and performs raster conversion (bitmap conversion) to update the blank image data and create updated image data. The color number reduction unit 31 performs a process of reducing the number of colors and creating color number reduced image data for the updated image data updated by the image update unit 21. The image compressing unit 41 performs a process of creating a compressed image data by performing lossless compression such as ZIP compression on the color number reduced image data whose color number has been reduced by the color number reducing unit 31. The document encoding unit 50 performs processing for converting the compressed image data compressed by the image compression unit 41 into a predetermined electronic document format to obtain an encoded electronic document file.

電子文書ファイル記憶手段61は、第1の実施形態における電子文書ファイル記憶手段60と同様、コンピュータで処理可能な電子文書である電子文書ファイルを記憶した記憶手段であり、記憶装置3により実現される。符号化電子文書ファイル記憶手段71は、第2の実施形態における符号化電子文書ファイル記憶手段70と同様、圧縮符号化された電子文書ファイルである符号化電子文書ファイルを記憶する記憶手段であり、記憶装置3により実現される。画像定義手段11、画像更新手段21、色数削減手段31、画像圧縮手段41、文書符号化手段51は、CPU1が、記憶装置3に記憶されているプログラムを実行することにより実現される。   Similar to the electronic document file storage unit 60 in the first embodiment, the electronic document file storage unit 61 is a storage unit that stores an electronic document file that is an electronic document that can be processed by a computer, and is realized by the storage device 3. . The encoded electronic document file storage unit 71 is a storage unit that stores an encoded electronic document file that is a compression-encoded electronic document file, similar to the encoded electronic document file storage unit 70 in the second embodiment. This is realized by the storage device 3. The image definition unit 11, the image update unit 21, the color number reduction unit 31, the image compression unit 41, and the document encoding unit 51 are realized by the CPU 1 executing a program stored in the storage device 3.

図5に示した各構成手段は、第1の実施形態と同様、現実には図1に示したように、コンピュータおよびその周辺機器等のハードウェアに専用のプログラムを搭載することにより実現される。すなわち、コンピュータが、専用のプログラムに従って各手段の内容を実行することになる。   As in the first embodiment, each component shown in FIG. 5 is actually realized by mounting a dedicated program on hardware such as a computer and its peripheral devices as shown in FIG. . That is, the computer executes the contents of each means according to a dedicated program.

図1に示した記憶装置3には、CPU1を動作させ、コンピュータを、電子文書ファイルの圧縮装置として機能させるための専用のプログラムが実装されている。この専用のプログラムを実行することにより、CPU1は、画像定義手段11、画像更新手段21、色数削減手段31、画像圧縮手段41、文書符号化手段51としての機能を実現することになる。また、記憶装置3は、電子文書ファイル記憶手段61、符号化電子文書ファイル記憶手段71として機能するだけでなく、電子文書ファイルの圧縮装置としての処理に必要な様々なデータを記憶する。   The storage device 3 shown in FIG. 1 is mounted with a dedicated program for operating the CPU 1 and causing the computer to function as an electronic document file compression device. By executing this dedicated program, the CPU 1 realizes functions as the image definition unit 11, the image update unit 21, the color number reduction unit 31, the image compression unit 41, and the document encoding unit 51. The storage device 3 not only functions as the electronic document file storage unit 61 and the encoded electronic document file storage unit 71 but also stores various data necessary for processing as a compression device for the electronic document file.

<2.2.処理動作>
次に、図5に示した電子文書ファイルの圧縮装置の処理動作について説明する。図6は、本発明第2の実施形態に係る電子文書ファイルの圧縮装置の処理概要を示すフローチャートである。まず、画像定義手段11が、電子文書ファイル記憶手段60に記憶された電子文書ファイルを取得する。そして、電子文書ファイルに設定されている解像度に従い、ブランク画像データを定義する(ステップS21)。具体的には、設定されている解像度に従った画像サイズ(画素数)の画像データを設定し、各画素に対応した画素値の格納領域をRAM2内に確保する。ブランク画像データとは、形式的には通常の画像データであるが、画像データの各画素の値が意味を持たないものを意味する。
<2.2. Processing action>
Next, the processing operation of the electronic document file compression apparatus shown in FIG. 5 will be described. FIG. 6 is a flowchart showing an outline of processing of the electronic document file compression apparatus according to the second embodiment of the present invention. First, the image definition unit 11 acquires an electronic document file stored in the electronic document file storage unit 60. Then, blank image data is defined according to the resolution set in the electronic document file (step S21). Specifically, image data having an image size (number of pixels) according to the set resolution is set, and a storage area for pixel values corresponding to each pixel is secured in the RAM 2. Blank image data means normal image data in form, but the value of each pixel of the image data has no meaning.

次に、画像更新手段21が、電子文書ファイルから、文書オブジェクトを抽出する(ステップS22)。具体的には、電子文書ファイルの形式に応じて、電子文書ファイルに貼付されている文字コード、図形データ、部品画像データ等の文書オブジェクトを抽出する。部品画像データとは、電子文書ファイルの一部品である文書オブジェクトとしての画像データである。続いて、画像更新手段21は、抽出された文書オブジェクトをラスター変換しながらブランク画像データを更新する(ステップS23)。具体的には、文字コードに対しては、指定されたフォントデータを参照しながら文字ラスターデータに変換してブランク画像データの指定された領域を変換された文字ラスターデータと置換し、図形データに対しては図形ラスターデータに変換してブランク画像データの指定された領域を変換された図形ラスターデータと置換し、部品画像データに対しては、指定された倍率および角度で変換し添付されているマスクデータを参照しながらブランク画像データの指定された領域を変換された部品画像データと置換する処理を繰り返すことにより、ブランク画像データを更新する。   Next, the image update means 21 extracts a document object from the electronic document file (step S22). Specifically, document objects such as character codes, graphic data, and component image data attached to the electronic document file are extracted according to the format of the electronic document file. The component image data is image data as a document object that is one component of an electronic document file. Subsequently, the image update unit 21 updates the blank image data while performing raster conversion on the extracted document object (step S23). Specifically, the character code is converted to character raster data while referring to the specified font data, the specified area of the blank image data is replaced with the converted character raster data, and the graphic data is converted. On the other hand, it is converted into graphic raster data to replace the specified area of the blank image data with the converted graphic raster data, and the part image data is converted and attached at the specified magnification and angle. The blank image data is updated by repeating the process of replacing the designated area of the blank image data with the converted component image data while referring to the mask data.

画像更新手段21は、1つの文書オブジェクトに対する処理が終了するごとに、全文書オブジェクトに対して処理が終了したかどうかを判定する(ステップS24)。全文書オブジェクトに対して処理が終了していない場合は、ステップS22に戻って、次の文書オブジェクトを抽出する。全文書オブジェクトに対して処理が終了した場合は、更新されたブランク画像データが、更新画像データとして得られる。   Each time the processing for one document object is completed, the image update unit 21 determines whether the processing has been completed for all document objects (step S24). If the processing has not been completed for all document objects, the process returns to step S22 to extract the next document object. When processing is completed for all document objects, updated blank image data is obtained as updated image data.

更新画像データが得られたら、色数削減手段31が、作成された更新画像データに対して色数削減処理を行う(ステップS25)。具体的には、RGB等の各色の階調を低下させることにより、全体の色数を削減する。本実施形態における更新画像データも、図4(a)に示すように、R、G、B各色が8ビットで表現されているので、各色は256階調である。ステップS25の処理において、色数削減手段31は、Rを3ビット8階調、Gを3ビット8階調、Bを2ビット4階調に低下させる。この結果、図4(b)に示すように、全体として8ビット256色の色数削減画像データが得られる。第1の実施形態と同様、図4に示した手法以外にも、公知の色数削減手法を用いることができる。色数削減手段31は、複数の色数削減手法を設定可能に構成されており、色数削減手法設定手段として機能するキー入力I/F4を介した指示に従って、指示された色数削減手法を実行するように、色数削減手段31を設定する。第1の実施形態における色数削減手段10と第2の実施形態における色数削減手段31に設定される色数削減手法は、同一であっても良いし、異なっていても良い。   When the update image data is obtained, the color number reduction means 31 performs a color number reduction process on the created update image data (step S25). Specifically, the total number of colors is reduced by lowering the gradation of each color such as RGB. In the updated image data in this embodiment, as shown in FIG. 4A, each color of R, G, and B is expressed by 8 bits, so each color has 256 gradations. In the process of step S25, the color number reduction unit 31 reduces R to 3 bits and 8 gradations, G to 3 bits and 8 gradations, and B to 2 bits and 4 gradations. As a result, as shown in FIG. 4B, 8-bit 256 color-reduced image data is obtained as a whole. As in the first embodiment, a known color number reduction method can be used in addition to the method shown in FIG. The color number reduction unit 31 is configured to be able to set a plurality of color number reduction methods, and in accordance with the instruction via the key input I / F 4 functioning as the color number reduction method setting unit, the instructed color number reduction method is performed. The color number reduction means 31 is set to be executed. The color number reduction method set in the color number reduction unit 10 in the first embodiment and the color number reduction unit 31 in the second embodiment may be the same or different.

次に、画像圧縮手段41が、色数削減画像データの圧縮符号化を行う(ステップS26)。具体的には、色数削減手段31により作成された色数削減画像データに対して圧縮を行い、圧縮画像データを作成する。圧縮強度は、事前に設定された所定の圧縮強度で行う。圧縮方式については、公知の種々の方式を用いることができるが、本実施形態では、可逆圧縮であるZIP方式を用いている。   Next, the image compression means 41 performs compression encoding of the color number reduced image data (step S26). Specifically, the color number reduced image data created by the color number reduction means 31 is compressed to create compressed image data. The compression strength is set at a predetermined compression strength set in advance. As the compression method, various known methods can be used, but in this embodiment, the ZIP method which is lossless compression is used.

ステップS26において、画像圧縮手段41は、さらに、作成した圧縮画像データのデータ量が、圧縮前の色数削減画像データのデータ量に所定比率乗じたものより大きいか否かを判定する。所定比率としては、第1の実施形態と同様、25%以上、75%以下であることが好ましい。本実施形態でも、第1の実施形態と同様、所定比率を“50%”に設定している。圧縮画像データのデータ量が、圧縮前の色数削減画像データのデータ量に所定比率乗じたものより大きい場合は、圧縮前の色数削減画像データに対して、非可逆圧縮方式で圧縮を行い、圧縮画像データとして作成する。圧縮強度は、事前に設定された所定の圧縮強度で行う。非可逆圧縮方式については、公知の種々の方式を用いることができるが、本実施形態では、JPEG方式を用いている。   In step S26, the image compression means 41 further determines whether or not the data amount of the generated compressed image data is larger than the data amount of the color number reduced image data before compression multiplied by a predetermined ratio. The predetermined ratio is preferably 25% or more and 75% or less, as in the first embodiment. Also in this embodiment, the predetermined ratio is set to “50%” as in the first embodiment. If the data amount of compressed image data is larger than the data amount of color-reduced image data before compression multiplied by a predetermined ratio, the color-reduced image data before compression is compressed using the lossy compression method. Created as compressed image data. The compression strength is set at a predetermined compression strength set in advance. As the irreversible compression method, various known methods can be used, but in this embodiment, the JPEG method is used.

フルカラー画像の場合は必ず非可逆圧縮方式の方が、可逆圧縮方式よりもデータ量が小さくなるが、色数削減画像データの場合は逆の場合も起こり得る。しかし、非可逆圧縮方式の方が、可逆圧縮方式よりもデータ量を小さくすることができる場合が多いため、ステップS26における画像圧縮手段41の処理により、圧縮画像データのデータ量は、色数削減画像データのデータ量に所定比率を乗じた値以下となる。   In the case of a full color image, the lossy compression method always has a smaller data amount than the lossless compression method, but in the case of image data with a reduced number of colors, the opposite case may occur. However, since the irreversible compression method can reduce the data amount more often than the lossless compression method, the data amount of the compressed image data is reduced by the number of colors by the processing of the image compression means 41 in step S26. It is below the value obtained by multiplying the data amount of the image data by a predetermined ratio.

次に、文書符号化手段51は、透明文字付加処理を行う(ステップS27)。具体的には、ステップS22において電子文書ファイルから抽出された文字コードを、非描画属性に設定して透明文字データを作成し、指定された割り付け位置を維持して電子文書ファイルに付加する。非描画属性に設定して透明文字データを作成することは、Acrobat(登録商標)等の公知のPDF変換アプリケーションにより行うことができる。透明文字データを付加しておくことにより、文字コードを利用した全文検索が可能となる。   Next, the document encoding means 51 performs a transparent character addition process (step S27). Specifically, the character code extracted from the electronic document file in step S22 is set as a non-drawing attribute to create transparent character data, and the designated allocation position is maintained and added to the electronic document file. The transparent character data can be created by setting the non-drawing attribute to a known PDF conversion application such as Acrobat (registered trademark). By adding transparent character data, a full-text search using a character code can be performed.

次に、文書符号化手段51が、電子文書ファイルの符号化処理を行う(ステップS28)。電子文書ファイルの符号化処理については、公知の種々の形式を用いることができるが、本実施形態では、PDF形式を用いている。具体的には、圧縮画像データと、透明文字データをPDF形式の符号化電子文書ファイルに変換する。この処理は、Acrobat等の公知のPDF変換アプリケーションと同様のアルゴリズムを用いて行われる。   Next, the document encoding means 51 performs an encoding process for the electronic document file (step S28). Various known formats can be used for the encoding process of the electronic document file, but in this embodiment, the PDF format is used. Specifically, the compressed image data and the transparent character data are converted into an encoded electronic document file in PDF format. This process is performed using an algorithm similar to a known PDF conversion application such as Acrobat.

<3.第3の実施形態>
<3.1.装置構成>
次に、本発明第3の実施形態に係る電子文書ファイルの圧縮装置について説明する。図8は、第3の実施形態に係る電子文書ファイルの圧縮装置の構成を示す機能ブロック図である。第3の実施形態では、ハードウェア構成は、第1、第2の実施形態と同一であり、図1に示したようなものとなっている。図8においては、第1、第2の実施形態と同様の機能を有する構成要素については、同一符号を付して説明を省略する。90はデータ量比較手段、62は電子文書ファイル記憶手段、72は符号化電子文書ファイル記憶手段である。
<3. Third Embodiment>
<3.1. Device configuration>
Next, an electronic document file compression apparatus according to the third embodiment of the present invention will be described. FIG. 8 is a functional block diagram showing the configuration of the electronic document file compression apparatus according to the third embodiment. In the third embodiment, the hardware configuration is the same as that in the first and second embodiments, as shown in FIG. In FIG. 8, components having the same functions as those in the first and second embodiments are denoted by the same reference numerals and description thereof is omitted. Reference numeral 90 denotes a data amount comparison unit, 62 denotes an electronic document file storage unit, and 72 denotes an encoded electronic document file storage unit.

第3の実施形態に係る電子文書ファイルの圧縮装置は、第1の実施形態に係る電子文書ファイルの圧縮装置と第2の実施形態に係る電子文書ファイルの圧縮装置の構成要素を組み合わせたものである。そして、第1の実施形態に係る電子文書ファイルの圧縮装置の構成要素である色数削減手段10、画像解像度変換手段20、画像圧縮手段30、文書符号化手段50による処理を終えた後、得られた符号化電子文書ファイルのデータ量と、元の電子文書ファイルのデータ量の比較を行い、符号化電子文書ファイルのデータ量が、元の電子文書ファイルのデータ量の所定の比率以上である場合に、第2の実施形態に係る電子文書ファイルの圧縮装置の構成要素である画像定義手段11、画像更新手段21、色数削減手段31、画像圧縮手段41、文書符号化手段51による処理を行う。   The electronic document file compression apparatus according to the third embodiment is a combination of the electronic document file compression apparatus according to the first embodiment and the components of the electronic document file compression apparatus according to the second embodiment. is there. Then, after the processing by the color number reduction unit 10, the image resolution conversion unit 20, the image compression unit 30, and the document encoding unit 50, which are constituent elements of the electronic document file compression apparatus according to the first embodiment, is obtained. The data amount of the encoded electronic document file is compared with the data amount of the original electronic document file, and the data amount of the encoded electronic document file is equal to or greater than a predetermined ratio of the data amount of the original electronic document file. In this case, the processing by the image definition unit 11, the image update unit 21, the color number reduction unit 31, the image compression unit 41, and the document encoding unit 51, which are components of the electronic document file compression apparatus according to the second embodiment. Do.

電子文書ファイル記憶手段62は、第1の実施形態における電子文書ファイル記憶手段60、第2の実施形態における電子文書ファイル記憶手段61と同様、コンピュータで処理可能な電子文書である電子文書ファイルを記憶した記憶手段であり、記憶装置3により実現される。符号化電子文書ファイル記憶手段72は、第1の実施形態における符号化電子文書ファイル記憶手段70、第2の実施形態における符号化電子文書ファイル記憶手段71と同様、圧縮符号化された電子文書ファイルである符号化電子文書ファイルを記憶する記憶手段であり、記憶装置3により実現される。色数削減手段10、画像解像度変換手段20、画像圧縮手段30、文書符号化手段50、データ量比較手段90、画像定義手段11、画像更新手段21、色数削減手段31、画像圧縮手段41、文書符号化手段51は、CPU1が、記憶装置3に記憶されているプログラムを実行することにより実現される。   The electronic document file storage means 62 stores an electronic document file that is an electronic document that can be processed by a computer, similar to the electronic document file storage means 60 in the first embodiment and the electronic document file storage means 61 in the second embodiment. And is realized by the storage device 3. The encoded electronic document file storage means 72 is a compressed and encoded electronic document file, similar to the encoded electronic document file storage means 70 in the first embodiment and the encoded electronic document file storage means 71 in the second embodiment. The storage unit 3 stores the encoded electronic document file, and is realized by the storage device 3. Color number reduction means 10, image resolution conversion means 20, image compression means 30, document encoding means 50, data amount comparison means 90, image definition means 11, image update means 21, color number reduction means 31, image compression means 41, The document encoding means 51 is realized by the CPU 1 executing a program stored in the storage device 3.

図8に示した各構成手段は、第1の実施形態、第2の実施形態と同様、現実には図1に示したように、コンピュータおよびその周辺機器等のハードウェアに専用のプログラムを搭載することにより実現される。すなわち、コンピュータが、専用のプログラムに従って各手段の内容を実行することになる。   As in the first and second embodiments, each component shown in FIG. 8 is actually equipped with a dedicated program in hardware such as a computer and its peripheral devices as shown in FIG. It is realized by doing. That is, the computer executes the contents of each means according to a dedicated program.

図1に示した記憶装置3には、CPU1を動作させ、コンピュータを、電子文書ファイルの圧縮装置として機能させるための専用のプログラムが実装されている。この専用のプログラムを実行することにより、CPU1は、色数削減手段10、画像解像度変換手段20、画像圧縮手段30、文書符号化手段50、データ量比較手段90、画像定義手段11、画像更新手段21、色数削減手段31、画像圧縮手段41、文書符号化手段51としての機能を実現することになる。また、記憶装置3は、電子文書ファイル記憶手段62、符号化電子文書ファイル記憶手段72として機能するだけでなく、電子文書ファイルの圧縮装置としての処理に必要な様々なデータを記憶する。   The storage device 3 shown in FIG. 1 is mounted with a dedicated program for operating the CPU 1 and causing the computer to function as an electronic document file compression device. By executing this dedicated program, the CPU 1 causes the color number reduction unit 10, the image resolution conversion unit 20, the image compression unit 30, the document encoding unit 50, the data amount comparison unit 90, the image definition unit 11, and the image update unit. 21, functions as the color number reduction unit 31, the image compression unit 41, and the document encoding unit 51 are realized. The storage device 3 not only functions as the electronic document file storage unit 62 and the encoded electronic document file storage unit 72 but also stores various data necessary for processing as a compression device for the electronic document file.

<3.2.処理動作>
次に、図8に示した電子文書ファイルの圧縮装置の処理動作について説明する。図9は、本発明第3の実施形態に係る電子文書ファイルの圧縮装置の処理概要を示すフローチャートである。まず、色数削減手段10、画像解像度変換手段20、画像圧縮手段30、文書符号化手段50が、図3に示したステップS11〜ステップS18の処理を実行する。この結果、符号化電子文書ファイルが得られる。
<3.2. Processing action>
Next, the processing operation of the electronic document file compression apparatus shown in FIG. 8 will be described. FIG. 9 is a flowchart showing an outline of processing of the electronic document file compression apparatus according to the third embodiment of the present invention. First, the number-of-colors reduction unit 10, the image resolution conversion unit 20, the image compression unit 30, and the document encoding unit 50 execute the processes of steps S11 to S18 shown in FIG. As a result, an encoded electronic document file is obtained.

文書符号化手段50の処理により、符号化電子文書ファイルが得られたら、符号化電子文書ファイルのデータ量と、電子文書ファイル記憶手段62に記憶されていた元の電子文書ファイルのデータ量の比較を行う(ステップS30)。具体的には、符号化電子文書ファイルのデータ量と、電子文書ファイルのデータ量に所定の比率を乗じた値との比較を行う。所定の比率としては、十分に圧縮がなされたと判断される値を適宜設定することができるが、本実施形態では、10%を設定している。したがって、符号化電子文書ファイルのデータ量が、電子文書ファイルのデータ量の10%以上である場合に(ステップS31)、画像定義手段11、画像更新手段21、色数削減手段31、画像圧縮手段41、文書符号化手段51が、図6に示したステップS21〜ステップS28の処理を実行する。   When the encoded electronic document file is obtained by the processing of the document encoding means 50, the data amount of the encoded electronic document file is compared with the data amount of the original electronic document file stored in the electronic document file storage means 62. Is performed (step S30). Specifically, the data amount of the encoded electronic document file is compared with a value obtained by multiplying the data amount of the electronic document file by a predetermined ratio. As the predetermined ratio, a value determined to be sufficiently compressed can be set as appropriate, but in this embodiment, 10% is set. Therefore, when the data amount of the encoded electronic document file is 10% or more of the data amount of the electronic document file (step S31), the image definition unit 11, the image update unit 21, the color number reduction unit 31, the image compression unit. 41. The document encoding means 51 executes the processing of steps S21 to S28 shown in FIG.

ステップS28の処理により得られた符号化電子文書ファイルは、符号化電子文書ファイル記憶手段72に記憶される。また、ステップS31において、ステップS18の処理により得られた符号化電子文書ファイルのデータ量が、電子文書ファイルのデータ量の10%より小さい場合は、画像定義手段11、画像更新手段21、色数削減手段31、画像圧縮手段41、文書符号化手段51によりステップS21〜ステップS28の処理を実行せず、ステップS18の処理により得られた符号化電子文書ファイルが、符号化電子文書ファイル記憶手段72に記憶される。すなわち、第3の実施形態では、色数削減手段10、画像解像度変換手段20、画像圧縮手段30、文書符号化手段50による処理により十分圧縮された場合には、その際、得られた符号化電子文書ファイルを圧縮結果とし、色数削減手段10、画像解像度変換手段20、画像圧縮手段30、文書符号化手段50による処理により十分圧縮された場合には、画像定義手段11、画像更新手段21、色数削減手段31、画像圧縮手段41、文書符号化手段51による処理により圧縮を行い、符号化電子文書ファイルを得る。   The encoded electronic document file obtained by the process of step S28 is stored in the encoded electronic document file storage means 72. In step S31, when the data amount of the encoded electronic document file obtained by the process of step S18 is smaller than 10% of the data amount of the electronic document file, the image definition unit 11, the image update unit 21, the number of colors The processing of steps S21 to S28 is not executed by the reduction unit 31, the image compression unit 41, and the document encoding unit 51, and the encoded electronic document file obtained by the processing of step S18 is the encoded electronic document file storage unit 72. Is remembered. That is, in the third embodiment, when the image data is sufficiently compressed by the processing by the color number reduction unit 10, the image resolution conversion unit 20, the image compression unit 30, and the document encoding unit 50, the obtained encoding is performed at that time. When the electronic document file is used as the compression result and is sufficiently compressed by the processing by the color number reduction unit 10, the image resolution conversion unit 20, the image compression unit 30, and the document encoding unit 50, the image definition unit 11 and the image update unit 21 The color number reduction means 31, the image compression means 41, and the document encoding means 51 perform compression to obtain an encoded electronic document file.

<4.変形例等>
以上、本発明の好適な実施形態について説明したが、本発明は上記実施形態に限定されず、種々の変形が可能である。例えば、上記第2の実施形態では、抽出された文字コードから透明文字データを作成して、電子文書ファイルに付加する処理を行ったが、この処理を省略し、透明文字データを付加しないようにしても良い。
<4. Modified example>
The preferred embodiments of the present invention have been described above. However, the present invention is not limited to the above embodiments, and various modifications can be made. For example, in the second embodiment, transparent character data is created from the extracted character code and added to the electronic document file. However, this processing is omitted so that transparent character data is not added. May be.

また、上記実施形態では、符号化電子文書ファイルとしてPDF形式を用いた場合を例にとって説明したが、画像データを貼付した符号化電子文書ファイルであれば、電子文書形式に関わらず、対応することが可能である。   In the above embodiment, the case where the PDF format is used as the encoded electronic document file has been described as an example. However, any encoded electronic document file to which image data is attached can be handled regardless of the electronic document format. Is possible.

また、上記実施形態では、可逆圧縮による圧縮画像データのデータ量が、圧縮前の色数削減画像データのデータ量に所定比率乗じたものより大きい場合は、圧縮前の色数削減画像データに対して、非可逆圧縮方式で圧縮を行うようにしたが、可逆圧縮前後のデータ量の比較を行わず、可逆圧縮による圧縮画像データを、そのまま符号化電子文書ファイルに符号化するようにしても良い。特に、圧縮強度を高め(データ量は少なめ)に設定した場合には、比較をするまでもなく、十分にデータ量を削減できるためである。   Further, in the above embodiment, when the data amount of the compressed image data by lossless compression is larger than the data amount of the color number reduced image data before compression multiplied by a predetermined ratio, the color number reduced image data before compression is Thus, the compression is performed by the lossy compression method, but the compressed image data by the lossless compression may be directly encoded into the encoded electronic document file without comparing the data amount before and after the lossless compression. . In particular, when the compression strength is set high (the amount of data is small), the amount of data can be sufficiently reduced without making a comparison.

1・・・CPU(Central Processing Unit)
2・・・RAM(Random Access Memory)
3・・・記憶装置
4・・・キー入力I/F
5・・・データ入出力I/F
6・・・表示部
10・・・色数削減手段(第2色数削減手段)
11・・・画像定義手段
20・・・画像解像度変換手段
21・・・画像更新手段
30・・・画像圧縮手段(第2画像圧縮手段)
31・・・色数削減手段
41・・・画像圧縮手段
50・・・文書符号化手段(第2文書符号化手段)
51・・・文書符号化手段
60、61、62・・・電子文書ファイル記憶手段
70、71、72・・・符号化電子文書ファイル記憶手段
90・・・データ量比較手段
1 ... CPU (Central Processing Unit)
2 ... RAM (Random Access Memory)
3 ... Storage device 4 ... Key input I / F
5. Data input / output I / F
6 ... Display unit 10 ... Color number reduction means (second color number reduction means)
DESCRIPTION OF SYMBOLS 11 ... Image definition means 20 ... Image resolution conversion means 21 ... Image update means 30 ... Image compression means (2nd image compression means)
31 ... Color number reduction means 41 ... Image compression means 50 ... Document encoding means (second document encoding means)
51 ... Document encoding means 60, 61, 62 ... Electronic document file storage means 70, 71, 72 ... Encoded electronic document file storage means 90 ... Data amount comparison means

Claims (6)

原画像データが貼付された電子文書ファイルを圧縮する装置であって、
前記電子文書ファイルに定義されているページ解像度に従いブランク画像データを定義する画像データ定義手段と、
前記電子文書ファイルより文字コード、フォントデータ、図形データ、部品画像データのうち、少なくとも1つの文書オブジェクトを順次抽出し、文字コードに対しては指定されたフォントデータを参照しながら文字ラスターデータに変換して前記ブランク画像データの指定された領域を変換された文字ラスターデータと置換し、図形データに対しては図形ラスターデータに変換して前記ブランク画像データの指定された領域を変換された図形ラスターデータと置換し、部品画像データに対しては、指定された倍率および角度で変換し添付されているマスクデータを参照しながら前記ブランク画像データの指定された領域を変換された部品画像データと置換する処理を行うことにより、前記ブランク画像データを更新して更新画像データを作成する画像更新手段と、
前記更新画像データに対して、RGB各階調の深さを所定の深さ以下に低下させることにより全体の色数を所定数以下に低下させた色数削減画像データを作成する色数削減手段と、
前記色数削減画像データに対して、可逆圧縮を施し、圧縮画像データを作成する画像圧縮手段と、
前記圧縮画像データを所定の電子文書形式に変換する文書符号化手段と、
前記電子文書ファイルに貼付されている前記原画像データに対して、RGB各階調の深さを所定の深さ以下に低下させることにより全体の色数を所定数以下に低下させた第2色数削減画像データを作成する第2色数削減手段と、
前記第2色数削減画像データの解像度が所定の解像度である所定解像度を上回る場合、前記第2色数削減画像データを、前記所定解像度より低い値に設定された解像度である設定解像度になるように解像度変換を行う画像解像度変換手段と、
前記画像解像度変換手段により解像度変換された第2色数削減画像データまたは前記画像解像度変換手段により解像度変換されなかった第2色数削減画像データのいずれかに対して、可逆圧縮を施し、第2圧縮画像データを作成する第2画像圧縮手段と、
前記第2圧縮画像データを前記電子文書ファイルに貼付されていた原画像データに代えて貼付された状態とし、前記電子文書ファイルを所定の電子文書形式の符号化電子文書ファイルに変換する第2文書符号化手段と、
前記符号化電子文書ファイルと前記電子文書ファイルのデータ量の比較を行うデータ量比較手段と、を有し、
前記符号化電子文書ファイルのデータ量が前記電子文書ファイルのデータ量に対して所定の比率以上である場合に、前記画像データ定義手段、画像更新手段、色数削減手段、画像圧縮手段、文書符号化手段による処理が実行されることを特徴とする電子文書ファイルの圧縮装置。
An apparatus for compressing an electronic document file to which original image data is attached,
Image data defining means for defining blank image data according to the page resolution defined in the electronic document file;
At least one document object is sequentially extracted from the electronic document file among the character code, font data, graphic data, and component image data, and the character code is converted into character raster data while referring to the specified font data. Then, the designated area of the blank image data is replaced with the converted character raster data, and the graphic data is converted into graphic raster data to convert the designated area of the blank image data into a converted graphic raster. Replace with the data, and for the part image data, replace the specified area of the blank image data with the converted part image data while referring to the attached mask data after converting at the specified magnification and angle The blank image data is updated to create updated image data. And the image updating means for,
Color number reduction means for creating color number reduced image data in which the total number of colors is reduced to a predetermined number or less by reducing the depth of each RGB gradation to a predetermined depth or less with respect to the updated image data ,
Image compression means for performing lossless compression on the color-reduced image data and creating compressed image data;
Document encoding means for converting the compressed image data into a predetermined electronic document format;
Second color number in which the total number of colors is reduced to a predetermined number or less by reducing the depth of each gradation of RGB to a predetermined depth or less with respect to the original image data attached to the electronic document file Second color number reduction means for creating reduced image data;
When the resolution of the second color number reduced image data exceeds a predetermined resolution which is a predetermined resolution, the second color number reduced image data is set to a set resolution which is a resolution set to a value lower than the predetermined resolution. Image resolution conversion means for converting the resolution into
Reversible compression is performed on either the second color number reduced image data whose resolution has been converted by the image resolution converting means or the second color number reduced image data which has not been converted by the image resolution converting means, A second image compression means for creating compressed image data;
A second document in which the second compressed image data is pasted in place of the original image data pasted on the electronic document file, and the electronic document file is converted into an encoded electronic document file in a predetermined electronic document format. Encoding means;
Data amount comparison means for comparing the data amount of the encoded electronic document file and the electronic document file,
When the data amount of the encoded electronic document file is greater than or equal to a predetermined ratio with respect to the data amount of the electronic document file, the image data definition unit, the image update unit, the color number reduction unit, the image compression unit, the document code electronic document file compression apparatus according to claim Rukoto process by means runs.
原画像データが貼付された電子文書ファイルを圧縮する装置であって、
前記電子文書ファイルに定義されているページ解像度に従いブランク画像データを定義する画像データ定義手段と、
前記電子文書ファイルより文字コード、フォントデータ、図形データ、部品画像データのうち、少なくとも1つの文書オブジェクトを順次抽出し、文字コードに対しては指定されたフォントデータを参照しながら文字ラスターデータに変換して前記ブランク画像データの指定された領域を変換された文字ラスターデータと置換し、図形データに対しては図形ラスターデータに変換して前記ブランク画像データの指定された領域を変換された図形ラスターデータと置換し、部品画像データに対しては、指定された倍率および角度で変換し添付されているマスクデータを参照しながら前記ブランク画像データの指定された領域を変換された部品画像データと置換する処理を行うことにより、前記ブランク画像データを更新して更新画像データを作成する画像更新手段と、
前記更新画像データに対して、RGB各階調の深さを所定の深さ以下に低下させることにより全体の色数を所定数以下に低下させた色数削減画像データを作成する色数削減手段と、
前記色数削減画像データに対して、可逆圧縮を施し、圧縮画像データを作成する画像圧縮手段と、
前記圧縮画像データを所定の電子文書形式に変換する文書符号化手段と、
を有し、
前記画像圧縮手段は、前記圧縮画像データのデータ量が前記色数削減画像データに比べ所定比率以上に大きい場合、前記色数削減画像データに対して、可逆圧縮を施す代わりに、所定の圧縮強度に基づいて非可逆圧縮を施し、非可逆の圧縮画像データを作成するようにしていることを特徴とする電子文書ファイルの圧縮装置。
An apparatus for compressing an electronic document file to which original image data is attached,
Image data defining means for defining blank image data according to the page resolution defined in the electronic document file;
At least one document object is sequentially extracted from the electronic document file among the character code, font data, graphic data, and component image data, and the character code is converted into character raster data while referring to the specified font data. Then, the designated area of the blank image data is replaced with the converted character raster data, and the graphic data is converted into graphic raster data to convert the designated area of the blank image data into a converted graphic raster. Replace with the data, and for the part image data, replace the specified area of the blank image data with the converted part image data while referring to the attached mask data after converting at the specified magnification and angle The blank image data is updated to create updated image data. And the image updating means for,
Color number reduction means for creating color number reduced image data in which the total number of colors is reduced to a predetermined number or less by reducing the depth of each RGB gradation to a predetermined depth or less with respect to the updated image data ,
Image compression means for performing lossless compression on the color-reduced image data and creating compressed image data;
Document encoding means for converting the compressed image data into a predetermined electronic document format;
I have a,
When the data amount of the compressed image data is greater than a predetermined ratio compared to the color-reduced image data, the image compressing unit is configured to perform a predetermined compression strength instead of performing reversible compression on the color-reduced image data. lossy compression alms, electronic document file compression device that you have so as to create a compressed image data lossy characterized based on.
請求項1または請求項2において、
前記文書符号化手段は、前記画像更新手段により前記電子文書ファイルから抽出された文字コードを非描画属性に設定し、指定された割り付け位置を維持しながら電子文書ファイルに付加した後、所定の電子文書形式に変換するようにしていることを特徴とする電子文書ファイルの圧縮装置。
In claim 1 or claim 2 ,
The document encoding unit sets the character code extracted from the electronic document file by the image update unit to a non-drawing attribute, adds the character code to the electronic document file while maintaining the designated allocation position, An apparatus for compressing an electronic document file, wherein the electronic document file is converted into a document format.
請求項1から請求項のいずれか一項に記載の電子文書ファイルの圧縮装置として、コンピュータを機能させるためのプログラム。 A program for causing a computer to function as the electronic document file compression device according to any one of claims 1 to 3 . コンピュータが、原画像データが貼付された電子文書ファイルを圧縮して、圧縮された電子文書ファイルを作成する方法であって、A method in which a computer compresses an electronic document file to which original image data is pasted to create a compressed electronic document file,
前記電子文書ファイルに貼付されている前記原画像データに対して、RGB各階調の深さを所定の深さ以下に低下させることにより全体の色数を所定数以下に低下させた第2色数削減画像データを作成する段階と、Second color number in which the total number of colors is reduced to a predetermined number or less by reducing the depth of each gradation of RGB to a predetermined depth or less with respect to the original image data attached to the electronic document file Creating reduced image data; and
前記第2色数削減画像データの解像度が所定の解像度である所定解像度を上回る場合、前記第2色数削減画像データを、前記所定解像度より低い値に設定された解像度である設定解像度になるように解像度変換を行う段階と、When the resolution of the second color number reduced image data exceeds a predetermined resolution which is a predetermined resolution, the second color number reduced image data is set to a set resolution which is a resolution set to a value lower than the predetermined resolution. The resolution conversion stage,
前記解像度変換を行う段階により解像度変換された第2色数削減画像データまたは前記解像度変換を行う段階により解像度変換されなかった第2色数削減画像データのいずれかに対して、可逆圧縮を施し、第2圧縮画像データを作成する段階と、Applying reversible compression to either the second color number-reduced image data whose resolution has been converted by the step of performing the resolution conversion or the second color number-reduced image data which has not been converted by the step of performing the resolution conversion, Creating second compressed image data;
前記第2圧縮画像データを前記電子文書ファイルに貼付されていた原画像データに代えて貼付された状態とし、前記電子文書ファイルを所定の電子文書形式の符号化電子文書ファイルに変換する段階と、Converting the second compressed image data into an encoded electronic document file in a predetermined electronic document format, with the second compressed image data being attached instead of the original image data attached to the electronic document file;
前記符号化電子文書ファイルと前記電子文書ファイルのデータ量の比較を行う段階と、Comparing the amount of data in the encoded electronic document file and the electronic document file;
前記符号化電子文書ファイルのデータ量が前記電子文書ファイルのデータ量に対して所定の比率以上である場合に、前記電子文書ファイルに定義されているページ解像度に従いブランク画像データを定義する段階と、Defining blank image data according to the page resolution defined in the electronic document file when the data amount of the encoded electronic document file is equal to or greater than a predetermined ratio with respect to the data amount of the electronic document file;
前記電子文書ファイルより文字コード、フォントデータ、図形データ、部品画像データのうち、少なくとも1つの文書オブジェクトを順次抽出し、文字コードに対しては指定されたフォントデータを参照しながら文字ラスターデータに変換して前記ブランク画像データの指定された領域を変換された文字ラスターデータと置換し、図形データに対しては図形ラスターデータに変換して前記ブランク画像データの指定された領域を変換された図形ラスターデータと置換し、部品画像データに対しては、指定された倍率および角度で変換し添付されているマスクデータを参照しながら前記ブランク画像データの指定された領域を変換された部品画像データと置換する処理を行うことにより、前記ブランク画像データを更新して更新画像データを作成する段階と、At least one document object is sequentially extracted from the electronic document file among the character code, font data, graphic data, and component image data, and the character code is converted into character raster data while referring to the specified font data. Then, the designated area of the blank image data is replaced with the converted character raster data, and the graphic data is converted into graphic raster data to convert the designated area of the blank image data into a converted graphic raster. Replace with the data, and for the part image data, replace the specified area of the blank image data with the converted part image data while referring to the attached mask data after converting at the specified magnification and angle The blank image data is updated to create updated image data. The method comprising,
前記更新画像データに対して、RGB各階調の深さを所定の深さ以下に低下させることにより全体の色数を所定数以下に低下させた色数削減画像データを作成する段階と、For the updated image data, creating color number reduced image data in which the total number of colors is reduced to a predetermined number or less by reducing the depth of each RGB gradation to a predetermined depth or less;
前記色数削減画像データに対して、可逆圧縮を施し、圧縮画像データを作成する段階と、Applying lossless compression to the color-reduced image data and creating compressed image data;
前記圧縮画像データを所定の電子文書形式に変換する段階と、Converting the compressed image data into a predetermined electronic document format;
を有することを特徴とする圧縮された電子文書ファイルの作成方法。A method for creating a compressed electronic document file, comprising:
コンピュータが、原画像データが貼付された電子文書ファイルを圧縮して、圧縮された電子文書ファイルを作成する方法であって、A method in which a computer compresses an electronic document file to which original image data is pasted to create a compressed electronic document file,
前記電子文書ファイルに定義されているページ解像度に従いブランク画像データを定義する画像データ段階と、  An image data stage for defining blank image data according to the page resolution defined in the electronic document file;
前記電子文書ファイルより文字コード、フォントデータ、図形データ、部品画像データのうち、少なくとも1つの文書オブジェクトを順次抽出し、文字コードに対しては指定されたフォントデータを参照しながら文字ラスターデータに変換して前記ブランク画像データの指定された領域を変換された文字ラスターデータと置換し、図形データに対しては図形ラスターデータに変換して前記ブランク画像データの指定された領域を変換された図形ラスターデータと置換し、部品画像データに対しては、指定された倍率および角度で変換し添付されているマスクデータを参照しながら前記ブランク画像データの指定された領域を変換された部品画像データと置換する処理を行うことにより、前記ブランク画像データを更新して更新画像データを作成する段階と、At least one document object is sequentially extracted from the electronic document file among the character code, font data, graphic data, and component image data, and the character code is converted into character raster data while referring to the specified font data. Then, the designated area of the blank image data is replaced with the converted character raster data, and the graphic data is converted into graphic raster data to convert the designated area of the blank image data into a converted graphic raster. Replace with the data, and for the part image data, replace the specified area of the blank image data with the converted part image data while referring to the attached mask data after converting at the specified magnification and angle The blank image data is updated to create updated image data. The method comprising,
前記更新画像データに対して、RGB各階調の深さを所定の深さ以下に低下させることにより全体の色数を所定数以下に低下させた色数削減画像データを作成する段階と、For the updated image data, creating color number reduced image data in which the total number of colors is reduced to a predetermined number or less by reducing the depth of each RGB gradation to a predetermined depth or less;
前記色数削減画像データに対して、可逆圧縮を施し、圧縮画像データを作成する段階と、Applying lossless compression to the color-reduced image data and creating compressed image data;
前記圧縮画像データを所定の電子文書形式に変換する段階と、Converting the compressed image data into a predetermined electronic document format;
を有し、Have
前記圧縮画像データを作成する段階は、前記圧縮画像データのデータ量が前記色数削減画像データに比べ所定比率以上に大きい場合、前記色数削減画像データに対して、可逆圧縮を施す代わりに、所定の圧縮強度に基づいて非可逆圧縮を施し、非可逆の圧縮画像データを作成するようにしていることを特徴とする圧縮された電子文書ファイルの作成方法。In the step of creating the compressed image data, when the data amount of the compressed image data is larger than a predetermined ratio compared to the color number reduced image data, instead of performing reversible compression on the color number reduced image data, A method for creating a compressed electronic document file, wherein irreversible compression is performed based on a predetermined compression strength to create irreversible compressed image data.
JP2013098092A 2013-05-08 2013-05-08 Electronic document file compression device Expired - Fee Related JP6206641B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2013098092A JP6206641B2 (en) 2013-05-08 2013-05-08 Electronic document file compression device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2013098092A JP6206641B2 (en) 2013-05-08 2013-05-08 Electronic document file compression device

Publications (2)

Publication Number Publication Date
JP2014220629A JP2014220629A (en) 2014-11-20
JP6206641B2 true JP6206641B2 (en) 2017-10-04

Family

ID=51938728

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2013098092A Expired - Fee Related JP6206641B2 (en) 2013-05-08 2013-05-08 Electronic document file compression device

Country Status (1)

Country Link
JP (1) JP6206641B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7059835B2 (en) * 2018-07-04 2022-04-26 株式会社島津製作所 Video signal compression processing device, video signal decompression processing device, video signal transmission system, video signal compression processing method, and video signal decompression processing method

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009059133A (en) * 2007-08-31 2009-03-19 Sony Corp Image retrieval device, image retrieval method and program
JP5274305B2 (en) * 2009-02-27 2013-08-28 キヤノン株式会社 Image processing apparatus, image processing method, and computer program

Also Published As

Publication number Publication date
JP2014220629A (en) 2014-11-20

Similar Documents

Publication Publication Date Title
US10136128B2 (en) Cell-based compression with edge detection
EP2481206B1 (en) Image processing apparatus and processing method therefor
JP4795161B2 (en) Image processing apparatus, control method therefor, computer program, and computer-readable storage medium
US9891875B2 (en) Host device for transmitting print data to printer and method of rendering print data via host device
JP5439510B2 (en) Image forming apparatus and image forming program
US20160227075A1 (en) Interleaved Encoding of Compressed Attribute and Color Planes
US9667839B2 (en) Digital image color plane compression
JP2004362541A (en) Image processing device, program, and storage medium
JP2008042685A (en) Image processor and processing method, computer program and computer readable storage medium
US9363416B1 (en) Digital image attribute plane compression
JP6206641B2 (en) Electronic document file compression device
JP4979754B2 (en) Image compression apparatus and image compression method
WO2015076139A1 (en) Image compression/expansion device and image formation device
JP6142549B2 (en) Electronic document image compression device
US7146058B2 (en) Compression of images using object maps
JP2015139062A (en) Printing system, information processing apparatus, control method thereof and program
CN103136171A (en) E-book making method based on shock wave flash (SWF)
JP6191210B2 (en) Image compression device
JP5441676B2 (en) Image processing apparatus and processing method thereof
JP6089738B2 (en) Electronic document file compression device
US8369637B2 (en) Image processing apparatus, image processing method, and program
JP2009278242A (en) Image synthesis method, print system, and image synthesis program
JP2001169120A (en) Method, device, and system for image processing
US20230068158A1 (en) High-speed cell-based image compression
JP2010028819A (en) Image processing apparatus and method, and image reading apparatus

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20160418

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20170308

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20170411

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20170605

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: 20170809

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20170822

R150 Certificate of patent or registration of utility model

Ref document number: 6206641

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees