CN102375887B - Method and device for converting TIF (Tagged Image File) format file - Google Patents

Method and device for converting TIF (Tagged Image File) format file Download PDF

Info

Publication number
CN102375887B
CN102375887B CN201110326462.9A CN201110326462A CN102375887B CN 102375887 B CN102375887 B CN 102375887B CN 201110326462 A CN201110326462 A CN 201110326462A CN 102375887 B CN102375887 B CN 102375887B
Authority
CN
China
Prior art keywords
pixel
brightness value
value
image
file
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
CN201110326462.9A
Other languages
Chinese (zh)
Other versions
CN102375887A (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.)
Ever All Technology (shenzhen) Co Ltd
Original Assignee
Ever All Technology (shenzhen) 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 Ever All Technology (shenzhen) Co Ltd filed Critical Ever All Technology (shenzhen) Co Ltd
Priority to CN201110326462.9A priority Critical patent/CN102375887B/en
Publication of CN102375887A publication Critical patent/CN102375887A/en
Application granted granted Critical
Publication of CN102375887B publication Critical patent/CN102375887B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Image Processing (AREA)
  • Facsimile Image Signal Circuits (AREA)

Abstract

The invention provides a method and a device for converting a TIF (Tagged Image File) format file. The method comprises the following steps of: converting a document to be converted into a bitmap file; adjusting the color scale of the bitmap file to generate a gray level image; and performing binary processing on the gray level image, and converting into a TIF format file. In the invention, a binary conversion algorithm based on a pixel integrated value is adopted, so that the stereovision of a finally-generated picture can be increased greatly; after an image expressing figures or scenes is converted by adopting the scheme of the invention, the profile of the image can be described, and the details of the image can be described clearly; and by adopting an automatic color scale adjusting scheme, light-color parts of scanning pieces and the like can be corrected automatically, and the definition of a finally-generated picture is increased. The method and the device can be widely applied to the field of fax servers for transmitting on the dependence of the TIF format and the field of document conversion in which TIF is taken as a storage format, and the definition of a converted document is increased.

Description

