CN115629724A - Image processing method, printing method, image processing apparatus, printing system, and storage medium - Google Patents

Image processing method, printing method, image processing apparatus, printing system, and storage medium Download PDF

Info

Publication number
CN115629724A
CN115629724A CN202211321239.XA CN202211321239A CN115629724A CN 115629724 A CN115629724 A CN 115629724A CN 202211321239 A CN202211321239 A CN 202211321239A CN 115629724 A CN115629724 A CN 115629724A
Authority
CN
China
Prior art keywords
image
compressed file
data structure
printed
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211321239.XA
Other languages
Chinese (zh)
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.)
GRG Banking Equipment Co Ltd
Original Assignee
GRG Banking Equipment 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 GRG Banking Equipment Co Ltd filed Critical GRG Banking Equipment Co Ltd
Priority to CN202211321239.XA priority Critical patent/CN115629724A/en
Publication of CN115629724A publication Critical patent/CN115629724A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/12Digital output to print unit, e.g. line printer, chain printer
    • G06F3/1201Dedicated interfaces to print systems
    • G06F3/1223Dedicated interfaces to print systems specifically adapted to use a particular technique
    • G06F3/1237Print job management
    • G06F3/1244Job translation or job parsing, e.g. page banding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/12Digital output to print unit, e.g. line printer, chain printer
    • G06F3/1201Dedicated interfaces to print systems
    • G06F3/1202Dedicated interfaces to print systems specifically adapted to achieve a particular effect
    • G06F3/1211Improving printing performance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/12Digital output to print unit, e.g. line printer, chain printer
    • G06F3/1201Dedicated interfaces to print systems
    • G06F3/1278Dedicated interfaces to print systems specifically adapted to adopt a particular infrastructure
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T9/00Image coding

Abstract

The application discloses an image processing method, which comprises the following steps: the method comprises the steps of carrying out data analysis on an image of an object to be printed marked according to a preset rule to form a data structure of target data, and generating a compressed file of the image according to the data structure. According to the method, the image to be printed is marked according to a preset rule, marked data are analyzed, the obtained image data are compressed and combined again to obtain a new data structure, and finally the new data structure forms an image compressed file. The generated image data compression file only records partial data to be printed, and a large number of blank parts in the image are omitted, so that the image transmission load is reduced, and the printing efficiency is effectively improved.

Description

