CN102375887A - 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
CN102375887A
CN102375887A CN2011103264629A CN201110326462A CN102375887A CN 102375887 A CN102375887 A CN 102375887A CN 2011103264629 A CN2011103264629 A CN 2011103264629A CN 201110326462 A CN201110326462 A CN 201110326462A CN 102375887 A CN102375887 A CN 102375887A
Authority
CN
China
Prior art keywords
file
image
tif
pixel
gray level
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN2011103264629A
Other languages
Chinese (zh)
Other versions
CN102375887B (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

Images

Landscapes

  • Facsimile Image Signal Circuits (AREA)
  • Image Processing (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 the document format switch technology, relate in particular to the conversion method and the device of TIF formatted file (standard fax paper form) document.
Background technology
At present; Develop rapidly along with the IT technology; IT application in enterprises is also more and more universal, and computer document and data layout are also more and more abundanter, wherein TIF formatted file owing to have little, the advantage such as flexibility strong, the view data exchange is simple that takes up room; Usually being applicable at the swap file between the application program and between the computer platform, is the standard format in file and picture and the document file management system.In computer application system, the TIF formatted file often is applied to Fax Server and document storage system.
The method that common document with extended formatting converts the TIF formatted file into is: the document that at first will change is printed as the PS/PCL file through virtual printer, adopts the transfer algorithm based on luminance threshold to convert the TIF formatted file to again.This conversion method has following defective:
1. adopt the transfer algorithm based on luminance threshold, this algorithm can cause the stereovision of picture to disappear;
2. the details of literal, picture is fuzzy, and the document of lighter color (like the scanning shelves) retrodeviates light in conversion;
3. multiple algorithm is provided simultaneously but can not self-adaptation input document (needing the user manually to select Doctype is that literal is main or picture is main, and the user need set suitable luminance threshold according to Doctype).
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 conversion back image, improve the sharpness of conversion back image, and have stronger adaptivity.
The objective of the invention is to realize through following technical scheme.
A kind of conversion method of TIF formatted file comprises step:
Convert document to be converted to bitmap file;
Said bitmap file is carried out the color range adjustment handle back generation gray level image;
Said gray level image is carried out converting the TIF formatted file to after the binary conversion treatment.
Wherein, the said process that converts document to be converted to bitmap file further comprises:
For text document to be converted, it is printed to through virtual printer convert bitmap file again into after printing script file; Image for to be converted is directly changed into bitmap file with it.
Wherein, when said gray level image is carried out binary conversion treatment, also adopt error diffusion dither algorithm that this gray level image is handled.
Wherein, the process of said color range adjustment processing further comprises:
Pixel to 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 the m% that entire image always counts at most bright value and obtain new maximum brightness value c; And all brightness values are made as c greater than the brightness value of the pixel of c, remove the n% that entire image always counts in the darkest value and obtain new minimum luminance value d, and all brightness values are made as d less than the brightness value of the pixel of d; The brightness value that resets brightness value in the image afterwards and be the pixel of c and d is respectively 255 and 0, readjusts the brightness value of each pixel therebetween then in proportion according to the statistics of said brightness value.
Wherein, the said process that gray level image is carried out binary conversion treatment further comprises:
Initialization is provided with brightness aggregate-value B 0With threshold value T B
The brightness value that reads each pixel successively carries out following processing: the brightness value b that reads current pixel point i, upgrade B 0=B 0+ b iJudge B 0Whether reach T BIf then current pixel point is set to white and upgrades B 0=B 0﹣ T B, if not then current pixel point is set to black; I=i+1 handles next pixel afterwards.
A kind of conversion equipment of TIF formatted file comprises:
Document to be converted is converted to the picture converting unit of bitmap file;
Said bitmap file is carried out the color range adjustment handle the gray scale processing unit that the back generates gray level image;
Gray level image is carried out converting to after the binary conversion treatment binaryzation converting unit of TIF formatted file.
Wherein, also comprise: the Error processing unit that when gray level image is carried out binary conversion treatment, adopts error diffusion dither algorithm that this gray level image is handled.
The beneficial effect of the embodiment of the invention is:
The present invention has adopted the binaryzation transfer algorithm based on the pixel aggregate-value, compares with the binaryzation transfer algorithm based on luminance threshold of available technology adopting, can increase the stereovision of the picture of final generation greatly; For the image of expression personage or landscape, after adopting scheme of the present invention to carry out conversion process, its profile not only can be described, its details can also clearly be described; Adopt Auto Laves adjustment processing scheme, can correct the inclined to one side shallow portion of colors such as scanned copy automatically, improved the sharpness of the picture of final generation; Thereby the present invention can be widely used in relying on the Fax Server field of TIF form transmission and with the document conversion field of TIF as storage format, improve the sharpness of conversion back document.
Description of drawings
Fig. 1 is the conversion device structure figure of the TIF formatted file that provides of the embodiment of the invention;
The conversion method process flow diagram of the TIF formatted file that Fig. 2 provides for the embodiment of the invention;
The binary conversion treatment process flow diagram that Fig. 3 provides for the embodiment of the invention based on the pixel intensity aggregate-value;
Fig. 4 and Fig. 5 are respectively the design sketch that adopts the TIF image that prior art conversion method and conversion method of the present invention obtain.
Embodiment
In order to make the object of the invention, technical scheme and advantage clearer,, the present invention is further elaborated below in conjunction with accompanying drawing and embodiment.Should be appreciated that specific embodiment described herein only in order to explanation the present invention, and be not used in qualification the present invention.
See also Fig. 1, realize in the present embodiment that the device of TIF formatted file conversion comprises with the lower part:
The picture converting unit is used for converting document to be converted to bitmap file;
The gray scale processing unit is used for that bitmap file is carried out the color range adjustment and handles back generation gray level image;
The binaryzation converting unit is used for gray level image is carried out converting the TIF formatted file to after the binary conversion treatment;
The Error processing unit is used for when gray level image is carried out binary conversion treatment, adopting error diffusion dither algorithm that this gray level image is handled.
Correspondingly, see also Fig. 2, realize in the present embodiment that the method for TIF formatted file conversion may further comprise the steps:
201, use the picture converting unit and convert document to be converted to bitmap file.
In this step,, convert bitmap file again into after needing earlier it to be printed to the printing script file through virtual printer for text document to be converted (like word document, ppt document etc.); For image to be converted (like the image that generates by scanner scanning), can it be directly changed into bitmap file.
202, bitmap file is carried out the color range adjustment and handle back generation gray level image.
Adopt automated manner to realize color range adjustment processing in this step: the pixel to image is added up by brightness value; Pixel to 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 less than threshold value k (before color range is handled; If image itself be literal or be evenly distributed just can not do color range again and handle); Predetermined threshold value m% and n% remove the m% that entire image always counts at most bright value and obtain new maximum brightness value c, and all brightness values are made as c greater than the brightness value of the pixel of c; Remove the n% that entire image always counts in the darkest value and obtain new minimum luminance value d, and all brightness values are made as d less than the brightness value of the pixel of d; The brightness value that resets brightness value in the image afterwards and be the pixel of c and d is respectively 255 and 0, readjusts the brightness value of each pixel therebetween then in proportion according to the statistics of said brightness value.
High light loss promptly for further expanded contrast, artificially enlarge 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 below 10 all is made as 10.Following be the description on the network, but the ratio value that here adopts is not 5.5, and the value of shadow loss and high light loss is also inconsistent, with the distribution value associated dynamic variation of pixel.At first converse Histogram; And detect its maximal value HistogramUp and minimum value HistogramDown and both difference HistogramDifer; Then the Auto Laves formula is: remove respectively on maximal value and minimum value limit that entire image always counts 5.5%; And with this as new maximal value and minimum value, and (R/G/B-histogrambottom) * 255.0/histogramdiffer is arranged; Value as this new point.
203, above-mentioned gray level image is carried out binary conversion treatment, convert the TIF formatted file to after adopting error diffusion dither algorithm to handle simultaneously.
In this step, binary conversion treatment adopts the transfer algorithm based on the brightness aggregate-value of pixel, sees also Fig. 3, specifically comprises:
Initialization is provided with 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 is set to white and upgrades B 0=B 0﹣ T B, if not then current pixel point is set to black;
I=i+1 handles next pixel afterwards.
Contrast the image that image that application prior art conversion process shown in Figure 4 obtains and application conversion process of the present invention shown in Figure 5 obtain and to know that the present invention has improved the sharpness of image greatly.
The above is merely preferred embodiment of the present invention, not in order to restriction the present invention, all any modifications of within spirit of the present invention and principle, being done, is equal to and replaces and improvement etc., all should be included within protection scope of the present invention.

Claims (7)

1. the conversion method of a TIF formatted file is characterized in that, the method comprising the steps of:
Convert document to be converted to bitmap file;
Said bitmap file is carried out the color range adjustment handle back generation gray level image;
Said gray level image is carried out converting the TIF formatted file to after the binary conversion treatment.
2. the conversion method of TIF formatted file as claimed in claim 1 is characterized in that, the said process that converts document to be converted to bitmap file further comprises:
For text document to be converted, it is printed to through virtual printer convert bitmap file again into after printing script file; Image for to be converted is directly changed into bitmap file with it.
3. the conversion method of TIF formatted file as claimed in claim 2 is characterized in that, in this method, when said gray level image is carried out binary conversion treatment, also adopts error diffusion dither algorithm that this gray level image is handled.
4. like the conversion method of claim 2 or 3 described TIF formatted files, it is characterized in that the process that said color range adjustment is handled further comprises:
Pixel to 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 the m% that entire image always counts at most bright value and obtain new maximum brightness value c; And all brightness values are made as c greater than the brightness value of the pixel of c, remove the n% that entire image always counts in the darkest value and obtain new minimum luminance value d, and all brightness values are made as d less than the brightness value of the pixel of d; The brightness value that resets brightness value in the image afterwards and be the pixel of c and d is respectively 255 and 0, readjusts the brightness value of each pixel therebetween then in proportion according to the statistics of said brightness value.
5. like the conversion method of claim 2 or 3 described TIF formatted files, it is characterized in that the said process that gray level image is carried out binary conversion treatment further comprises:
Initialization is provided with brightness aggregate-value B 0With threshold value T B
The brightness value that reads each pixel successively carries out following processing: the brightness value b that reads current pixel point i, upgrade B 0=B 0+ b iJudge B 0Whether reach T BIf then current pixel point is set to white and upgrades B 0=B 0﹣ T B, if not then current pixel point is set to black; I=i+1 handles next pixel afterwards.
6. the conversion equipment of a TIF formatted file is characterized in that, this device comprises:
Document to be converted is converted to the picture converting unit of bitmap file;
Said bitmap file is carried out the color range adjustment handle the gray scale processing unit that the back generates gray level image;
Gray level image is carried out converting to after the binary conversion treatment binaryzation converting unit of TIF formatted file.
7. the conversion equipment of TIF format file as claimed in claim 6 is characterized in that, this device also comprises: the Error processing unit that when gray level image is carried out binary conversion treatment, adopts error diffusion dither algorithm that this gray level image is handled.
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 true CN102375887A (en) 2012-03-14
CN102375887B 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)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106204563A (en) * 2016-07-04 2016-12-07 傲讯全通科技(深圳)有限公司 A kind of image conversion method
CN109284787A (en) * 2018-08-02 2019-01-29 广东南天司法鉴定所 A kind of method and apparatus of automatic collection handwritten form ink marks color range
CN109657211A (en) * 2018-12-11 2019-04-19 万兴科技股份有限公司 The method, apparatus and intelligent terminal of line format conversion
CN112417816A (en) * 2019-08-19 2021-02-26 珠海金山办公软件有限公司 Format conversion method and device of Word document and electronic equipment
CN112417817A (en) * 2019-08-19 2021-02-26 珠海金山办公软件有限公司 PDF document format conversion method and device and electronic equipment
CN113655536A (en) * 2021-08-17 2021-11-16 上海亨临光电科技有限公司 Terahertz image jitter calibration method

Citations (3)

* 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
US20060279655A1 (en) * 2005-05-31 2006-12-14 Jeff Chen User selectable image scaling
CN1993711A (en) * 2005-04-27 2007-07-04 Lg电子株式会社 Apparatus and method of conversing data

Patent Citations (3)

* 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
CN1993711A (en) * 2005-04-27 2007-07-04 Lg电子株式会社 Apparatus and method of conversing data
US20060279655A1 (en) * 2005-05-31 2006-12-14 Jeff Chen User selectable image scaling

Non-Patent Citations (1)

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

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106204563A (en) * 2016-07-04 2016-12-07 傲讯全通科技(深圳)有限公司 A kind of image conversion method
CN106204563B (en) * 2016-07-04 2019-11-15 傲讯全通科技(深圳)有限公司 A kind of image conversion method
CN109284787A (en) * 2018-08-02 2019-01-29 广东南天司法鉴定所 A kind of method and apparatus of automatic collection handwritten form ink marks color range
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
CN112417816A (en) * 2019-08-19 2021-02-26 珠海金山办公软件有限公司 Format conversion method and device of Word document and electronic equipment
CN112417817A (en) * 2019-08-19 2021-02-26 珠海金山办公软件有限公司 PDF document format conversion method and device and electronic equipment
CN113655536A (en) * 2021-08-17 2021-11-16 上海亨临光电科技有限公司 Terahertz image jitter calibration method

Also Published As

Publication number Publication date
CN102375887B (en) 2015-04-22

Similar Documents

Publication Publication Date Title
CN102375887B (en) Method and device for converting TIF (Tagged Image File) format file
US8705140B2 (en) Systems and methods for dynamic sharpness control in system using binary to continuous tone conversion
US7113648B1 (en) Image processing apparatus for correcting contrast of image
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
JP2004320701A (en) Image processing device, image processing program and storage medium
US20110216968A1 (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
US20140268194A1 (en) Method and System for Determining an Object Type from Raster Data in an Image Forming Apparatus
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
CN100429921C (en) Raster image path architecture
CN106952298A (en) Image set background template matching process and system based on self study
CN108521535A (en) A kind of Information hiding transmission method based on image blend processing
Ito et al. A coding method for high bit-depth images based on optimized bit-depth transform
US10057462B2 (en) Mechanism to perform force black color transformation
CN101222572B (en) White balance processing equipment
CN105245756A (en) Image processing method and system
CN101383975A (en) Method and apparatus for processing image and electronic device using the same
US7502145B2 (en) Systems and methods for improved line edge quality
Badawi et al. COLOR QR CODE RECOGNITION UTILIZING NEURAL NETWORK AND FUZZY LOGIC TECHNIQUES.
CN107979711B (en) Based on the method for optimizing distortion modification prevention hided transmission
US10638018B2 (en) Mechanism to perform force color parameter transformations
Tigora et al. Image Color Reduction Using Iterative Refinement

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