CN114475005A - Method, device, equipment and medium for setting white ink amount based on foreground image - Google Patents
Method, device, equipment and medium for setting white ink amount based on foreground image Download PDFInfo
- Publication number
- CN114475005A CN114475005A CN202210130503.5A CN202210130503A CN114475005A CN 114475005 A CN114475005 A CN 114475005A CN 202210130503 A CN202210130503 A CN 202210130503A CN 114475005 A CN114475005 A CN 114475005A
- Authority
- CN
- China
- Prior art keywords
- value
- image
- color
- channel
- foreground
- 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
Links
Images
Classifications
-
- B—PERFORMING OPERATIONS; TRANSPORTING
- B41—PRINTING; LINING MACHINES; TYPEWRITERS; STAMPS
- B41J—TYPEWRITERS; SELECTIVE PRINTING MECHANISMS, i.e. MECHANISMS PRINTING OTHERWISE THAN FROM A FORME; CORRECTION OF TYPOGRAPHICAL ERRORS
- B41J2/00—Typewriters or selective printing mechanisms characterised by the printing or marking process for which they are designed
- B41J2/005—Typewriters or selective printing mechanisms characterised by the printing or marking process for which they are designed characterised by bringing liquid or particles selectively into contact with a printing material
- B41J2/01—Ink jet
- B41J2/21—Ink jet for multi-colour printing
- B41J2/2107—Ink jet for multi-colour printing characterised by the ink properties
- B41J2/2114—Ejecting specialized liquids, e.g. transparent or processing liquids
- B41J2/2117—Ejecting white liquids
-
- B—PERFORMING OPERATIONS; TRANSPORTING
- B41—PRINTING; LINING MACHINES; TYPEWRITERS; STAMPS
- B41J—TYPEWRITERS; SELECTIVE PRINTING MECHANISMS, i.e. MECHANISMS PRINTING OTHERWISE THAN FROM A FORME; CORRECTION OF TYPOGRAPHICAL ERRORS
- B41J2/00—Typewriters or selective printing mechanisms characterised by the printing or marking process for which they are designed
- B41J2/005—Typewriters or selective printing mechanisms characterised by the printing or marking process for which they are designed characterised by bringing liquid or particles selectively into contact with a printing material
- B41J2/01—Ink jet
- B41J2/21—Ink jet for multi-colour printing
- B41J2/2121—Ink jet for multi-colour printing characterised by dot size, e.g. combinations of printed dots of different diameter
- B41J2/2128—Ink jet for multi-colour printing characterised by dot size, e.g. combinations of printed dots of different diameter by means of energy modulation
-
- B—PERFORMING OPERATIONS; TRANSPORTING
- B41—PRINTING; LINING MACHINES; TYPEWRITERS; STAMPS
- B41J—TYPEWRITERS; SELECTIVE PRINTING MECHANISMS, i.e. MECHANISMS PRINTING OTHERWISE THAN FROM A FORME; CORRECTION OF TYPOGRAPHICAL ERRORS
- B41J2/00—Typewriters or selective printing mechanisms characterised by the printing or marking process for which they are designed
- B41J2/005—Typewriters or selective printing mechanisms characterised by the printing or marking process for which they are designed characterised by bringing liquid or particles selectively into contact with a printing material
- B41J2/01—Ink jet
- B41J2/21—Ink jet for multi-colour printing
- B41J2/2132—Print quality control characterised by dot disposition, e.g. for reducing white stripes or banding
Landscapes
- Engineering & Computer Science (AREA)
- Quality & Reliability (AREA)
- Color Image Communication Systems (AREA)
- Ink Jet (AREA)
Abstract
The invention discloses a method, a device, equipment and a medium for setting white ink amount based on a foreground image. The method for setting the white ink amount of the printer comprises the steps of acquiring the color value of a printing medium and recording the color value as a first color value; acquiring a foreground image in an image to be printed after a background image is removed; processing the foreground image according to the first color value to obtain a first gray image; traversing the first gray scale image to obtain a first gray scale value of each pixel point in the gray scale image; comparing the first gray value with a set color threshold value to obtain a comparison result; and setting the ink value of the white ink channel when the foreground image is printed according to the comparison result. The method, the device, the equipment and the medium for setting the white ink quantity of the printer can save the ink quantity and reduce the printing cost.
Description
The application is a divisional application of an invention patent application with application number 201910343397.7, which is filed in 2019, 4, 26 and has the name of 'method, device, equipment and medium for setting the white ink amount of a printer'.
Technical Field
The invention relates to the field of ink-jet printing, in particular to a method, a device, equipment and a medium for setting white ink quantity based on a foreground image.
Background
The ink jet printing technology refers to a technology of ejecting ink droplets through nozzles on an ejection head onto a printing medium to obtain an image or characters. With the continuous progress of the technology, the color and material of the printing medium are more and more abundant, so that the color of a large area in the image to be printed is consistent with the color of the printing medium, for example, the image to be printed includes a background image and a foreground image, and the color of the background image is close to or almost the same as the color of the printing medium. Especially in the textile industry, when a color image is printed, a layer of white ink with an ink value of 100% needs to be printed for bottoming, and if all pixel points are subjected to ink discharge according to the existing method, not only the color ink but also the white ink are wasted, so that the printing cost is increased.
Disclosure of Invention
The embodiment of the invention provides a method, a device, equipment and a medium for setting white ink amount based on a foreground image, which are used for solving the problems of ink waste and printing cost increase caused by ink discharge of all pixel points when the color of a large area in an image to be printed is consistent with the color of a printing medium in the prior art.
In a first aspect, an embodiment of the present invention provides a method for setting a white ink amount based on a foreground image, where the method includes:
acquiring a color value of a printing medium, and recording the color value as a first color value;
acquiring a foreground image with a background image removed from an image to be printed, wherein the foreground image comprises: traversing all pixel points in the image to be printed to obtain the color value of each pixel point, and recording the color value as a third color value; performing data processing on the third color value and the first color value to obtain a corresponding first intermediate image; acquiring the foreground image according to the first intermediate image;
processing the foreground image according to the first color value to obtain a first gray image;
traversing the first gray scale image to obtain a first gray scale value of each pixel point in the first gray scale image;
comparing the first gray value with a set color threshold value to obtain a comparison result;
and setting the ink value of the white ink channel when the foreground image is printed according to the comparison result.
Preferably, the obtaining the foreground map from the first intermediate image comprises:
graying and binarizing the first intermediate image to obtain a binary image;
determining a foreground image area in the image to be printed according to the binary image;
and extracting a foreground image in the foreground image area from the image to be printed.
Preferably, the processing the foreground map according to the first color value to obtain a first gray scale map includes:
obtaining color values corresponding to all pixel points in the foreground image, and recording the color values as second color values;
acquiring a difference value corresponding to each pixel point according to the first color value and the second color value;
generating a second intermediate image according to the difference value corresponding to each pixel point;
and carrying out graying processing on the second intermediate image to obtain a corresponding first gray-scale image.
Preferably, when the color value in the lab color mode is calculated, obtaining the difference value corresponding to each pixel point according to the first color value and the second color value includes:
obtaining an ICC color conversion curve of the printer;
converting the first color value and the second color value into a corresponding first lab value and a corresponding second lab value according to the ICC color conversion curve;
and obtaining a corresponding difference value of each pixel point according to the first lab value and the second lab value.
Preferably, when the first gray value is A, the color threshold is T, and when A ≧ T, the ink quantity value of the white ink channel when the foreground image is printed is:
W=255-A
where W is the ink quantity value of white ink for the white ink channel when printing the foreground map.
Preferably, if the first gray value is a, the color threshold is T, and when a < T, the setting the ink amount value of the white ink in the white ink channel when the foreground image is printed according to the comparison result includes:
carrying out graying processing on the foreground image to obtain a second grayscale image;
traversing the second gray scale map to obtain a second gray scale value corresponding to each pixel point in the second gray scale map;
and setting the ink amount value of the white ink channel when the foreground image is printed according to the second gray value.
Preferably, the printer further includes a cyan channel, a magenta channel, a yellow channel, and a black channel, and when W is 0, the method further includes:
adjusting the ink values of the cyan channel, the magenta channel, the yellow channel and the black channel of the corresponding pixel point according to the ink value of the white channel, so that the ink values of the cyan channel, the magenta channel, the yellow channel and the black channel are as follows:
C=0,M=0,Y=0,K=0
where W is the ink amount value of the white ink channel when the foreground image is printed, C is the ink amount value of the cyan channel, M is the ink amount value of the magenta channel, Y is the ink amount value of the yellow channel, and K is the ink amount value of the black channel.
In a second aspect, an embodiment of the present invention provides a white ink amount setting apparatus based on a foreground map, the apparatus including:
the first color value acquisition module is used for acquiring the color value of the printing medium and recording the color value as the first color value; the foreground image obtaining module is used for obtaining the foreground image in the image to be printed after the background image is removed, and comprises: traversing all pixel points in the image to be printed to obtain the color value of each pixel point, and recording the color value as a third color value; performing data processing on the third color value and the first color value to obtain a corresponding first intermediate image; acquiring the foreground image according to the first intermediate image;
the first gray-scale image acquisition module is used for processing the foreground image according to the first color value to obtain a first gray-scale image;
the first gray value acquisition module is used for traversing the first gray image to acquire a first gray value of each pixel point in the gray image;
the comparison result acquisition module is used for comparing the first gray value with a set color threshold value to obtain a comparison result;
and the ink quantity setting module is used for setting the ink quantity value of the white ink channel when the foreground image is printed according to the comparison result.
In a third aspect, an embodiment of the present invention provides a white ink amount setting apparatus based on a foreground chart, including: at least one processor, at least one memory, and computer program instructions stored in the memory, which when executed by the processor, implement the method of the first aspect of the embodiments described above.
In a fourth aspect, embodiments of the present invention provide a storage medium having stored thereon computer program instructions, which when executed by a processor, implement the method of the first aspect in the above embodiments.
In summary, according to the method, the device, the equipment and the medium for setting the amount of white ink based on the foreground image provided by the embodiments of the present invention, the color value of the print medium is obtained, and is compared with the color values of all the pixels in the foreground image in the image to be printed, and the processed image color value is compared with the set color threshold value, so that the amount of white ink to be printed at each pixel when the foreground image is printed is obtained, which not only can save a part of the ink amount and reduce the printing cost, but also reasonably sets the amount of white ink according to the color value of each pixel in the foreground image instead of directly outputting 100% of the amount of white ink, so that the printed image has good transition and touch feeling.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required to be used in the embodiments of the present invention will be briefly described below, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart of a method of setting the amount of white ink for a printer according to a first embodiment of the present invention.
Fig. 2 is a flowchart of a method of setting the amount of white ink in a printer according to a second embodiment of the present invention.
Fig. 3 is a flowchart of a method of setting the amount of white ink in a printer according to a third embodiment of the present invention.
Fig. 4 is a flowchart of a method of setting the amount of white ink in a printer according to a fourth embodiment of the present invention.
Fig. 5 is a flowchart of a method of setting the amount of white ink in a printer according to a fifth embodiment of the present invention.
Fig. 6 is a flowchart of a method of setting the amount of white ink in a printer according to a sixth embodiment of the present invention.
FIG. 7 is a schematic configuration diagram of a white ink amount setting apparatus for a printer according to a seventh embodiment of the present invention.
Fig. 8 is a schematic structural view of a white ink amount setting apparatus for a printer according to an eighth embodiment of the present invention.
Detailed Description
Features and exemplary embodiments of various aspects of the present invention will be described in detail below, and in order to make objects, technical solutions and advantages of the present invention more apparent, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not to be construed as limiting the invention. It will be apparent to one skilled in the art that the present invention may be practiced without some of these specific details. The following description of the embodiments is merely intended to provide a better understanding of the present invention by illustrating examples of the present invention.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
Referring to fig. 1, in the method for setting white ink amount of a printer according to the embodiment of the present invention, the color value of the printing medium is obtained, and is compared with the color values of all the pixels in the foreground image of the image to be printed, and the color value of the processed image is compared with the set color threshold value, so as to obtain the amount of white ink to be printed at each pixel when the foreground image is printed, thereby not only saving a part of the ink amount and reducing the printing cost, but also reasonably setting the white ink amount instead of 100% of the white ink amount according to the color value of each pixel in the foreground image, so that the printed image has good transition and touch feeling. The method specifically comprises the following steps:
s1, acquiring a color value of the printing medium and recording the color value as a first color value;
specifically, when the color value of the printing medium used by the user is known, the color value input by the user on the image processing interactive interface can be directly obtained; when the color value of the printing medium used by the user is unknown, the color value of the printing medium may be acquired by scanning the printing medium using an image scanner (e.g., eyeone). Wherein, the color value input by the user on the image processing interactive interface or scanned and obtained by the image scanner is reflected differently in different color modes, for example, in the CMYK color mode, the first color value of the printing medium is (C)0、M0、Y0、K0) If in the RGB color mode, the first color value of the print medium is (R)0、G0、B0)。
S2, acquiring a foreground image in the image to be printed after the background image is removed;
specifically, in this embodiment, the image to be printed includes a background image and a foreground image, the foreground image is extracted from the image to be printed and placed into an image with a blank background and a size consistent with that of the original image, so as to form an intermediate image only including the foreground image, the intermediate image is printed during printing, and second color values of all pixel points in the intermediate image (i.e., the foreground image) are obtained, wherein when the foreground image is particularly large, a large amount of storage space needs to be consumed, and the requirement on printing accuracy is not high, the actual printing size of the foreground image can be stored, then the foreground image is scaled by the same scale, and the scaled foreground image is placed into the image with a blank background by the same scale after scaling.
Preferably, referring to fig. 2, removing the background image from the image to be printed to obtain the foreground image specifically includes the following steps:
s211, carrying out graying and binarization processing on the image to be printed to obtain a binary image;
s212, determining a foreground image area in the image to be printed according to the binary image;
s213, extracting the foreground image in the foreground image area from the image to be printed.
Specifically, in the embodiment, for the case that the color of the background image is relatively similar to the color of the printing medium, the to-be-printed image is directly grayed and binarized to obtain a binary image, then the foreground image area in the to-be-printed image is determined according to the binary image, and the foreground image is extracted from the foreground image area. The graying, binarization and foreground image extraction of the image to be printed are all processed by using an algorithm function in an image processing library (such as opencv), which is the prior art and is not described herein again.
Referring to fig. 3, in another embodiment, the step of removing the background image from the image to be printed to obtain the foreground image specifically includes the following steps:
s221, traversing all pixel points in the image to be printed to obtain the color value of each pixel point, and recording the color value as a third color value;
s222, performing data processing on the third color value and the first color value to obtain a corresponding intermediate image;
s223, carrying out graying and binarization processing on the intermediate image to obtain a binary image;
s224, determining a foreground image area in the image to be printed according to the binary image;
and S225, extracting the foreground image in the foreground image area from the image to be printed.
Specifically, in this embodiment, for the case that the color of the background map is far from the color of the printing medium, a difference value is first made between the third color values of all the pixel points in the image to be printed and the first color value of the printing medium to obtain an intermediate image, then the intermediate image is grayed and binarized to obtain a binary image, finally, a foreground map region in the image to be printed is determined according to the binary image, a foreground map is extracted from the foreground map region, and the foreground map is traversed to obtain the second color values of all the pixel points in the foreground map. The graying, binarization and foreground image extraction processing of the image to be printed are also processed by using an algorithm function in an image processing library (such as opencv), which is the prior art and is not described herein again.
S3, processing the foreground image according to the first color value to obtain a first gray image;
specifically, color values of all pixel points in the foreground image are obtained, the first color value is subtracted from the color values of all pixel points in the foreground image to obtain an intermediate image, and graying is adopted to process the intermediate image to obtain a gray image, so that the gray value of each pixel point in the foreground image is a value, and unlike the case that each pixel point in the color image in an RGB mode comprises R, G, B three values, or each pixel point in the color image in a CMYK mode comprises C, M, Y, K four values, the color image cannot be subjected to color value comparison, and therefore graying processing of the image is required to facilitate color value comparison and data processing.
Preferably, referring to fig. 4, the specific step of processing the foreground image according to the first color value to obtain a first gray scale image includes:
s31, obtaining color values corresponding to all pixel points in the foreground image, and recording the color values as second color values;
s32, acquiring a difference value corresponding to each pixel point according to the first color value and the second color value;
s33, generating an intermediate image according to the difference value corresponding to each pixel point;
and S34, carrying out graying processing on the intermediate image to obtain a corresponding first grayscale image.
Specifically, the first color value and the second color value are converted into color values in the same color mode, such as color values in a CMYK color mode or color values in a lab color mode, then the first color value and the second color value are subjected to difference to obtain a difference value of each pixel, specifically, an absolute value of each difference value is taken as a color value of each pixel in the intermediate image, and if in the CMYK color mode, the first color value is: c1=20、M1=60、Y1=50、K1The second color value of a certain pixel point is as follows: c2=10、M2=30、Y2=40、K2If the pixel point is 50, the difference value of the pixel point is that delta C is | C1-C2|=10、△M=|M1-M2|=30、△Y=|M1-M2|=10、△K=|M1-M2|=20。
Preferably, referring to fig. 5, when the color value in the lab color mode is used for calculation, the specific method for obtaining the difference value of each pixel point includes the following steps:
s311, obtaining an ICC color conversion curve of the printer;
s312, converting the first color value and the second color value into a corresponding first lab value and a corresponding second lab value according to the ICC color conversion curve;
s313, obtaining the corresponding difference value of each pixel point according to the first lab value and the second lab value.
Specifically, an ICC curve of a color management curve of a printer executing a print job is obtained, the first color value and the second color value are converted into a corresponding first lab value and a corresponding second lab value through the ICC curve, a difference value corresponding to each pixel point is obtained by performing difference calculation on the second lab value corresponding to each pixel point and the first lab value of the print medium, and in the lab color mode, the first color value is: l is1=50、a1=40、b1The second color value of a certain pixel point is as follows: l is2=30、a2=60、b2If 70, the difference value of the pixel point is:Δl ═ L1-L2|=20、△a=|a1-a2|=30、△b=|b1-b2And if the value is 40, the difference value obtained by calculating the lab value is more accurate than the color difference value obtained by calculating in other color modes.
Preferably, when the color value is a color value in an RGB color mode, the conversion formula in the graying process is:
Gray=R×0.299+G×0.587+B×0.114
wherein Gray represents the Gray value of the pixel or the print medium, and the color value of the pixel or the print medium in the RGB color mode is (R, G, B).
When the color value is the color value in the CMYK color mode, the conversion formula in the graying process is:
wherein Gray represents the Gray value of the pixel or the print medium, and the color value of the pixel or the print medium in the CMYK color mode is (C, M, Y, K).
S4, traversing the first gray scale image to obtain a first gray scale value of each pixel point in the gray scale image;
specifically, the existing traversal algorithm is adopted to traverse all the pixel points in the first gray scale map to obtain the first gray scale value of each pixel point.
S5, comparing the first gray value with a set color threshold value to obtain a comparison result;
specifically, the first gray value of each pixel point is compared with a color threshold (for example, the color threshold is 1.5) obtained according to the characteristics of the printer to obtain a comparison result, and the ink discharge condition of each pixel point during printing is determined according to the comparison result.
And S6, setting the ink quantity value of the white ink channel when the foreground image is printed according to the comparison result.
Specifically, in this embodiment, the white ink channel and the other color channels are parameter names for setting the usage of the corresponding ink, and the range of the ink amount value of the white ink in the white ink channel is 0 to 100%, where the specific data value range of the ink amount value of the ink during printing is set by the user according to different printing devices and usage environments, and is a standard for quantifying the ink condition that the pixel point needs to be printed. In this embodiment, let a first gray value be a, the color threshold be T, and when a ≧ T, the ink quantity value of the white ink in the white ink channel when printing the foreground map is:
W=255-A
where W is the ink quantity value of white ink for the white ink channel when printing the foreground map.
Referring to fig. 6, when a < T, the setting the ink amount value of the white ink channel when the foreground image is printed according to the comparison result includes:
s61, carrying out graying processing on the foreground image to obtain a second gray image;
s62, traversing the second gray scale map to obtain a second gray scale value corresponding to each pixel point in the second gray scale map;
and S63, setting the ink quantity value of the white ink channel when the foreground image is printed according to the second gray value.
Specifically, graying the color foreground image to obtain a gray image, marking the gray image as a second gray image, obtaining a second gray value corresponding to each pixel point in the gray image by adopting the existing traversal algorithm, calculating and obtaining the ink quantity value of the white ink channel when the foreground image is printed according to the second gray value, setting the second gray value as B, and setting the ink quantity value of the white ink channel when the foreground image is printed according to the second gray value as follows:
W=255-B
where W is the ink quantity value of white ink for the white ink channel when printing the foreground map.
Preferably, the printer further includes a cyan channel, a magenta channel, a yellow channel, and a black channel, and when W is 0, the method further includes:
adjusting the ink values of the cyan channel, the magenta channel, the yellow channel and the black channel of the corresponding pixel point according to the ink value of the white channel, so that the ink values of the cyan channel, the magenta channel, the yellow channel and the black channel are as follows:
C=0,M=0,Y=0,K=0
where C is the ink value for the cyan channel, M is the ink value for the magenta channel, Y is the ink value for the yellow channel, and K is the ink value for the black channel.
Specifically, when the ink amount value of the white channel obtained by calculation is 0, the color values of the other channels of the printer are also adjusted to be 0, that is, the white channel does not discharge ink, and the other channels do not discharge ink, and meanwhile, in this embodiment, when the ink amount values of all the channels corresponding to the pixel points in the foreground map are 0, the ink amount value of the white channel is also zero. The printer may also include a spot color channel, such as a red color channel, a blue color channel, and the like, and when the ink amount value of the white color channel is zero, the ink amount value of the spot color channel is also zero.
The ink amount value of the white ink channel is adjusted according to the comparison result of the color value in the foreground image and the threshold value instead of directly setting the ink amount value of the white ink channel to be 100% according to the traditional method, so that the waste of the ink amount is avoided, and meanwhile, the background image is removed to directly print the foreground image, so that the ink amount (including the color ink amount and the white ink amount) of the background image is saved, and the printing cost is reduced.
Referring to fig. 7, an embodiment of the present invention provides a device for setting a white ink amount of a printer, the device including:
a first color value obtaining module 10, configured to obtain a color value of a printing medium, and record the color value as a first color value;
a foreground image obtaining module 20, configured to obtain a foreground image obtained after removing a background image from an image to be printed;
a first grayscale image obtaining module 30, configured to process the foreground image according to the first color value to obtain a first grayscale image;
the first gray value obtaining module 40 is configured to traverse the first gray map to obtain a first gray value of each pixel point in the gray map;
a comparison result obtaining module 50, configured to compare the first gray value with a set color threshold to obtain a comparison result;
and an ink amount setting module 60, configured to set an ink amount value of the white ink in the white ink channel when the foreground image is printed according to the comparison result.
Preferably, the first gray scale image obtaining module 30 includes:
the second color value acquisition unit is used for acquiring color values corresponding to all pixel points in the foreground image and recording the color values as second color values;
the color difference value acquisition unit is used for acquiring the difference value corresponding to each pixel point according to the first color value and the second color value;
the intermediate image generating unit is used for generating an intermediate image according to the difference value corresponding to each pixel point;
and the first gray-scale image acquisition unit is used for carrying out gray-scale processing on the intermediate image to obtain a corresponding first gray-scale image.
Preferably, when the first gray value is A, the color threshold is T, and when A ≧ T, the ink quantity value of the white ink channel when the foreground image is printed is:
W=255-A
where W is the ink quantity value of white ink for the white ink channel when printing the foreground map.
Preferably, assuming that the first gray value is a and the color threshold is T, when a < T, the ink amount setting module 60 includes:
the second gray-scale image acquisition unit is used for carrying out gray-scale processing on the foreground image to obtain a second gray-scale image;
the second gray value acquisition unit is used for traversing the second gray map to acquire a second gray value corresponding to each pixel point in the second gray map;
and the ink quantity value acquisition unit is used for setting the ink quantity value of the white ink channel when the foreground image is printed according to the second gray value.
Preferably, if the second gray value is B, the ink amount value of the white ink in the white ink channel when the foreground image is printed is set as:
W=255-B
where W is the ink quantity value of white ink for the white ink channel when printing the foreground map.
Preferably, the printer further includes a cyan channel, a magenta channel, a yellow channel, and a black channel, and when W is 0, the method further includes:
adjusting the ink values of the cyan channel, the magenta channel, the yellow channel and the black channel of the corresponding pixel point according to the ink value of the white channel, so that the ink values of the cyan channel, the magenta channel, the yellow channel and the black channel are as follows:
C=0,M=0,Y=0,K=0
where C is the ink value for the cyan channel, M is the ink value for the magenta channel, Y is the ink value for the yellow channel, and K is the ink value for the black channel.
Preferably, the gray scale calculation formula of the graying process is as follows:
when the color value of the image is a value in an RGB color mode, the gray scale calculation formula is:
Gray=R×0.299+G×0.587+B×0.114
when the color value of the image is the value in the CMYK color mode, the gray scale calculation formula is:
where Gray represents a Gray value, a color value of the image in the RGB color mode is (R, G, B), and a color value of the image in the CMYK color mode is (C, M, Y, K).
In addition, the method of setting the amount of white ink for a printer of the embodiment of the present invention described in conjunction with fig. 1 can be implemented by a device for setting the amount of white ink for a printer. Fig. 8 is a schematic diagram showing a hardware configuration of a device for setting the white ink amount of a printer according to an embodiment of the present invention.
The printer white ink volume setting device may include a processor 401 and a memory 402 storing computer program instructions.
Specifically, the processor 401 may include a Central Processing Unit (CPU), or an Application Specific Integrated Circuit (ASIC), or may be configured as one or more Integrated circuits implementing embodiments of the present invention.
The processor 401 reads and executes computer program instructions stored in the memory 402 to implement the method for setting the amount of white ink for a printer according to any of the above-described embodiments.
In one example, the device for setting the amount of white ink of a printer may further include a communication interface 403 and a bus 410. As shown in fig. 8, the processor 401, the memory 402, and the communication interface 403 are connected via a bus 410 to complete communication therebetween.
The communication interface 403 is mainly used for implementing communication between modules, apparatuses, units and/or devices in the embodiments of the present invention.
The bus 410 includes hardware, software, or both that couple the components of the printer white ink volume setting device to each other. By way of example, and not limitation, a bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hypertransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an infiniband interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a video electronics standards association local (VLB) bus, or other suitable bus or a combination of two or more of these. Bus 410 may include one or more buses, where appropriate. Although specific buses have been described and shown in the embodiments of the invention, any suitable buses or interconnects are contemplated by the invention.
In addition, in combination with the method for setting the white ink amount of the printer in the above embodiment, the embodiment of the present invention can be implemented by providing a computer-readable storage medium. The computer readable storage medium having stored thereon computer program instructions; the computer program instructions, when executed by a processor, implement any of the above described embodiments of the method for setting white ink volume for a printer.
In summary, according to the method, the device, the equipment and the medium for setting the white ink amount of the printer provided by the embodiments of the present invention, the color value of the printing medium is obtained, and is compared with the color values of all the pixels in the foreground image in the image to be printed, and the processed image color value is compared with the set color threshold value to obtain the amount of the white ink to be printed at each pixel when the foreground image is printed, so that not only can part of the ink amount be saved, but also the printing cost is reduced, and the white ink amount is reasonably set according to the color value of each pixel in the foreground image instead of 100% of the white ink amount, so that the printed image has good transition and touch feeling.
It should also be noted that the exemplary embodiments mentioned in this patent describe some methods or systems based on a series of steps or devices. However, the present invention is not limited to the order of the above-described steps, that is, the steps may be performed in the order mentioned in the embodiments, may be performed in an order different from the order in the embodiments, or may be performed simultaneously.
As described above, only the specific embodiments of the present invention are provided, and it can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the system, the module and the unit described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again. It should be understood that the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive various equivalent modifications or substitutions within the technical scope of the present invention, and these modifications or substitutions should be covered within the scope of the present invention.
Claims (10)
1. A method for setting a white ink amount based on a foreground map, the method comprising:
acquiring a color value of a printing medium, and recording the color value as a first color value;
acquiring a foreground image with a background image removed from an image to be printed, wherein the foreground image comprises: traversing all pixel points in the image to be printed to obtain the color value of each pixel point, and recording the color value as a third color value; performing data processing on the third color value and the first color value to obtain a corresponding first intermediate image; acquiring the foreground image according to the first intermediate image;
processing the foreground image according to the first color value to obtain a first gray image;
traversing the first gray scale image to obtain a first gray scale value of each pixel point in the first gray scale image;
comparing the first gray value with a set color threshold value to obtain a comparison result;
and setting the ink value of the white ink channel when the foreground image is printed according to the comparison result.
2. The method according to claim 1, wherein said acquiring the foreground map from the first intermediate image includes:
graying and binarizing the first intermediate image to obtain a binary image;
determining a foreground image area in the image to be printed according to the binary image;
and extracting a foreground image in the foreground image area from the image to be printed.
3. The method according to claim 1, wherein the processing the foreground map according to the first color value to obtain a first gray scale map comprises:
obtaining color values corresponding to all pixel points in the foreground image, and recording the color values as second color values;
acquiring a difference value corresponding to each pixel point according to the first color value and the second color value;
generating a second intermediate image according to the difference value corresponding to each pixel point;
and carrying out graying processing on the second intermediate image to obtain a corresponding first gray-scale image.
4. The method of claim 3, wherein when calculating the color value in lab color mode, obtaining the difference corresponding to each pixel according to the first color value and the second color value comprises:
obtaining an ICC color conversion curve of the printer;
converting the first color value and the second color value into a corresponding first lab value and a corresponding second lab value according to the ICC color conversion curve;
and obtaining a corresponding difference value of each pixel point according to the first lab value and the second lab value.
5. The method according to any one of claims 1 to 4, wherein when the first gray value is A, the color threshold is T, and when A ≧ T, the ink amount of white ink in the white ink channel when printing the foreground map is:
W=255-A
where W is the ink quantity value of white ink for the white ink channel when printing the foreground map.
6. The method according to any one of claims 1 to 4, wherein the setting of the ink amount value of the white ink in the white ink channel when printing the foreground map according to the comparison result when A < T, assuming that the first gray value is A and the color threshold value is T, comprises:
carrying out graying processing on the foreground image to obtain a second grayscale image;
traversing the second gray scale map to obtain a second gray scale value corresponding to each pixel point in the second gray scale map;
and setting the ink amount value of the white ink channel when the foreground image is printed according to the second gray value.
7. The foreground map-based white ink amount setting method according to claim 6, wherein the printer further includes a cyan channel, a magenta channel, a yellow channel, and a black channel, and when W is 0, the method further includes:
adjusting the ink values of the cyan channel, the magenta channel, the yellow channel and the black channel of the corresponding pixel point according to the ink value of the white channel, so that the ink values of the cyan channel, the magenta channel, the yellow channel and the black channel are as follows:
C=0,M=0,Y=0,K=0
where W is the ink amount value of the white ink channel when the foreground image is printed, C is the ink amount value of the cyan channel, M is the ink amount value of the magenta channel, Y is the ink amount value of the yellow channel, and K is the ink amount value of the black channel.
8. A white ink amount setting apparatus based on a foreground map, characterized by comprising:
the first color value acquisition module is used for acquiring the color value of the printing medium and recording the color value as the first color value;
the foreground image obtaining module is used for obtaining the foreground image in the image to be printed after the background image is removed, and comprises: traversing all pixel points in the image to be printed to obtain the color value of each pixel point, and recording the color value as a third color value; performing data processing on the third color value and the first color value to obtain a corresponding first intermediate image; acquiring the foreground image according to the first intermediate image;
the first gray-scale image acquisition module is used for processing the foreground image according to the first color value to obtain a first gray-scale image;
the first gray value acquisition module is used for traversing the first gray image to acquire a first gray value of each pixel point in the gray image;
the comparison result acquisition module is used for comparing the first gray value with a set color threshold value to obtain a comparison result;
and the ink quantity setting module is used for setting the ink quantity value of the white ink channel when the foreground image is printed according to the comparison result.
9. A white ink amount setting apparatus based on a foreground map, characterized by comprising: at least one processor, at least one memory, and computer program instructions stored in the memory that, when executed by the processor, implement the method of any of claims 1-7.
10. A storage medium having computer program instructions stored thereon, which when executed by a processor implement the method of any one of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210130503.5A CN114475005B (en) | 2019-04-26 | 2019-04-26 | Method, device, equipment and medium for setting white ink quantity based on foreground image |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910343397.7A CN111845099B (en) | 2019-04-26 | 2019-04-26 | Method, device, equipment and medium for setting white ink quantity of printer |
CN202210130503.5A CN114475005B (en) | 2019-04-26 | 2019-04-26 | Method, device, equipment and medium for setting white ink quantity based on foreground image |
Related Parent Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910343397.7A Division CN111845099B (en) | 2019-04-26 | 2019-04-26 | Method, device, equipment and medium for setting white ink quantity of printer |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114475005A true CN114475005A (en) | 2022-05-13 |
CN114475005B CN114475005B (en) | 2023-04-28 |
Family
ID=72951723
Family Applications (2)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910343397.7A Active CN111845099B (en) | 2019-04-26 | 2019-04-26 | Method, device, equipment and medium for setting white ink quantity of printer |
CN202210130503.5A Active CN114475005B (en) | 2019-04-26 | 2019-04-26 | Method, device, equipment and medium for setting white ink quantity based on foreground image |
Family Applications Before (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910343397.7A Active CN111845099B (en) | 2019-04-26 | 2019-04-26 | Method, device, equipment and medium for setting white ink quantity of printer |
Country Status (1)
Country | Link |
---|---|
CN (2) | CN111845099B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112549792A (en) * | 2020-12-03 | 2021-03-26 | 深圳诚拓数码设备有限公司 | Fabric printing method and fabric printing equipment |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101247463A (en) * | 2007-02-15 | 2008-08-20 | 夏普株式会社 | Image processing method and image processing apparatus |
US20100177327A1 (en) * | 2006-02-16 | 2010-07-15 | Sanjay Chandermohan Maheshwari | Method and Apparatus for Generating White Underbase and Generating Suitably Modified Separations for Printing on Colored Background Other than White |
JP2013154516A (en) * | 2012-01-27 | 2013-08-15 | Brother Industries Ltd | Apparatus and program for generating print data |
CN105829114A (en) * | 2013-12-18 | 2016-08-03 | 惠普发展公司,有限责任合伙企业 | Printer calibration for media color |
CN108960351A (en) * | 2018-07-11 | 2018-12-07 | 森大(深圳)技术有限公司 | Image printing method, device, equipment and storage medium |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP3728884B2 (en) * | 1997-08-01 | 2005-12-21 | ソニー株式会社 | Image processing apparatus and method, image composition apparatus, and recording medium |
JP3830350B2 (en) * | 2001-01-31 | 2006-10-04 | 株式会社リコー | Color image processing method, color image processing apparatus, program, and recording medium |
JP5597995B2 (en) * | 2009-04-03 | 2014-10-01 | セイコーエプソン株式会社 | Printing with multiple color inks including white ink |
JP5655357B2 (en) * | 2009-11-05 | 2015-01-21 | セイコーエプソン株式会社 | Printing apparatus and printing method |
JP2011194832A (en) * | 2010-03-23 | 2011-10-06 | Seiko Epson Corp | Printing method and program |
US8861053B2 (en) * | 2012-11-02 | 2014-10-14 | Electronics For Imaging, Inc. | Method and apparatus for automated generation of a white ink separation out of CMYK data or RGB print data |
US10235612B2 (en) * | 2016-07-29 | 2019-03-19 | Canon Kabushiki Kaisha | Information processing apparatus, information processing method, storage medium, and image forming apparatus for converting drawing data of a transparent object that does not overlap another drawing object into drawing data of a drawing object that does not have an alpha channel as color information |
-
2019
- 2019-04-26 CN CN201910343397.7A patent/CN111845099B/en active Active
- 2019-04-26 CN CN202210130503.5A patent/CN114475005B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20100177327A1 (en) * | 2006-02-16 | 2010-07-15 | Sanjay Chandermohan Maheshwari | Method and Apparatus for Generating White Underbase and Generating Suitably Modified Separations for Printing on Colored Background Other than White |
CN101247463A (en) * | 2007-02-15 | 2008-08-20 | 夏普株式会社 | Image processing method and image processing apparatus |
JP2013154516A (en) * | 2012-01-27 | 2013-08-15 | Brother Industries Ltd | Apparatus and program for generating print data |
CN105829114A (en) * | 2013-12-18 | 2016-08-03 | 惠普发展公司,有限责任合伙企业 | Printer calibration for media color |
CN108960351A (en) * | 2018-07-11 | 2018-12-07 | 森大(深圳)技术有限公司 | Image printing method, device, equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN111845099A (en) | 2020-10-30 |
CN111845099B (en) | 2022-03-01 |
CN114475005B (en) | 2023-04-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111845084B (en) | Printer ink amount adjusting method, device, equipment and medium based on image processing | |
US9649839B2 (en) | Image processing apparatus and image processing method | |
US8619278B2 (en) | Printed matter examination apparatus, printed matter examination method, and printed matter examination system | |
US8040569B2 (en) | Image processing apparatus and method for contrast processing and intermediate color removal | |
JP7220629B2 (en) | Image discrimination model construction method, image discrimination device, and image discrimination method | |
CN111845101B (en) | Printer ink amount adjusting method, device, equipment and medium based on color management | |
US9965227B2 (en) | Image processing apparatus, image processing method, computer-readable recording medium, printing system, and method of producing printed material | |
KR20050107157A (en) | Appratus and method of improving image | |
US6125200A (en) | Removing non-text information from a color image | |
JP5146942B2 (en) | CONVERSION METHOD, DEVICE, AND COMPUTER PROGRAM FOR CONVERTING DIGITAL IMAGE OBTAINED BY SCANNER | |
US8229214B2 (en) | Image processing apparatus and image processing method | |
JP5146029B2 (en) | Printing apparatus, printing control apparatus, printing method, and computer program | |
CN111845098B (en) | Method, device, equipment and medium for adjusting ink amount of printer | |
CN111845099B (en) | Method, device, equipment and medium for setting white ink quantity of printer | |
JP4941331B2 (en) | Printing method, printing apparatus, correspondence table generation method, and program | |
CN111845100B (en) | Printer ink amount setting method, device, equipment and medium based on image processing | |
US10286675B2 (en) | Recording apparatus and recording method | |
JP2010119006A (en) | Image processing apparatus,and image processing method | |
US8289573B2 (en) | Method for reducing registration defects in color printing | |
JP2005324459A (en) | Image processing method and image forming system | |
JPH1091792A (en) | Document segmentation method, apparatus, color printing system and computer program product | |
JP5162430B2 (en) | Image processing apparatus and image processing method | |
JP2006268216A (en) | Image processing with different processing contents for face area and normal area | |
US20050012849A1 (en) | Image processing using image generation record information | |
JP2007251524A (en) | Image processing apparatus, image processing method, and program |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CP01 | Change in the name or title of a patent holder |
Address after: 518000 a201-a301, building a, Sino German European Industrial Demonstration Park, Hangcheng Avenue, guxing community, Xixiang street, Bao'an District, Shenzhen, Guangdong Patentee after: Shenzhen Hansen Software Co.,Ltd. Address before: 518000 a201-a301, building a, Sino German European Industrial Demonstration Park, Hangcheng Avenue, guxing community, Xixiang street, Bao'an District, Shenzhen, Guangdong Patentee before: SHENZHEN HOSONSOFT Co.,Ltd. |
|
CP01 | Change in the name or title of a patent holder |