Image processing method, printing method, image processing apparatus, printing system, and storage medium
Technical Field
The present disclosure relates to the field of image processing technologies, and in particular, to an image processing method, a processing apparatus, an electronic device, and a computer-readable storage medium.
Background
With the development of the information digitization era, the digitalized technology is adopted for printing and filling the surface elements of valuable documents such as invoices, deposit slips, checks and the like which are used in daily life. At present, the printing content on the valuable document needs an upper computer to generate digital printing data, then the digital printing data is sent to a lower computer to be received and processed, and finally the printing action is carried out. However, when the image format content is digitally printed, the transmission communication load between the upper computer and the lower computer is large due to the large data volume, and the printing efficiency of the system is low.
Disclosure of Invention
The application provides an image processing method, an image printing method, a printing system, a processing device, a printing device, an electronic apparatus, and a computer-readable storage medium.
The image processing method of the present application includes:
performing data analysis on an image of an object to be printed marked according to a preset rule to form a data structure of target data;
and generating a compressed file of the image according to the data structure.
Therefore, the image to be printed is marked according to the preset rule, the marked data are analyzed, the obtained image data are compressed and combined again to obtain a new data structure, and finally the image compressed file is formed by the new data structure. The generated image data compression file only records partial data needing to be printed, and a large number of blank parts in the image are omitted, so that the image transmission load is reduced, and the printing efficiency is effectively improved.
In certain embodiments, the method further comprises:
generating an image of an object to be printed;
and labeling the image according to a preset rule.
Therefore, the upper computer generates the image of the object to be printed, and marks the pixel points in the image according to the preset rule, so that the subsequent printing rule can be conveniently executed.
In some embodiments, said annotating said image according to predetermined rules comprises:
and labeling the image according to the gray value of each pixel of the object to be printed, wherein the gray value of the pixel to be printed is not 255, and the gray value of the pixel not to be printed is 255.
Therefore, the gray value of each pixel of the object to be printed is labeled on the image, the pixel meeting the requirement of the preset gray value is judged to be required to be printed, and the pixel information not meeting the requirement of the preset gray value is discarded.
In some embodiments, the data analysis of the image of the object to be printed marked according to the predetermined rule to form the data structure of the target data includes:
traversing the image after the pixel gray value marking, and recording the gray value and the index value of the pixel to be printed in the image to form a data structure of the target data.
Thus, traversing the image subjected to gray value marking, recording the gray value and the index value of the pixel to be printed according to the gray value of the image, and combining the recorded gray value and the index value of the pixel to form a new data structure so as to assemble the newly formed data structure to obtain the target data.
In some embodiments, the generating a compressed file of the image from the data structure comprises:
and generating a compressed file of the image according to the data structure of all the recorded target data.
Thus, the image compression method in the invention can greatly reduce the data length without loss of printing content and has no loss of image quality by compressing all target data with non-empty indexes. Meanwhile, when encoding and decoding are carried out, the calculation complexity is very low, the implementation cost is low, the production efficiency is high, the compressed file is far smaller than the image data, the communication load of the printing system is greatly reduced, and the efficiency of the printing system is improved.
The image printing method of the present application includes:
performing data analysis on an image of an object to be printed marked according to a preset rule to form a data structure of target data;
generating a compressed file of the image according to the data structure;
and sending the compressed file to a lower computer to print the image.
Therefore, the upper computer can complete the analysis of the image data to be printed, form a new data structure, combine the image data into a compressed file, and transmit the compressed file to the lower computer so that the lower computer can restore the compressed file and print the compressed file after restoration.
In certain embodiments, the method comprises:
receiving a compressed file of an image of an object to be printed, which is sent by an upper computer, wherein the compressed file is generated according to a data structure of target data, and the upper computer performs data analysis on the image of the object to be printed, which is marked according to a preset rule, so as to form the data structure of the target data;
and finishing printing the image according to the compressed file.
In this way, in the present application, the lower computer can receive the compressed file transmitted from the upper computer and print an image from the compressed file.
In some embodiments, said completing printing of said image from said compressed file comprises:
decoding the compressed file according to the data structure so as to restore the compressed file;
and finishing printing the image according to the restored compressed file.
Therefore, after the lower computer receives the compressed file sent by the upper computer, the lower computer decodes the compressed file, namely, the non-empty index compressed coding data structure is decoded and restored into the data structure of the image, the compressed file is restored into the image file, the image file A is printed, and the printing requirement is completed.
The image processing apparatus of the present application includes:
the analysis module is used for carrying out data analysis on the image of the object to be printed marked according to the preset rule so as to form a data structure of target data;
and the compression module is used for generating a compressed file of the image according to the data structure.
The image printing apparatus of the present application includes:
the analysis module is used for carrying out data analysis on the image of the object to be printed marked according to the preset rule so as to form a data structure of target data;
the compression module is used for generating a compressed file of the image according to the data structure;
and the communication module is used for sending the compressed file to a lower computer so as to print the image.
The image printing apparatus of the present application includes:
the communication module is used for receiving a compressed file of an image of an object to be printed, which is sent by an upper computer, wherein the compressed file is generated according to a data structure of target data, and the upper computer performs data analysis on the image of the object to be printed, which is marked according to a preset rule, so as to form the data structure of the target data;
and the printing module is used for finishing printing the image according to the compressed file.
The printing system comprises an upper computer and a lower computer, wherein the upper computer and the lower computer are in information interaction,
the upper computer is used for carrying out data analysis on the image of the object to be printed marked according to a preset rule to form a data structure of target data, generating a compressed file of the image according to the data structure and sending the compressed file to the lower computer;
and the lower computer is used for finishing printing the image according to the compressed file.
The electronic equipment comprises a processor and a memory, wherein the memory stores a computer program, and the computer program realizes the image printing method when being executed by the processor.
The computer-readable storage medium of the present application stores a computer program that, when executed by one or more processors, implements the above-described image processing and image printing methods.
Additional aspects and advantages of embodiments of the present application will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of embodiments of the present application.
Drawings
The above and/or additional aspects and advantages of the present application will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
FIG. 1 is a schematic flow chart of an image processing method of the present application;
FIG. 2 is a block diagram of an image processing apparatus according to the present application;
FIG. 3 is a schematic diagram of the architecture of the printing system of the present application;
FIG. 4 is a schematic flow chart of an image printing method according to the present application;
FIG. 5 is a schematic flow chart of an image printing method according to the present application;
FIG. 6 is a block diagram of an image printing apparatus according to the present application;
FIG. 7 is a schematic flow chart of an image printing method according to the present application;
FIG. 8 is a block diagram of image printing according to the present application.
Detailed Description
Embodiments of the present invention will be described in detail below with reference to the accompanying drawings. The following embodiments are merely used to more clearly illustrate the technical solutions of the present application, and therefore, the following embodiments are only used as examples, and the scope of the present application is not limited thereby.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs; the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "including" and "having," and any variations thereof, in the description and claims of this application and the description of the above figures are intended to cover non-exclusive inclusions.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the present application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
Referring to fig. 1, the present application provides an image processing method, including:
01: performing data analysis on an image of an object to be printed marked according to a preset rule to form a data structure of target data;
02: a compressed file of the image is generated from the data structure.
Referring to fig. 2, the present application further provides an image processing apparatus 100. The image processing method of the present application can be realized by the image processing apparatus 100 of the present application. Specifically, the image processing apparatus includes an analysis module 101 and a compression module 102. The analysis module 101 is configured to perform data analysis on an image of an object to be printed, which is labeled according to a predetermined rule, to form a data structure of target data. And the compression module is used for generating a compressed file of the image according to the data structure.
Referring to fig. 3, the present application further provides a printing system 200, where the printing system 200 includes an upper computer and a lower computer. The image printing method of the present application is implemented by the printing system 200 including the upper computer and the lower computer provided by the present application. Specifically, the upper computer is used for performing data analysis on an image of an object to be printed, which is marked according to a preset rule, forming a data structure of target data, generating a compressed file of the image according to the data structure, and sending the compressed file to the lower computer. The lower computer is used for printing of images, and will be described in detail below.
The application also provides an electronic device comprising a memory and a processor. The image processing method of the present application may be implemented by the electronic device of the present application. Specifically, the memory has stored therein a computer program for performing data analysis on an image of an object to be printed annotated according to predetermined rules to form a data structure of target data, and for generating a compressed file of the image from the data structure.
The predetermined rule of the image processing method, the image data structure forming process, and the image compression process will be described in detail below.
Specifically, the image processing method provided by the application comprises the steps of firstly labeling an image to be printed according to a preset rule, analyzing labeled data, recompressing and combining the obtained image data to obtain a new data structure, and finally forming an image compressed file by the new data structure. In the printing of valuable documents, namely, daily invoices, deposit slips, checks and other bills, if a digital printing method is used in an image format, the digital quantity of the printing content of the image format is large, so that the digital printing method not only has higher requirement on the transmission capacity between an upper computer and a lower computer, but also directly using the image format for printing only occupies a small part of the picture, and the printing efficiency of a bill printing system is influenced. The image processing method of the application constructs a new data structure by analyzing and recombining image data, and the generated image data compression file only records partial data to be printed, and a large number of blank parts in the image are omitted. And only relate to the process to image information coding and decoding, it is simple to calculate, there is no loss to the quality of the picture, it is with low costs to realize, the production efficiency is high, the stability is good, it is easy to realize under the actual circumstances. The communication load of the image printing system is greatly reduced, and the printing efficiency is improved.
In summary, in this way, the image to be printed is marked according to the predetermined rule, the marked data is analyzed, the obtained image data is recompressed and combined to obtain a new data structure, and finally, the new data structure forms the image compression file. The generated image data compression file only records partial data to be printed, and a large number of blank parts in the image are omitted, so that the image transmission load is reduced, and the printing efficiency is effectively improved.
Referring to fig. 4, in some embodiments, the image processing method further includes:
011: generating an image of an object to be printed;
012: and labeling the image according to a preset rule.
In some embodiments, the processor is configured to generate an image of the object to be printed and label the image according to predetermined rules.
In some embodiments, the analysis module 101 is configured to generate an image of the object to be printed and label the image according to a predetermined rule.
Specifically, an image of an object to be printed is processed by an upper computer, such as a personal computer, to generate an image of the content to be printed. Let A be the image to be printed, W be the pattern width, and H be the image height. Let image a data length be L, then L = W × H.
The predetermined rules are used to label the image of the object to be printed, each pixel of the image being represented by an 8-bit binary gray value, i.e. 256 levels of gray 0,255 from pure black 0 to pure white 255, where 0 represents pure black and 255 then pure white. Obviously, in some embodiments, the image to be printed is a binary image, and the stored values are represented by 0 and 1, with 0 representing black and 1 representing white, and with 0 representing white and 1 representing black. In addition, the position of each pixel point relative to the whole image needs to be marked. The specific predetermined rule will be described in detail below.
Therefore, the upper computer generates the image of the object to be printed, and marks the pixel points in the image according to the preset rule, so that the subsequent printing rule can be conveniently executed.
In certain embodiments, step 012 further includes:
0121: labeling the image according to the gray value of each pixel of the object to be printed, wherein the gray value of the pixel to be printed is not 255, and the gray value of the pixel not to be printed is 255.
In some embodiments, the processor is configured to label the image according to a gray scale value of each pixel of the object to be printed, where the gray scale value of the pixel to be printed is not 255, and the gray scale value of the pixel not to be printed is 255.
In some embodiments, the analysis module 101 is configured to label the image according to a gray scale value of each pixel of the object to be printed, where the gray scale value of the pixel to be printed is not 255, and the gray scale value of the pixel not to be printed is 255.
Specifically, when printing is performed with the ticket image annotated with 256 gray scale values of [0-255], solid white 255 is the content that is not to be printed, and the content that is to be printed is a value other than 255. In some embodiments, compared to 256-level gray scale printing, a binary image may be represented by black with 1 and white with 0, or vice versa, and black with 0 and white with 1. Whether the gray image or the binary image in some embodiments described in this application, the value representing white or pure white is defined as a null value, and printing is not required; other values indicate that printing is required for non-null values.
In this way, the gray value of each pixel of the object to be printed is labeled, only the pixels meeting the requirement of the preset gray value are judged to be required to be printed, and the pixel point information not meeting the requirement of the preset gray value is discarded.
In certain embodiments, step 01 comprises:
013: traversing the image after the pixel gray value marking, and recording the gray value and the index value of the pixel to be printed in the image to form a data structure of the target data.
In some embodiments, the processor is configured to traverse the image after the pixel grayscale annotation, and record the grayscale value and the index value of the pixel to be printed in the image to form the data structure of the target data.
In some embodiments, the analysis module 101 is configured to traverse the image after the pixel gray scale labeling, and record the gray scale value and the index value of the pixel to be printed in the image to form the data structure of the target data.
Specifically, in the above embodiment, the data of the image a to be printed with the width W and the height H is analyzed, the image with the pixel grayscale value labeled is traversed, and in sequence, when the pixel grayscale value is found to be 255, no data information is recorded; when the gray value of the pixel point is not 255, the pixel point is determined to be required to be printed, and the gray value and the index value of the current pixel are recorded and can be set as the gray value a and the index value a x . And because the size of the image is L, the data length L of the image indicates that the data section has L values, the data section is arranged and stored according to the sequence of 1-L, and the index value is the coordinate value stored by the current pixel point. Will be likeThe gray value a and index value a of the pixel x By combining, a new data structure can be generated, set as X { a, a } x It contains the gray value a and index value a of the corresponding pixel point x The information of (1).
Thus, through traversal, the gray value and the index value of the pixel to be printed are recorded according to the gray value of the image, and the recorded gray value and the index value of the pixel are combined to form a new data structure, so that the newly formed data structure is collected to obtain the target data.
In certain embodiments, step 02 further comprises:
021: and generating a compressed file of the image according to the data structure of all the recorded target data.
In some embodiments, the processor is configured to generate a compressed file of the image based on the data structure of all of the recorded target data.
In some embodiments, the compression module 102 is configured to generate a compressed file of the image according to the data structure of all the recorded target data.
Specifically, in the foregoing description of the embodiment, for traversing, recording, or discarding all data in the image a, the gradation value a and the index value a to be printed will be x Are combined to generate a new data structure X { a, a } x }. Repeating the above process, and obtaining R data structures X { a, a) which are not repeated mutually by searching all non-null values in the image marking data x And finishing non-empty index compression coding on the data of the image A to obtain a compressed data storage file. The data length of the compressed data storage file can be set to be l, wherein the data length l of the compressed data storage file satisfies
Figure BDA0003910523680000071
In the formula (I), X i Denoted as the ith data structure X, and being a non-empty value and an index in the original image, 2 means that each data structure X contains a gray value a and an index value a x Two data fixed lengths.
Further, it is possible to obtain a difference d between the data length of the image a and the data length of the compressed file B. Let alpha denote the proportion of empty values in the image I and beta denote the proportion of non-empty values in the image, then
d=L-l
=L-(2×R)
=(α×L+β×L)-(2×R)
(II)
In formula (II), α + β =1.0, and α ∈ [0,1.0], β ∈ [0,1.0]. Obviously, β × L = R.
Then formula (II) can be transformed into
d=(α×L+β×L)-(2×R)
=α×L-β×L
(III)
In the actual scene of bill printing, the proportion of the non-null numerical values is large, namely according to experience, the proportion beta of the non-null numerical values generally meets the condition that beta is less than 0.1, and alpha is determined to meet the condition that alpha is more than 0.9 through the value of beta.
From the inequality calculation rules, it can be derived
α=1-β>1-0.1=0.9
Namely, it is
d≥(α-β)×L>(0.9-0.1)×L=0.8L
(IV)
l=L-d≤L-0.8L=0.2L
(V)
Obviously, according to formula (V), after non-empty index compression, the data length L of the compressed file B can be compressed by 80% compared with the data length L of the original image a. The image compression process is to convert the image data structure into a compression-coded data structure, and the contents to be printed are not lost due to compression.
Further, in the non-empty index compression process, the index value a x It may also be defined as the relative coordinate values defined between the previous R data structures, i.e. only the absolute coordinates of the first data structure are defined, and the other position coordinate values may be defined as the offset of the previous data structure.
Thus, the image compression method in the invention can greatly reduce the data length without loss of printing content and has no loss of image quality by compressing all target data with non-empty indexes. Meanwhile, when encoding and decoding, the calculation complexity is very low, the implementation cost is low, the production efficiency is high, the compressed file is far smaller than the image data, the communication load of the printing system is greatly reduced, and the efficiency of the printing system is improved.
Referring to fig. 4 and 5, the present application provides an image printing method, including:
01: performing data analysis on an image of an object to be printed marked according to a preset rule to form a data structure of target data;
02: generating a compressed file of the image according to the data structure;
03: and sending the compressed file to a lower computer to print the image.
Referring to fig. 6, the present application further provides an image printing apparatus 300. The image printing method of the present application can be realized by the image printing apparatus 300 of the present application. Specifically, the image printing apparatus includes an analysis module 301, a compression module 302, and a communication module 303. The analysis module 301 is configured to perform data analysis on an image of an object to be printed, which is labeled according to a predetermined rule, to form a data structure of target data. And the compression module is used for generating a compressed file of the image according to the data structure. The communication module 303 is configured to send the compressed file to a lower computer to print the image.
The application also provides an electronic device comprising a memory and a processor. The image printing method can be realized by the electronic equipment. Specifically, the memory stores a computer program, and the processor is configured to perform data analysis on an image of an object to be printed, which is labeled according to a predetermined rule, to form a data structure of target data, generate a compressed file of the image according to the data structure, and send the compressed file to the lower computer to print the image.
For the whole process of performing data analysis on the image of the object to be printed, which is executed by the upper computer and labeled according to the predetermined rule, to form the data structure of the target data, and generating the compressed file of the image according to the data structure, please refer to the explanation in the related embodiment of the image processing method, which is not described herein again.
Specifically, the image printing method according to the present embodiment takes the upper computer as an execution object, and after the compressed file is formed by the upper computer, transmits the compressed file B to the lower computer by data transmission. Because the data length of the compressed file B is only 20% of the original image file at most, compared with the image A, the communication load between the upper computer and the lower computer is greatly reduced
Therefore, the upper computer can complete the process of analyzing the image data to be printed in the image printing method, forming a new data structure, combining the data structure into a compressed file and transmitting the compressed file to the lower computer so that the lower computer can restore the compressed file and print the compressed file.
Referring to fig. 5 and 7, the image printing method of the present application further includes:
04: receiving a compressed file of an image of an object to be printed, which is sent by an upper computer;
05: and finishing printing the image according to the compressed file.
Wherein the compressed file is generated according to a data structure of the target data. And the upper computer performs data analysis on the image of the object to be printed marked according to the preset rule to form a data structure of the target data.
Referring to fig. 8, the present application further provides an image printing apparatus 400. The image printing method of the present application can be realized by the image printing apparatus 400 of the present application. Specifically, the image printing apparatus includes a communication module 401 and a press printing module 402. The communication module 401 is configured to receive a compressed file of an image of an object to be printed, which is sent by an upper computer. The printing module 402 is used to complete printing of the image according to the compressed file.
The application also provides an electronic device comprising a memory and a processor. The image printing method of the present application can be implemented by the electronic device of the present application. Specifically, the memory stores a computer program, and the processor is used for receiving a compressed file of an image of an object to be printed sent by the upper computer and completing printing of the image according to the compressed file.
Specifically, the image printing method of the present embodiment takes the lower computer as an execution object, and the file transmitted by the lower computer and received by the upper computer is the compressed file B of the image a to be printed. And after receiving the compressed file B, the lower computer decodes the compressed file B and restores the compressed file B into an image A. And the lower computer finishes printing the finally restored image file A on the basis of restoring the data structure.
In this way, in the present application, the lower computer can receive the compressed file transmitted from the upper computer and print an image from the compressed file.
In certain embodiments, step 05 comprises:
051: decoding the compressed file according to the data structure to restore the compressed file;
052: and finishing printing the image according to the restored compressed file.
In some embodiments, the processor is configured to decode the compressed file according to the data structure to restore the compressed file, and to complete printing the image according to the restored compressed file.
In some embodiments, the printing module 402 is configured to perform a decoding process on the compressed file according to the data structure to restore the compressed file, and to complete printing the image according to the restored compressed file.
Specifically, the file transmitted by the lower computer and received by the upper computer is a compressed file B of the image A to be printed. And after receiving the compressed file B, the lower computer decodes the compressed file B and restores the compressed file B into an image A. Suppose that the data storage space length of image A is buf [ L ]]Wherein L is the data length of the original image A, and the decoding process is the data backfill buf [ L ] in B]And (6) carrying out the process. The specific process is that firstly, buf [ L ] is put in]Is set to 255, i.e. null values, and then from the first data structure X 1 {a,a x Start parsing according to X 1 And a x Is filled in buf [ X ] 1 .a x ]And the compressed file B is restored to the image A by circulating for R times. Wherein the gray value is the original gray value, and the compressed and encoded data structure is decoded and restored into an imageThe data structure of (2). And the lower computer finishes printing the finally restored image file A on the basis of restoring the data structure.
In this way, after receiving the compressed file sent by the upper computer, the lower computer decodes the compressed file, i.e. decodes and restores the non-empty index compressed and encoded data structure into the data structure of the image, and converts the compressed file B into the image file a, and prints the image file a, thereby completing the printing requirement.
The present application also provides a computer-readable storage medium storing a computer program which, when executed by one or more processors, implements the above-described image processing and image printing methods.
In the description of the present specification, reference to the description of the terms "above," "specifically," "similarly," "particularly," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present application. In this specification, schematic representations of the above terms are not intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and the scope of the preferred embodiments of the present application includes other implementations in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present application.
Although embodiments of the present application have been shown and described above, it is to be understood that the above embodiments are exemplary and not to be construed as limiting the present application, and that changes, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present application.