A kind of conversion method of TIF formatted file and device
Technical field
The present invention relates to document format switch technology, particularly relate to conversion method and the device of TIF formatted file (standard fax paper form) document.
Background technology
At present, along with the develop rapidly of IT technology, IT application in enterprises is also more and more universal, computer document and data layout also more and more abundanter, wherein owing to having, TIF formatted file takes up room that little, flexibility is strong, view data exchanges the advantages such as simple, usually being applicable to the swap file among applications and between computer platform, is the standard format in file and picture and document file management system.In computer application system, TIF formatted file is often applied to Fax Server and document storage system.
Usually being the method for TIF formatted file by the document subject feature vector of extended formatting is: the document of conversion first will be needed to be printed as PS/PCL file by virtual printer, then adopt the transfer algorithm based on luminance threshold to convert TIF formatted file to.This conversion method has following defect:
1. adopt the transfer algorithm based on luminance threshold, this algorithm can cause the stereovision of picture to disappear;
2. the details of word, picture is fuzzy, and the document that color is more shallow (as scanning shelves) is partially light after conversion;
3. provide many algorithms but can not adaptive input document (need user manually to select Doctype to be word to be main or picture to be main, user needs to set suitable luminance threshold according to Doctype) simultaneously.
Summary of the invention
The object of the present invention is to provide a kind of conversion method and device of TIF formatted file, strengthen the stereovision of converted images, improve the sharpness of converted images, and there is stronger adaptivity.
The object of the invention is to be achieved through the following technical solutions.
A conversion method for TIF formatted file, comprises step:
Document subject feature vector to be converted is become bitmap file;
Gray level image is generated after color range adjustment process is carried out to institute's bitmap file;
TIF formatted file is converted to after binary conversion treatment is carried out to described gray level image.
Wherein, describedly the process of bitmap file is become to comprise further document subject feature vector to be converted:
For text document to be converted, after it is printed to printing script file by virtual printer, be converted to bitmap file again; For image to be converted, be directly changed into bitmap file.
Wherein, while carrying out binary conversion treatment to described gray level image, error diffusion dither algorithm is also adopted to process this gray level image.
Wherein, the process of described color range adjustment process comprises further:
The pixel of image is added up by brightness value; Check the distribution situation of the pixel of each brightness value; If the brightness value distribution range of pixel is less than threshold value k, predetermined threshold value m% and n%, remove at most bright value the m% that whole image always counts and obtain new maximum brightness value c, and the brightness value all brightness values being greater than the pixel of c is set to c, remove in the most secretly value the n% that whole image always counts and obtain new minimum luminance value d, and the brightness value all brightness values being less than the pixel of d is set to d; Resetting brightness value in image is afterwards that the brightness value of the pixel of c and d is respectively 255 and 0, then readjusts the brightness value of each pixel therebetween in proportion according to the statistics of described brightness value.
Wherein, described the process that gray level image carries out binary conversion treatment to be comprised further:
Initialize installation brightness aggregate-value B 0with threshold value T b;
The brightness value reading each pixel successively carries out following process: the brightness value b reading current pixel point i, upgrade B 0=B 0+ b i; Judge B 0whether reach T bif then current pixel point be set to white and upgrade B 0=B 0﹣ T b, if not then current pixel point is set to black; I=i+1 afterwards, processes next pixel.
A conversion equipment for TIF formatted file, comprising:
Document subject feature vector to be converted is become the picture converting unit of bitmap file;
The gray proces unit of gray level image is generated after color range adjustment process is carried out to institute's bitmap file;
The binaryzation converting unit of TIF formatted file is converted to after binary conversion treatment is carried out to gray level image.
Wherein, also comprise: while binary conversion treatment is carried out to gray level image, adopt the error handling units that error diffusion dither algorithm processes this gray level image.
The beneficial effect of the embodiment of the present invention is:
Present invention employs the binaryzation transfer algorithm based on pixel aggregate-value, with adopt in prior art based on luminance threshold binaryzation transfer algorithm compared with, greatly can increase the stereovision of the final picture generated; For the image representing personage or landscape, after employing the solution of the present invention carries out conversion process, its profile can not only be described, can also clearly describe its details; Adopt Auto Laves adjustment processing scheme, can automatically correct the inclined shallow portion of the colors such as scanned copy, improve the sharpness of the final picture generated; Thus the present invention can be widely used in relying on the Fax Server field of TIF format transmission and the document subject feature vector field using TIF as storage format, improves the sharpness of the rear document of conversion.
Accompanying drawing explanation
Fig. 1 is the conversion device structure figure of the TIF formatted file that the embodiment of the present invention provides;
The conversion method process flow diagram of the TIF formatted file that Fig. 2 provides for the embodiment of the present invention;
The binary conversion treatment process flow diagram based on pixel intensity aggregate-value that Fig. 3 provides for the embodiment of the present invention;
Fig. 4 and Fig. 5 is respectively the design sketch of the TIF image adopting prior art conversion method and conversion method of the present invention to obtain.
Embodiment
In order to make object of the present invention, technical scheme and advantage clearly understand, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein only in order to explain the present invention, be not intended to limit the present invention.
Refer to Fig. 1, the device realizing the conversion of TIF formatted file in the present embodiment comprises with lower part:
Picture converting unit, for becoming bitmap file by document subject feature vector to be converted;
Gray proces unit, generates gray level image after bitmap file being carried out to color range adjustment process;
Binaryzation converting unit, converts TIF formatted file to after carrying out binary conversion treatment to gray level image;
Error handling units, processes this gray level image for adopting error diffusion dither algorithm while carrying out binary conversion treatment to gray level image.
Correspondingly, refer to Fig. 2, the method realizing the conversion of TIF formatted file in the present embodiment comprises the following steps:
201, apply picture converting unit and document subject feature vector to be converted is become bitmap file.
In this step, for text document (as word document, ppt document etc.) to be converted, after needing first it to be printed to printing script file by virtual printer, be converted to bitmap file again; For image (as scanned the image generated by scanner) to be converted, bitmap file can be directly changed into.
202, gray level image is generated after color range adjustment process being carried out to bitmap file.
Adopt automated manner to realize color range adjustment process in this step: to add up by brightness value the pixel of image; The pixel of image is added up by brightness value; Check the distribution situation of the pixel of each brightness value; If the brightness value distribution range of pixel is less than threshold value k(before color range process, if image itself is word or is evenly distributed and would not does color range process again), predetermined threshold value m% and n%, remove at most bright value the m% that whole image always counts and obtain new maximum brightness value c, and the brightness value all brightness values being greater than the pixel of c is set to c, remove in the most secretly value the n% that whole image always counts and obtain new minimum luminance value d, and the brightness value all brightness values being less than the pixel of d is set to d; Resetting brightness value in image is afterwards that the brightness value of the pixel of c and d is respectively 255 and 0, then readjusts the brightness value of each pixel therebetween in proportion according to the statistics of described brightness value.
High light loss, namely in order to further expanded contrast, artificial expand the scope of most bright value such as the distribution range of pixel is 2-252, but the ratio value of total pixel of 2-10 is m%, then all pixels of less than 10 are all set to 10.The following is the description on network, but the ratio value adopted is not 5.5 herein, shadow loss and the value of high light loss also inconsistent, change with the Distribution Value associated dynamic of pixel.First Histogram is conversed; and detect its maximal value HistogramUp and minimum value HistogramDown and both difference HistogramDifer; then Auto Laves formula is: remove that whole image always counts respectively in maximal value and minimum value limit 5.5%; and in this, as new maximal value and minimum value, and there is (R/G/B-histogrambottom) * 255.0/histogramdiffer; As the value of this new point.
203, binary conversion treatment is carried out to above-mentioned gray level image, after adopting error diffusion dither algorithm process, convert TIF formatted file to simultaneously.
In this step, binary conversion treatment adopts the transfer algorithm based on the brightness aggregate-value of pixel, refers to Fig. 3, specifically comprises:
Initialize installation brightness aggregate-value B 0with threshold value T b;
Read the brightness value b of current pixel point i, upgrade B 0=B 0+ b i;
Judge B 0whether reach T bif then current pixel point be set to white and upgrade B 0=B 0﹣ T b, if not then current pixel point is set to black;
I=i+1 afterwards, processes next pixel.
The image that application prior art conversion process shown in comparison diagram 4 obtains and the image that the application conversion process of the present invention shown in Fig. 5 obtains known, the present invention substantially increases the sharpness of image.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, all any amendments done within the spirit and principles in the present invention, equivalent replacement and improvement etc., all should be included within protection scope of the present invention.

