Disclosure of Invention
The embodiment of the invention provides a method, a device, equipment and a medium for adjusting the ink quantity of a printer, which are used for solving the problems of ink waste and printing cost increase caused by all 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 adjusting an ink amount of a printer, where the method includes:
acquiring a color value of a printing medium, and recording the color value as a first color value;
obtaining color values of all pixel points in the image to be printed, and recording the color values as second color values;
acquiring a color difference value corresponding to each pixel point according to the first color value and the second color value;
comparing the color difference value with a set color threshold value, wherein the color threshold value is the threshold value of the color difference value;
and when the color difference value is smaller than the color threshold value, adjusting the data of all color channels of the pixel points corresponding to the color difference value in the printer into ink non-discharge data.
Preferably, the obtaining a color difference value corresponding to each pixel point according to the first color value and the second color value includes:
acquiring a color characteristic file 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 color profile;
and obtaining the color difference value corresponding to each pixel point according to the first lab value and the second lab value.
Preferably, the acquiring the color profile of the printer includes:
acquiring a printing color value of each color block in a standard color block diagram;
printing the standard color block map according to the printing color values;
scanning the standard color patch image to obtain an actual color value of each color patch;
and acquiring a color characteristic file of the printer according to the printing color value and the actual color value of each color block.
Preferably, the color profile includes: an ICC color conversion curve, a mapping table of CMYK color values of the printer to lab values of the target color gamut.
Preferably, the color difference value is obtained by the following formula:
wherein Δ E represents a color difference value of a pixel point, and the first lab value of the printing medium is (L)1、a1、b1) The second lab value of the pixel point is (L)2、a2、b2)。
Preferably, the color channels in the printer include: cyan, magenta, yellow, black, and white ink channels.
Preferably, the method further comprises:
and when the color difference value is larger than or equal to the color threshold value, setting the white ink channel data of the pixel point corresponding to the color difference value in the printer as 100%, wherein the data of the cyan channel, the magenta channel, the yellow channel and the black channel are original input data.
In a second aspect, an embodiment of the present invention provides an ink amount adjustment device for a printer, the device 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 second color value acquisition module is used for acquiring color values of all pixel points in the image to be printed and recording the color values as second color values;
the color difference value acquisition module is used for acquiring the color difference value corresponding to each pixel point according to the first color value and the second color value;
the comparison module is used for comparing the color difference value with a set color threshold value, wherein the color threshold value is the threshold value of the color difference value;
and the adjusting module is used for adjusting the data of all color channels of the pixel points corresponding to the color difference value in the printer into ink non-discharge data when the color difference value is smaller than the color threshold value.
In a third aspect, an embodiment of the present invention provides an ink amount adjustment apparatus for a printer, 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 adjusting the ink volume of the printer provided by the embodiment of the invention, the color value of the printing medium is obtained and compared with the color values of all the pixels in the image to be printed, so that the pixels which are close to the color value of the printing medium, namely the pixels with the color difference value smaller than the set color threshold value, are obtained, and the data of all the color channels of the pixels in the printer are adjusted to the non-ink-discharge data, so that part of the ink volume can be saved, and the printing cost is reduced.
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, an embodiment of the present invention provides a method for adjusting an ink amount of a printer, where a color value of a printing medium is obtained and compared with color values of all pixels in an image to be printed, to obtain pixels that are close to the color value of the printing medium, that is, pixels with a color difference value smaller than a set color threshold, and data of all color channels of the pixels in the printer is adjusted to non-ink-output data, so that a part of the ink amount can be saved, and printing cost is reduced. 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 user does not know the color value of the printing medium used by himself,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, obtaining color values of all pixel points in the image to be printed, and recording the color values as second color values;
specifically, in this embodiment, the image to be printed includes a background map and a foreground map, and the second color value of each pixel point is obtained by traversing all pixel points in the foreground map and the background map of the image to be printed. The obtaining of the color values of all the pixel points in the image to be printed is performed by using a traversal algorithm function in an image processing library (e.g., opencv), which is the prior art and is not described herein again.
S3, acquiring a color difference value corresponding to each pixel point according to the first color value and the second color value;
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, and then the first color value and the second color value are differenced to obtain a color difference value of each pixel.
Preferably, referring to fig. 2, when the color value in the lab color mode is used for calculation, the specific method for obtaining the color difference value of each pixel point includes the following steps:
s311, acquiring a color characteristic file 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 color profile;
s313, obtaining the color difference value corresponding to each pixel point according to the first lab value and the second lab value.
Specifically, a color management ICC curve of a printer executing a print job is acquired, 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 between the second lab value corresponding to each pixel point and the first lab value of the print medium is calculated to obtain a color difference value corresponding to each pixel point, and the color difference value calculated and acquired by using the lab values is more accurate than the color difference value calculated and acquired in other color modes. If the first color value and/or the second color value are/is a value in a CMYK color mode, the first color value and/or the second color value may be directly converted into a lab value through an ICC curve.
Preferably, the color profile includes: an ICC color conversion curve, a mapping table of CMYK color values of the printer to lab values of the target color gamut. Simultaneously still include: mapping tables between different device color fields, such as CMYK color values of a printer to CMYK color values of a target color field, lab values of the target color field to CMYK color values of the printer, CMYK values of the target color field to lab values of the target color field, and the like.
Preferably, the color difference value is obtained by the following formula:
wherein Δ E represents a color difference value of a pixel point, and the first lab value of the printing medium is (L)1、a1、b1) The second lab value of the pixel point is (L)2、a2、b2)。
Referring to fig. 3, in this embodiment, the color profile of the printer is obtained by the following method:
s3111, obtaining a printing color value of each color block in a standard color block diagram;
s3112, printing the standard color patch map according to the printing color values;
s3113, scanning the standard color patch map to obtain an actual color value of each color patch;
s3114, acquiring a color profile of the printer according to the printing color values and the actual color values of each color block.
Specifically, the color profile is obtained by integrating the characteristics of the printing medium, the printing ink and the printer, specifically, a standard color block map is printed on the printing medium through the printer, then color blocks are scanned through a spectrophotometer (eyeone) to obtain the color value of each color block in the printed standard color block map, the color value of each color block obtained through scanning is compared with the color value of the standard color block map input into the printer, and the generated deviation value is the color profile.
S4, comparing the color difference value with a set color threshold value;
specifically, the obtained color difference 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, so as to determine whether each pixel point produces ink during printing.
And S5, when the color difference value is smaller than the color threshold value, adjusting the data of all color channels of the pixel points corresponding to the color difference value in the printer into ink non-discharge data.
In particular, the method comprises the following steps of,
and when the color difference value is smaller than the color threshold value, the color of the pixel point is close to the color of the printing medium, and the pixel point can not discharge ink, namely the data of all color channels of the pixel point are not discharged ink. Preferably, in this embodiment, the color channels of the printer include: cyan, magenta, yellow, black and white ink channels, in this embodiment, the data of all the color channels being no ink indicating that the ink values of the cyan, magenta, yellow, black and white ink channels are all 0; in other embodiments, the color channels of the printer further include spot color channels, such as a blue channel, an orange channel, and the like. For example, when printing a medium in the textile industry, a layer of white ink needs to be printed on the printing medium before printing an image, and the ink amount value of the white ink is 100%, when the color difference value of the pixel is calculated to be smaller than the color threshold, the data of the pixel in the printer in the cyan channel, the magenta channel, the yellow channel, the black channel and the white ink channel are all adjusted to be ink non-discharge data, and when the color difference value of the pixel is calculated to be greater than or equal to the color threshold, the data of the pixel in the printer in the cyan channel, the magenta channel, the yellow channel, the black channel and the white ink channel keep the original data thereof unchanged, in this embodiment, the original data of the white ink channel is 100%. Therefore, pixel points with the same or similar color as the printing medium can not be printed, so that not only is color ink saved, but also white ink is saved, and the printing cost is reduced.
Referring to fig. 4, an embodiment of the present invention provides an ink amount adjusting device for a printer, 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;
the second color value obtaining module 20 is configured to obtain color values of all pixel points in the image to be printed, and record the color values as second color values;
a color difference value obtaining module 30, configured to obtain a color difference value corresponding to each pixel point according to the first color value and the second color value;
a comparison module 40, configured to compare the color difference value with a set color threshold;
and an adjusting module 50, configured to adjust, when the color difference value is smaller than the color threshold, data of all color channels of the pixel point corresponding to the color difference value in the printer to be ink non-discharge data.
Preferably, the obtaining a color difference value corresponding to each pixel point according to the first color value and the second color value includes:
acquiring a color characteristic file 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 color profile;
and obtaining the color difference value corresponding to each pixel point according to the first lab value and the second lab value.
Preferably, the acquiring the color profile of the printer includes:
acquiring a printing color value of each color block in a standard color block diagram;
printing the standard color block map according to the printing color values;
scanning the standard color patch image to obtain an actual color value of each color patch;
and acquiring a color characteristic file of the printer according to the printing color value and the actual color value of each color block.
Preferably, the color profile includes: an ICC color conversion curve, a mapping table of CMYK color values of the printer to lab values of the target color gamut.
Preferably, the color difference value is obtained by the following formula:
wherein Δ E represents a color difference value of a pixel point, and the first lab value of the printing medium is (L)1、a1、b1) The second lab value of the pixel point is (L)2、a2、b2)。
Preferably, the color channels in the printer include: cyan, magenta, yellow, black, and white ink channels.
Preferably, the apparatus further comprises:
and the data input module is used for setting the white ink channel data of the pixel points corresponding to the color difference value in the printer to be 100% when the color difference value is larger than or equal to the color threshold value, and the data of the cyan channel, the magenta channel, the yellow channel and the black channel are original input data.
In addition, the printer ink amount adjusting method of the embodiment of the invention described in conjunction with fig. 1 may be implemented by a printer ink amount adjusting apparatus. Fig. 5 is a schematic diagram showing a hardware configuration of the ink amount adjusting apparatus for a printer according to the embodiment of the present invention.
The printer ink amount adjustment 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.
Memory 402 may include mass storage for data or instructions. By way of example, and not limitation, memory 402 may include a Hard Disk Drive (HDD), floppy Disk Drive, flash memory, optical Disk, magneto-optical Disk, tape, or Universal Serial Bus (USB) Drive or a combination of two or more of these. Memory 402 may include removable or non-removable (or fixed) media, where appropriate. The memory 402 may be internal or external to the data processing apparatus, where appropriate. In a particular embodiment, the memory 402 is a non-volatile solid-state memory. In a particular embodiment, the memory 402 includes Read Only Memory (ROM). Where appropriate, the ROM may be mask-programmed ROM, Programmable ROM (PROM), Erasable PROM (EPROM), Electrically Erasable PROM (EEPROM), electrically rewritable ROM (EAROM), or flash memory or a combination of two or more of these.
The processor 401 reads and executes computer program instructions stored in the memory 402 to implement any of the printer ink amount adjustment methods in the above-described embodiments.
In one example, the printer ink amount adjustment device may also include a communication interface 403 and a bus 410. As shown in fig. 5, 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 ink volume adjustment 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 adjusting the ink amount of the printer in the above embodiments, the embodiments of the present invention may 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 printer ink amount adjustment methods in the above embodiments.
In summary, according to the method, the device, the equipment and the medium for adjusting the ink volume of the printer provided by the embodiment of the invention, the color value of the printing medium is obtained and compared with the color values of all the pixels in the image to be printed, so that the pixels which are close to the color value of the printing medium, namely the pixels with the color difference value smaller than the set color threshold value, are obtained, and the data of all the color channels of the pixels in the printer are adjusted to the non-ink-discharge data, so that part of the ink volume can be saved, and the printing cost is reduced.
It is to be understood that the invention is not limited to the specific arrangements and instrumentality described above and shown in the drawings. A detailed description of known methods is omitted herein for the sake of brevity. In the above embodiments, several specific steps are described and shown as examples. However, the method processes of the present invention are not limited to the specific steps described and illustrated, and those skilled in the art can make various changes, modifications and additions or change the order between the steps after comprehending the spirit of the present invention.
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.