Claims (15)

1. An image processing method, characterized by comprising:
performing data analysis on an image of an object to be printed marked according to a preset rule to form a data structure of target data;
and generating a compressed file of the image according to the data structure.
2. The method of claim 1, further comprising:
generating an image of an object to be printed;
and labeling the image according to a preset rule.
3. The method of claim 2, wherein the labeling the image according to the predetermined rule comprises:
and labeling the image according to the gray value of each pixel of the object to be printed, wherein the gray value of the pixel to be printed is not 255, and the gray value of the pixel not to be printed is 255.
4. The method according to claim 3, wherein the performing data analysis on the image of the object to be printed, labeled according to the predetermined rule, to form a data structure of the target data comprises:
traversing the image after the pixel gray value marking, and recording the gray value and the index value of the pixel to be printed in the image to form a data structure of the target data.
5. The method of claim 4, wherein generating the compressed file of the image from the data structure comprises:
and generating a compressed file of the image according to the data structure of all the recorded target data.
6. An image printing method, comprising:
performing data analysis on an image of an object to be printed marked according to a preset rule to form a data structure of target data;
generating a compressed file of the image according to the data structure;
and sending the compressed file to a lower computer to print the image.
7. An image printing method, comprising:
receiving a compressed file of an image of an object to be printed, which is sent by an upper computer, wherein the compressed file is generated according to a data structure of target data, and the upper computer performs data analysis on the image of the object to be printed, which is labeled according to a preset rule, so as to form the data structure of the target data;
and finishing printing the image according to the compressed file.
8. The method of claim 7, wherein said completing printing of said image from said compressed file comprises:
decoding the compressed file according to the data structure so as to restore the compressed file;
and finishing printing the image according to the restored compressed file.
9. An image processing apparatus characterized by comprising:
the analysis module is used for carrying out data analysis on the image of the object to be printed marked according to the preset rule so as to form a data structure of target data;
and the compression module is used for generating a compressed file of the image according to the data structure.
10. An image printing apparatus, characterized by comprising:
the analysis module is used for carrying out data analysis on the image of the object to be printed marked according to the preset rule so as to form a data structure of target data;
the compression module is used for generating a compressed file of the image according to the data structure;
and the communication module is used for sending the compressed file to a lower computer so as to print the image.
11. An image printing apparatus, characterized by comprising:
the communication module is used for receiving a compressed file of an image of an object to be printed, which is sent by an upper computer, wherein the compressed file is generated according to a data structure of target data, and the upper computer performs data analysis on the image of the object to be printed, which is marked according to a preset rule, so as to form the data structure of the target data;
and the printing module is used for finishing printing the image according to the compressed file.
12. A printing system is characterized by comprising an upper computer and a lower computer, wherein the upper computer and the lower computer are in information interaction,
the upper computer is used for carrying out data analysis on the image of the object to be printed marked according to a preset rule to form a data structure of target data, generating a compressed file of the image according to the data structure and sending the compressed file to the lower computer;
and the lower computer is used for finishing printing the image according to the compressed file.
13. An electronic device comprising a memory and a processor, the memory having stored therein a computer program that, when executed by the processor, implements the method of any of claims 1-6.
14. An electronic device comprising a memory and a processor, the memory having stored therein a computer program that, when executed by the processor, implements the method of claim 7 or 8.
15. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which, when executed by one or more processors, implements the method of any one of claims 1-8.
CN202211321239.XA 2022-10-26 2022-10-26 Image processing method, printing method, image processing apparatus, printing system, and storage medium Pending CN115629724A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211321239.XA CN115629724A (en) 2022-10-26 2022-10-26 Image processing method, printing method, image processing apparatus, printing system, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211321239.XA CN115629724A (en) 2022-10-26 2022-10-26 Image processing method, printing method, image processing apparatus, printing system, and storage medium