Claims (3)

1. a conversion method for TIF formatted file, is characterized in that, the method comprising the steps of:
Document subject feature vector to be converted is become bitmap file;
Gray level image is generated after color range adjustment process is carried out to institute's bitmap file;
TIF formatted file is converted to after binary conversion treatment is carried out to described gray level image;
Describedly the process of bitmap file is become to comprise further document subject feature vector to be converted:
For text document to be converted, after it is printed to printing script file by virtual printer, be converted to bitmap file again; For image to be converted, be directly changed into bitmap file;
The process of described color range adjustment process comprises further:
The pixel of image is added up by brightness value; Check the distribution situation of the pixel of each brightness value; If the brightness value distribution range of pixel is less than threshold value k, predetermined threshold value m% and n%, remove at most bright value the m% that whole image always counts and obtain new maximum brightness value c, and the brightness value all brightness values being greater than the pixel of c is set to c, remove in the most secretly value the n% that whole image always counts and obtain new minimum luminance value d, and the brightness value all brightness values being less than the pixel of d is set to d; Resetting brightness value in image is afterwards that the brightness value of the pixel of c and d is respectively 255 and 0, then readjusts the brightness value of each pixel therebetween in proportion according to the statistics of described brightness value;
While carrying out binary conversion treatment to described gray level image, error diffusion dither algorithm is also adopted to process this gray level image.
2. the conversion method of TIF formatted file as claimed in claim 1, is characterized in that, describedly comprises further the process that gray level image carries out binary conversion treatment:
Initialize installation brightness aggregate-value B 0with threshold value T b;
The brightness value reading each pixel successively carries out following process: the brightness value b reading current pixel point i, upgrade B 0=B 0+ b i; Judge B 0whether reach T bif then current pixel point be set to white and upgrade B 0=B 0﹣ T b, if not then current pixel point is set to black; I=i+1 afterwards, processes next pixel.
3. a conversion equipment for TIF formatted file, is characterized in that, this device comprises:
Document subject feature vector to be converted is become the picture converting unit of bitmap file;
The gray proces unit of gray level image is generated after color range adjustment process is carried out to institute's bitmap file;
Concrete color range adjustment processing procedure comprises:
The pixel of image is added up by brightness value; Check the distribution situation of the pixel of each brightness value; If the brightness value distribution range of pixel is less than threshold value k, predetermined threshold value m% and n%, remove at most bright value the m% that whole image always counts and obtain new maximum brightness value c, and the brightness value all brightness values being greater than the pixel of c is set to c, remove in the most secretly value the n% that whole image always counts and obtain new minimum luminance value d, and the brightness value all brightness values being less than the pixel of d is set to d; Resetting brightness value in image is afterwards that the brightness value of the pixel of c and d is respectively 255 and 0, then readjusts the brightness value of each pixel therebetween in proportion according to the statistics of described brightness value;
The binaryzation converting unit of TIF formatted file is converted to after binary conversion treatment is carried out to gray level image;
The error handling units that error diffusion dither algorithm processes this gray level image is adopted while binary conversion treatment is carried out to gray level image.
CN201110326462.9A 2011-10-25 2011-10-25 Method and device for converting TIF (Tagged Image File) format file Expired - Fee Related CN102375887B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110326462.9A CN102375887B (en) 2011-10-25 2011-10-25 Method and device for converting TIF (Tagged Image File) format file

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110326462.9A CN102375887B (en) 2011-10-25 2011-10-25 Method and device for converting TIF (Tagged Image File) format file

Publications (2)

Publication Number Publication Date
CN102375887A CN102375887A (en) 2012-03-14
CN102375887B true CN102375887B (en) 2015-04-22

Family

ID=45794493

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110326462.9A Expired - Fee Related CN102375887B (en) 2011-10-25 2011-10-25 Method and device for converting TIF (Tagged Image File) format file

Country Status (1)

Country Link
CN (1) CN102375887B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106204563B (en) * 2016-07-04 2019-11-15 傲讯全通科技(深圳)有限公司 A kind of image conversion method
CN109284787B (en) * 2018-08-02 2022-02-25 广东南天司法鉴定所 Method and device for automatically collecting handwritten ink mark color level
CN109657211A (en) * 2018-12-11 2019-04-19 万兴科技股份有限公司 The method, apparatus and intelligent terminal of line format conversion
CN112417817A (en) * 2019-08-19 2021-02-26 珠海金山办公软件有限公司 PDF document format conversion method and device and electronic equipment
CN112417816A (en) * 2019-08-19 2021-02-26 珠海金山办公软件有限公司 Format conversion method and device of Word document and electronic equipment

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1993711A (en) * 2005-04-27 2007-07-04 Lg电子株式会社 Apparatus and method of conversing data

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20020001128A (en) * 2000-06-26 2002-01-09 이성연 Service method of division of work in medicine and physicians share of prescription slip
US7646433B2 (en) * 2005-05-31 2010-01-12 D-Link Systems, Inc. User selectable image scaling

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1993711A (en) * 2005-04-27 2007-07-04 Lg电子株式会社 Apparatus and method of conversing data

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
工程图纸输入与自动识别系统的研究;李四明;《中国优秀硕士学位论文全文数据库》;20020615;第15-16,44-45页 *

Also Published As

Publication number Publication date
CN102375887A (en) 2012-03-14

Similar Documents

Publication Publication Date Title
US7113648B1 (en) Image processing apparatus for correcting contrast of image
CN102375887B (en) Method and device for converting TIF (Tagged Image File) format file
CN107909553B (en) Image processing method and device
CN111787182B (en) Image data conversion device, image data conversion method, image data conversion program, POS terminal device, and server
US8488199B2 (en) Image output inspection system, image inspection apparatus, and computer program product
US9497353B2 (en) Image processing apparatus, image processing method, and image processing system
JP2004320701A (en) Image processing device, image processing program and storage medium
US8340411B2 (en) Smart image resizing with color-based entropy and gradient operators
KR101080846B1 (en) Apparatus and method for color distortion correction of image by estimate of correction matrix
JP2008271556A (en) Image correction system and method
JP4093413B2 (en) Image processing apparatus, image processing program, and recording medium recording the program
US8295641B2 (en) Image processing apparatus, image processing method, and medium storing image processing program
JP2018196096A (en) Image processing system, image processing method and program
US8792131B2 (en) Image processing system, information processing system, control method, and program
CN108521535A (en) A kind of Information hiding transmission method based on image blend processing
CN105245756B (en) Image processing method and system
JP2022030055A (en) Image processing apparatus, image processing method, and program
EP3407252B1 (en) Image processing apparatus, image processing method, and storage medium
US20190073558A1 (en) Information processing apparatus, information processing method, and computer program
US20110069203A1 (en) Image processing apparatus, image processing method, and program
WO2011111191A1 (en) Image decoding device, image decoding method, and computer program for image decoding
CN112215237A (en) Image processing method and device, electronic equipment and computer readable storage medium
US20230388465A1 (en) Chroma adjustment method, electronic device and readable storage medium
US11924390B2 (en) Apparatus, method, and storage medium for performing color reduction processing
US20230085693A1 (en) Image capturing device and image calculation method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20150422

Termination date: 20151025

EXPY Termination of patent right or utility model