Publications (1)

Publication Number Publication Date
CN115629724A true CN115629724A (en) 2023-01-20

Family

ID=84906704

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211321239.XA Pending CN115629724A (en) 2022-10-26 2022-10-26 Image processing method, printing method, image processing apparatus, printing system, and storage medium

Country Status (1)

Country Link
CN (1) CN115629724A (en)

Similar Documents

Publication Publication Date Title
US7769237B2 (en) Dynamic, locally-adaptive, lossless palettization of color and grayscale images
JP2621747B2 (en) Image processing device
US6334001B2 (en) Iterative smoothing technique for pre-processing mixed raster content planes to improve the quality of a decompressed image and increase document compression ratios
US6275620B2 (en) Method and apparatus for pre-processing mixed raster content planes to improve the quality of a decompressed image and increase document compression ratios
KR100937543B1 (en) System and method facilitating document image compression utilizing a mask
JP4176114B2 (en) Image compression apparatus, image reading apparatus including the same, image processing apparatus including the image compression apparatus, image forming apparatus including the same, and image compression processing method
US20020061140A1 (en) Image processing apparatus and method, program and storage medium
KR20120065394A (en) Image processing apparatus and processing method therefor
US20050213164A1 (en) Fast method for fax encoded data conversion
JP3461309B2 (en) Huffman coded data compression device
CN109862365A (en) Image processing method and device
CN1207849A (en) Scan line compressed facsimile communication system
EP2302896A2 (en) Data processing apparatus and data processing method for compressing image data
CN115629724A (en) Image processing method, printing method, image processing apparatus, printing system, and storage medium
US7298894B2 (en) Color image conversion method and system for reducing color image data size
EP1006714A2 (en) Method of processing mixed raster content planes
US9137549B2 (en) Compressing image data
Saraswat et al. A study on size optimization of scanned textual documents
US8233731B2 (en) Method and apparatus to encode and decode halftone image
US6553144B1 (en) Coding method and coding apparatus for bi-level document image
JP3085932B2 (en) Apparatus for generating predicted image using mask and apparatus for compressing, transmitting and restoring binary image using the same
JP3281183B2 (en) Image encoding / decoding method and image encoding / decoding device
JP4757172B2 (en) Image coding apparatus and control method thereof
US8554000B2 (en) Image forming apparatus and method
JP3734871B2 (en) Image communication method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination