Label processing method and apparatus, electronic device, and storage medium
Patent Information
- Application Number
- CN202310401822.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-14
- Publication Date
- 2026-09-22
- Estimated Expiration
- 2043-04-14
AI Technical Summary
[0004]现有的处理方案,存在处理方式繁琐,以使得打印设备打印效率低的问题
[0019]本发明实施例的标签处理方案,首先获取包含多个待打印区域的待打印图像,多个待打印区域包括至少两种颜色标识;然后根据多个待打印区域的排布情况确定每个待打印区域对应的目标颜色标识,获得待打印图像的待打印标签;最后将待打印标签发送至打印设备,以使得打印设备根据目标颜色标识对待打印标签进行打印。本实施例提供的方案,通过预先确定每个待打印区域对应的颜色标识的方式,只需对带有颜色标识的待打印标签进行一次二值图转换,以使得打印设备根据标记有颜色标识的二值图进行标签打印,解决了现有方案中需根据待打印标签颜色种类进行多次二值图处理的问题,取到了简化处理流程,提高打印效率的有益效果。
Smart Images

Figure CN116414325B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to computer technology, and more particularly to a tag processing method, apparatus, electronic device, and storage medium. Background Technology
[0002] In the manufacturing sector, using multi-color labels to identify items has become a standard practice. Taking two-color labels as an example, their printing principle involves a thermal printer heating the two-color paper to different temperatures to produce different colors.
[0003] Before printing labels, the image to be printed is usually processed into a binary image and sent to the printing device. If two-color label printing is required, the binary image processing operation needs to be performed twice according to the two color identifiers, and the two binary images are sent to the printing device. The printing device combines the two received binary images to determine the printing color required for each printing area, and then prints the two-color label.
[0004] Existing solutions are cumbersome, resulting in low printing efficiency for printing equipment. Summary of the Invention
[0005] This invention provides a tag processing method, apparatus, electronic device, and storage medium, which can improve existing tag processing solutions.
[0006] In a first aspect, embodiments of the present invention provide a label processing method, including:
[0007] Obtain a printable image containing multiple printable areas, wherein the multiple printable areas include at least two color identifiers;
[0008] Based on the arrangement of the multiple areas to be printed, determine the target color identifier corresponding to each area to be printed, and obtain the printable label of the image to be printed;
[0009] The label to be printed is sent to the printing device so that the printing device prints the label according to the target color identifier.
[0010] Secondly, embodiments of the present invention provide a label processing apparatus, the apparatus comprising:
[0011] An image acquisition module is used to acquire a printable image containing multiple printable areas, wherein the multiple printable areas include at least two color identifiers;
[0012] The identifier determination module is used to determine the target color identifier corresponding to each of the multiple areas to be printed based on the arrangement of the multiple areas to be printed, and to obtain the printable label of the image to be printed;
[0013] The label sending module is used to send the label to be printed to the printing device, so that the printing device can print the label according to the target color identifier.
[0014] Thirdly, embodiments of the present invention also provide an electronic device, the electronic device comprising:
[0015] At least one processor; and
[0016] A memory communicatively connected to the at least one processor; wherein,
[0017] The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the tag processing method according to any embodiment of the present invention.
[0018] Fourthly, embodiments of the present invention also provide a computer-readable storage medium storing computer instructions that are used to cause a processor to execute the tag processing method described in any embodiment of the present invention.
[0019] The label processing scheme of this invention first acquires a printable image containing multiple printable areas, each including at least two color identifiers. Then, based on the arrangement of these areas, a target color identifier is determined for each printable area, resulting in a label for the printable image. Finally, the label is sent to a printing device, which prints the label according to the target color identifier. This embodiment, by pre-determining the color identifier for each printable area, only requires a single binary image conversion of the label with color identifiers. This allows the printing device to print the label based on the binary image marked with color identifiers, solving the problem of multiple binary image processing steps required in existing solutions based on the color type of the label. This simplifies the processing flow and improves printing efficiency.
[0020] It should be understood that the description in this section is not intended to identify key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the present invention. Other features of the embodiments of the present invention will become readily apparent from the following description. Attached Figure Description
[0021] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 This is a schematic flowchart of a label processing method provided in an embodiment of the present invention;
[0023] Figure 2 This is a schematic diagram of the structure of an image to be printed provided in an embodiment of the present invention;
[0024] Figure 3 This is another flowchart illustrating the label processing method provided in this embodiment of the invention;
[0025] Figure 4 This is a schematic diagram of another image to be printed provided in an embodiment of the present invention;
[0026] Figure 5 This is another flowchart illustrating the label processing method provided in this embodiment of the invention;
[0027] Figure 6 This is a schematic diagram of a tag processing device provided in an embodiment of the present invention;
[0028] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0029] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0030] The present invention will now be described in further detail 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 not intended to limit it. Furthermore, it should be noted that, for ease of description, the accompanying drawings show only the parts relevant to the present invention, and not all of the structures.
[0031] Figure 1This is a schematic flowchart of a label processing method provided in an embodiment of the present invention. This embodiment is applicable to situations where labels to be printed are processed before printing. The method can be executed by a label processing device, which can be implemented in hardware and / or software and can be configured in computer equipment such as a server. (Reference) Figure 1 The method may specifically include the following steps:
[0032] S110. Obtain the image to be printed, which contains multiple areas to be printed.
[0033] The image to be printed can be understood as the label image that the staff sets on the application integrated into the terminal device to be printed according to actual work needs. The terminal communicates with the printing device so that the printing device can perform the corresponding printing operation based on the label to be printed in subsequent steps. The terminal device can be a computer device or a smart mobile device (such as a smartphone or smart tablet). The specific type of terminal device is not limited here.
[0034] The area to be printed can be understood as the area corresponding to each attribute to be printed, edited in the text editing area of the application; that is, one area to be printed can correspond to one attribute name. The current area to be printed can include product information areas, company information areas, barcode areas, and QR code areas, etc. The application may contain an attribute library that can meet the functional requirements of various types of labels to be printed, allowing staff to select the target attribute from the attribute library and then drag and drop it to the text editing area to form a printing area. Since labels generally contain multiple attributes, the image to be printed provided in this embodiment includes multiple printing areas.
[0035] Please refer to Figure 2 ,like Figure 2 As shown, Figure 2 This is a schematic diagram of a printable image provided by an embodiment of the present invention. In the diagram, company name, product number, brand, year, etc., can be understood as attributes selected by staff from an attribute library according to actual needs, forming corresponding printable areas. When all required printable areas are selected, a printable image containing multiple printable areas is obtained. For the content corresponding to each printable area, a stamp can be manually affixed to the label in the corresponding area after the label corresponding to the printable image is printed. Optionally, when all required printable areas are selected and the printable content corresponding to each printable area is filled in according to actual needs, a printable image containing multiple printable areas is obtained. Whether the printable image specifically includes the printable content corresponding to each printable area is not limited in this solution and depends on the actual application scenario.
[0036] The content and arrangement of the image to be printed are not limited to the illustration, and there may be cases where multiple areas to be printed completely overlap, partially overlap, or do not overlap.
[0037] The multiple printing areas provided in this embodiment of the invention include at least two color identifiers. The purpose of setting at least two color identifiers is to facilitate users' intuitive analysis of the corresponding content based on the different colors of the printed labels, serving as a prompt and distinction. Currently, the at least two color identifiers can be white, red, black, blue, or gray, etc., and the specific color type corresponding to the identifiers is not limited here, but depends on the actual function of the printing device. Figure 2 For example, the attribute names in the image to be printed and the colors corresponding to the attribute content of each attribute name can be set as the first color, and the colors corresponding to the QR codes and barcodes can be set as the second color; alternatively, the QR codes and barcodes can be set to different colors, etc. The specific color type corresponding to each area to be printed is not restricted here.
[0038] The color codes mentioned above can be represented by numbers, letters, and / or symbols. There are no restrictions on the specific way the color codes are represented, as long as the printing device can determine the corresponding color based on each color code.
[0039] S120. Determine the target color identifier corresponding to each area to be printed based on the arrangement of multiple areas to be printed, and obtain the print label of the image to be printed.
[0040] The target color identifier for each area to be printed can be determined in several ways. First, it can be determined during the user's editing of the area. For example, setting the text color of the current area to be printed to black will determine the target color identifier as black. Second, it can be determined after multiple areas to be printed have been edited. For example, after all areas to be printed have been defined, the text can be set to black and the graphics to red. The specific method for determining the color identifier for each area to be printed is not limited here.
[0041] For example, when a user edits the font, they can choose black as the font color; when setting the barcode, they can choose black as the barcode color; and when setting the QR code, they can choose red as the QR code color. For background areas or blank spaces on the image to be printed that do not have a set color, the user can manually set them to white, or they can leave them as white by default. This allows the target color identifier for each area to be printed to be obtained based on the arrangement of multiple areas to be printed. Once the target color identifier for each area to be printed is marked, the label to be printed on the image is obtained.
[0042] S130. Send the label to be printed to the printing device so that the printing device can print the label according to the target color code.
[0043] For labels to be printed that are marked with color identifiers, the labels to be printed can be converted into binary images before being sent to the printing device. The current binary image contains different color identifiers in different areas to be printed, so that the printing device can print the labels to be printed according to the target color identifiers.
[0044] In one implementation, after receiving a label to be printed containing a target color identifier, the printing device can print the label as follows: determine the heating temperature corresponding to each area to be printed based on the target color identifier; heat and print each area to be printed according to the heating temperature to obtain the printed label.
[0045] The printing device determines the target printing color for the current area to be printed based on the identified target color identifier, and heats and prints according to the heating temperature corresponding to the target printing color, so that different colors are displayed in different areas on the obtained printed label.
[0046] The label processing method provided in this embodiment of the invention first acquires a printable image containing multiple printable areas, each printable area including at least two color identifiers; then, based on the arrangement of the multiple printable areas, it determines the target color identifier corresponding to each printable area, obtaining a printable label from the printable image; finally, it sends the printable label to a printing device, enabling the printing device to print the label according to the target color identifier. This embodiment, by pre-determining the color identifier corresponding to each printable area, only requires one binary image conversion of the printable label with color identifiers, allowing the printing device to print the label based on the binary image marked with color identifiers. This solves the problem in existing solutions that require multiple binary image processing steps based on the color type of the printable label, achieving the beneficial effects of simplified processing and improved printing efficiency.
[0047] Figure 3 This is another schematic flowchart of the label processing method provided in this embodiment of the invention. The relationship between this embodiment and the above embodiments further refines the corresponding features of the above embodiments. Figure 3 As shown, the method may include the following steps:
[0048] S210. Obtain the image to be printed, which contains multiple areas to be printed.
[0049] Multiple areas to be printed include at least two color codes.
[0050] S220. Perform grayscale processing on the image to be printed to obtain the grayscale value of each area to be printed.
[0051] The image to be printed generated by the terminal device is a color image that has already been set. In order to facilitate the determination of the target color identifier corresponding to each printing area in the image to be printed, the color image can be processed into grayscale. For the image after grayscale processing, the same color is represented by the grayscale value.
[0052] One method for grayscale processing of the image to be printed is to determine the grayscale value of each pixel using a floating-point method, and then obtain the grayscale value of each area to be printed based on each pixel.
[0053] The method of determining the grayscale value of each pixel using the floating-point method can be expressed by the following formula:
[0054] Gray=R*0.29891+G*0.58661+B*0.11448 (1)
[0055] In the above formula, Gray represents the grayscale value of the current pixel, and R, G and B represent the R, G and B values corresponding to each pixel, respectively. The range of R, G and B values is [0, 255], and the specific values of R, G and B are based on the actual color of the current pixel.
[0056] S230. Obtain overlapping and non-overlapping areas according to the arrangement order of each area to be printed.
[0057] During the editing process of each area to be printed, there may be overlaps between them. For overlapping areas, the color inconsistency between the two areas may prevent intuitive color identification based on grayscale values. Therefore, it is necessary to determine the overlapping and non-overlapping areas based on the arrangement order of each area to be printed.
[0058] For an example, please refer to Figure 4 , Figure 4 This is a schematic diagram of another image to be printed provided in an embodiment of the present invention. Example Figure 4 For an image to be printed, assuming region A is arranged before region B, if region B is detected to overlap region A, then the image to be printed is determined to contain overlapping areas. The overlapping part is the shaded area in the figure. The remaining areas in the figure, excluding the shaded area, can be considered non-overlapping areas. Optionally, if region B is detected to overlap region A, both regions A and B can be determined to be overlapping areas, and the color indicators of the overlapping and non-overlapping parts in regions B and A can be further determined. Region C is a non-overlapping area, and so on. The specific method of dividing overlapping and non-overlapping areas is not limited here.
[0059] S231. Determine the target color identifiers for overlapping and non-overlapping areas based on the grayscale values of each area to be printed.
[0060] Please continue to refer to Figure 4 When setting regions A and B, with region A as the first color and region B as the second color, and region C being the area in the image to be printed that is not covered by regions A and B, the default color (such as white) can be used. In this case, the target color identifiers corresponding to the overlapping and non-overlapping areas need to be determined based on the grayscale value of each region to be printed.
[0061] In one implementation, according to an embodiment of the present invention, determining the target color identifier corresponding to the non-overlapping area based on the grayscale value of each area to be printed can be achieved by: obtaining a standard grayscale value set, which includes standard grayscale values corresponding to at least two color identifiers; and determining the target color identifier corresponding to the grayscale value of the non-overlapping area from the standard grayscale value set.
[0062] For uncovered areas, the color corresponding to each area can be determined by converting it to a grayscale image and comparing the obtained grayscale value with the standard grayscale values corresponding to at least two color identifiers contained in the standard grayscale value set. When the values are consistent, the target color identifier for each non-overlapping area can be determined based on the color identifier corresponding to the standard grayscale value.
[0063] For another implementation method, please refer to Figure 5 , Figure 5 This is another flowchart illustrating the label processing method provided in this embodiment of the invention. In this embodiment, determining the target color identifier corresponding to the overlapping area based on the grayscale value of each area to be printed can be achieved by the following steps S310 to S350:
[0064] S310. Obtain the target sub-region from the overlapping region.
[0065] For overlapping regions, the overlapping region can be divided into multiple sub-regions. Each sub-region includes a preset number of adjacent pixels. The current preset number can be 1, 2, 3, or 5, etc. The specific value of the preset number is not limited here.
[0066] For example, taking a preset quantity of 1 as an example, the target sub-region is determined by taking the target pixel as the center and the area formed by the pixels adjacent to the target pixel as the target sub-region. Then the current target sub-region can contain 9 pixels.
[0067] The target sub-region mentioned above is any one of the multiple sub-regions contained in the overlapping region.
[0068] S320. Calculate the average pixel grayscale value of the target sub-region based on the grayscale value of each pixel in the target sub-region.
[0069] In the current step, the average pixel grayscale value of the target sub-region is calculated by obtaining the grayscale value of each pixel, accumulating the grayscale values of each pixel, and then calculating the average value.
[0070] S330. Determine the target color identifier corresponding to the target sub-region based on the average pixel grayscale value.
[0071] The method for determining the target color identifier corresponding to the target sub-region by the pixel grayscale mean can be as follows: for multiple areas to be printed that include at least two color identifiers, the grayscale value corresponding to each color can be obtained. When the pixel average of the target sub-region is closest to a certain color, the current color is determined as the target color identifier corresponding to the target sub-region.
[0072] In a preferred embodiment, the color identifier includes a first color identifier and a second color identifier; the standard grayscale value corresponding to the first color identifier is a preset value. In this step, taking red as the first color and black as the second color as an example, the grayscale value corresponding to red is 78, and the grayscale value corresponding to black is 0. Specifically, the above step S330 can be implemented in the following way:
[0073] When the average pixel grayscale value is greater than a preset value, all pixels in the target sub-region are designated as the first color identifier; when the average pixel grayscale value is not greater than the preset value, all pixels in the target sub-region are designated as the second color identifier.
[0074] Please continue to refer to Figure 4 Taking region A as red, region B as black, and the overlapping region as all regions composed of region A and region B as an example, if the average pixel grayscale value of the target sub-region is greater than 78, the target sub-region can be marked as red; otherwise, it is marked as black.
[0075] It should be noted that in all regions consisting of region A and region B, where the overlapping area is not included, all pixels in region A that do not include the overlapping part are red, and the corresponding gray value is 78. In region B, all pixels that do not include the overlapping part are black, and the corresponding gray value is 0. To simplify the calculation, steps S310 to S350 can be performed only on the overlapping part (i.e. the shaded part in the figure).
[0076] S340. Determine whether all pixels in the overlapping area have been identified to the corresponding target color identifier.
[0077] If not, then obtain the next sub-region from the overlapping region, and use the next sub-region as the target sub-region, repeating steps S310 to S330.
[0078] If so, proceed to step S350.
[0079] S350, Obtain the target color identifier corresponding to the overlapping area.
[0080] Once all pixels in the overlapping region are identified to their corresponding target color identifiers, the target color identifier for the overlapping region can be obtained based on the marked target color identifiers. The target color identifier for the current overlapping region is either red or black, as shown in the example above.
[0081] S240: Obtain the label to be printed from the image to be printed.
[0082] Once the color marking of all areas in the image to be printed is complete, the label to be printed is obtained.
[0083] S250: Send the label to be printed to the printing device so that the printing device can print the label according to the target color code.
[0084] Another implementation involves batch printing, where the current print job includes multiple images to be printed, each image including a variable area and a fixed area.
[0085] Batch printing can be understood as printing multiple sheets consecutively in a single printing process. During batch printing, there may be situations where all content in all areas to be printed is exactly the same, or there may be situations where some content needs to be changed depending on the number of sheets printed and the printing time. For example, the current number of sheets to be printed, the current printing time, etc.
[0086] For batch printing, in order to quickly obtain the label corresponding to each image to be printed, the area where all the printed content is the same can be defined as a fixed area, and the area where the printed content varies can be defined as a variable area.
[0087] For the current image to be printed, the method further includes: obtaining the target color identifier corresponding to the previous image to be printed in the fixed area; performing the operation step of determining the target color identifier corresponding to each printing area in the variable area based on the arrangement of multiple printing areas; and obtaining the label to be printed for the current image to be printed based on the target color identifier corresponding to the fixed area and the target color identifier corresponding to the variable area.
[0088] The target color identifiers corresponding to the fixed areas identified in the previous image to be printed are saved. Only the target color identifiers corresponding to each printable area are determined for the variable areas in each image to be printed, thus obtaining the label to be printed for the current image. The advantage of this approach is that it speeds up label processing and reduces computational load. During continuous printing, it prevents printer lag caused by delayed label processing.
[0089] The label processing solution provided in this invention only requires one binary image conversion process for images to be printed that contain at least two color identifiers, shortening the image processing flow and thus improving the transmission speed. It is suitable for processing labels with various label materials and color identifiers, and has a wider range of applications.
[0090] Figure 6 This is a schematic diagram of a label processing device provided in an embodiment of the present invention. This device is suitable for executing the label processing method provided in an embodiment of the present invention. Figure 6 As shown, the device may specifically include: an image acquisition module 410, an identification determination module 420, and a tag sending module 430, wherein:
[0091] Image acquisition module 410 is used to acquire a printable image containing multiple printable areas, wherein the multiple printable areas include at least two color identifiers;
[0092] The identifier determination module 420 is used to determine the target color identifier corresponding to each of the multiple areas to be printed based on the arrangement of the multiple areas to be printed, and to obtain the printable label of the image to be printed;
[0093] The label sending module 430 is used to send the label to be printed to the printing device, so that the printing device prints the label according to the target color identifier.
[0094] The label processing device of this invention first acquires a printable image containing multiple printable areas, each printable area including at least two color identifiers; then, based on the arrangement of the multiple printable areas, it determines the target color identifier corresponding to each printable area, obtaining a printable label from the printable image; finally, it sends the printable label to a printing device, so that the printing device prints the label according to the target color identifier. The solution provided in this embodiment, by pre-determining the color identifier corresponding to each printable area, only requires one binary image conversion of the printable label with color identifiers, enabling the printing device to print the label based on the binary image marked with color identifiers. This solves the problem in existing solutions that require multiple binary image processing steps based on the color type of the printable label, achieving the beneficial effects of simplified processing and improved printing efficiency.
[0095] In one embodiment, the arrangement of the plurality of areas to be printed includes at least one overlapping area and a non-overlapping area; the device further includes: a grayscale processing module; wherein:
[0096] The grayscale processing module is used to perform grayscale processing on the image to be printed to obtain the grayscale value of each area to be printed.
[0097] In one embodiment, the identifier determination module 420 includes: a region acquisition unit and an identifier determination unit, wherein:
[0098] A region acquisition unit is used to obtain the overlapping region and the non-overlapping region according to the arrangement order of each of the regions to be printed;
[0099] The identifier determination unit is used to determine the target color identifiers corresponding to the overlapping areas and the non-overlapping areas based on the grayscale values of each of the areas to be printed.
[0100] In one embodiment, the identifier determination unit is specifically used to obtain a standard grayscale value set, the standard grayscale value set including at least two standard grayscale values corresponding to the color identifier; and to determine the target color identifier corresponding to the grayscale value of the non-overlapping region from the standard grayscale value set.
[0101] In one embodiment, the identifier determination unit is further configured to: obtain a target sub-region from the overlapping region, the target sub-region including a preset number of adjacent pixels; calculate the average pixel grayscale value of the target sub-region based on the grayscale value of each pixel in the target sub-region; determine the target color identifier corresponding to the target sub-region based on the average pixel grayscale value; determine whether all pixels in the overlapping region have been identified with the corresponding target color identifier; if not, obtain the next sub-region from the overlapping region and use the next sub-region as the target sub-region, and repeat the operation step of calculating the average pixel grayscale value of the target sub-region based on the grayscale value of each pixel in the target sub-region; if yes, obtain the target color identifier corresponding to the overlapping region.
[0102] In one embodiment, the color identifier includes a first color identifier and a second color identifier; the standard grayscale value corresponding to the first color identifier is a preset value;
[0103] The identifier determination unit is further configured to, when the average pixel grayscale value is greater than the preset value, determine all pixels of the target sub-region as the first color identifier; and when the average pixel grayscale value is not greater than the preset value, determine all pixels of the target sub-region as the second color identifier.
[0104] In one embodiment, when the current print job is a batch print job, the current print job includes multiple images to be printed, and each image to be printed includes a variable area and a fixed area;
[0105] The identifier determination module is further configured to, for the current image to be printed, obtain the target color identifier corresponding to the previous image to be printed in the fixed area; perform the operation step of determining the target color identifier corresponding to each of the multiple areas to be printed in the variable area based on the arrangement of the multiple areas to be printed; and obtain the label to be printed for the current image to be printed based on the target color identifier corresponding to the fixed area and the target color identifier corresponding to the variable area.
[0106] In one embodiment, the printing device prints the label to be printed by: determining the heating temperature corresponding to each area to be printed according to the target color identifier; heating and printing each area to be printed according to the heating temperature to obtain a printed label.
[0107] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional modules is merely an example. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. The specific working process of the functional modules described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0108] This invention also provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the tag processing method according to any embodiment of this invention.
[0109] This invention also provides a computer-readable medium storing computer instructions that, when executed by a processor, implement the tag processing method described in any embodiment of this invention.
[0110] The following is for reference. Figure 7 It shows a schematic diagram of the structure of a computer system 500 suitable for implementing an electronic device according to embodiments of the present invention. Figure 7 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments of the present invention.
[0111] like Figure 7As shown, the computer system 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 502 or programs loaded from storage section 508 into random access memory (RAM) 503. The RAM 503 also stores various programs and data required for the operation of the system 500. The CPU 501, ROM 502, and RAM 503 are interconnected via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0112] The following components are connected to I / O interface 505: an input section 506 including a keyboard, mouse, etc.; an output section 507 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to I / O interface 505 as needed. A removable medium 511, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 510 as needed so that computer programs read from it can be installed into storage section 508 as needed.
[0113] In particular, according to the embodiments disclosed in this invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 509, and / or installed from removable medium 511. When the computer program is executed by central processing unit (CPU) 501, it performs the functions defined above in the system of this invention.
[0114] It should be noted that the computer-readable medium shown in this invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0115] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0116] The modules and / or units described in the embodiments of the present invention can be implemented in software or hardware. The described modules and / or units can also be housed in a processor; for example, a processor can be described as including an image acquisition module, a tag sending module, and a tag sending module. The names of these modules do not necessarily limit the functionality of the module itself.
[0117] In another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiments; or it may exist independently and not assembled into the device. The computer-readable medium carries one or more programs that, when executed by the device, cause the device to: acquire a printable image comprising a plurality of printable areas, the plurality of printable areas including at least two color identifiers; determine a target color identifier corresponding to each printable area based on the arrangement of the plurality of printable areas, and obtain a printable label of the printable image; and send the printable label to a printing device so that the printing device prints the printable label according to the target color identifier.
[0118] According to the technical solution of the present invention, by pre-determining the color identifier corresponding to each area to be printed, only one binary image conversion is needed for the label to be printed with the color identifier, so that the printing device can print the label according to the binary image marked with the color identifier. This solves the problem that the existing solution requires multiple binary image processing according to the color type of the label to be printed, and achieves the beneficial effects of simplifying the processing flow and improving printing efficiency.
[0119] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A label processing method, characterized in that, include: Obtain a printable image containing multiple printable areas, wherein the multiple printable areas include at least two color identifiers; Based on the arrangement of the multiple areas to be printed, determine the target color identifier corresponding to each area to be printed, and obtain the printable label of the image to be printed; The label to be printed is sent to the printing device so that the printing device prints the label according to the target color identifier; The arrangement of the multiple areas to be printed includes at least one type of overlapping area and non-overlapping area; the target color identifiers corresponding to the overlapping and non-overlapping areas of the multiple areas to be printed are determined by the grayscale value of each area to be printed. The overlapping region includes a target sub-region, and the target color identifier corresponding to the target sub-region is determined by the average pixel grayscale value of the target sub-region. The color identifier includes a first color identifier and a second color identifier; the standard grayscale value corresponding to the first color identifier is a preset value. Determining the target color identifier corresponding to the target sub-region based on the average pixel grayscale value includes: When the average grayscale value of the pixels is greater than the preset value, all pixels in the target sub-region are identified as the first color identifier. When the average grayscale value of the pixels is not greater than the preset value, all pixels in the target sub-region are identified as the second color identifier.
2. The label processing method according to claim 1, characterized in that, After acquiring the image to be printed, which contains multiple areas to be printed, the process also includes: Perform grayscale processing on the image to be printed to obtain the grayscale value of each area to be printed. Accordingly, determining the target color identifier corresponding to each of the multiple areas to be printed based on their arrangement includes: The overlapping area and the non-overlapping area are obtained according to the arrangement order of each of the areas to be printed; The target color identifiers corresponding to the overlapping and non-overlapping areas are determined based on the grayscale values of each area to be printed.
3. The label processing method according to claim 2, characterized in that, Determine the target color identifier corresponding to the non-overlapping area based on the grayscale value of each of the areas to be printed, including: Obtain a standard grayscale value set, wherein the standard grayscale value set includes at least two standard grayscale values corresponding to the color identifiers; The target color identifier corresponding to the gray value of the non-overlapping region is determined from the standard gray value set.
4. The label processing method according to claim 2, characterized in that, Determine the target color identifier corresponding to the overlapping area based on the grayscale value of each of the areas to be printed, including: A target sub-region is obtained from the overlapping region, the target sub-region including a preset number of adjacent pixels; Calculate the average pixel grayscale value of the target sub-region based on the grayscale value of each pixel in the target sub-region; The target color identifier corresponding to the target sub-region is determined based on the average pixel grayscale value; Determine whether all pixels in the overlapping area are identified to their corresponding target color identifier; If not, then obtain the next sub-region from the overlapping region, and use the next sub-region as the target sub-region, and repeat the operation step of calculating the average pixel gray value of the target sub-region based on the gray value corresponding to each pixel in the target sub-region; If so, the target color identifier corresponding to the overlapping area is obtained.
5. The label processing method according to claim 1, characterized in that, When the current print job is a batch print job, the current print job includes multiple images to be printed, and each image to be printed includes a variable area and a fixed area; For the current image to be printed, the method further includes: Obtain the target color identifier corresponding to the previous image to be printed in the fixed area; The operation step of determining the target color identifier corresponding to each of the printable areas in the variable region based on the arrangement of the multiple printable areas is performed on the variable region. The print label of the current image to be printed is obtained based on the target color identifier corresponding to the fixed area and the target color identifier corresponding to the variable area.
6. The label processing method according to claim 1, characterized in that, The printing device prints the label to be printed in the following manner: The heating temperature corresponding to each area to be printed is determined based on the target color identifier; Each area to be printed is heated and printed according to the heating temperature to obtain a printed label.
7. A label processing device, characterized in that, include: An image acquisition module is used to acquire a printable image containing multiple printable areas, wherein the multiple printable areas include at least two color identifiers; The identifier determination module is used to determine the target color identifier corresponding to each of the multiple areas to be printed based on the arrangement of the multiple areas to be printed, and to obtain the printable label of the image to be printed; A label sending module is used to send the label to be printed to the printing device, so that the printing device can print the label according to the target color identifier; The arrangement of the multiple areas to be printed includes at least one type of overlapping area and non-overlapping area; the target color identifiers corresponding to the overlapping and non-overlapping areas of the multiple areas to be printed are determined by the grayscale value of each area to be printed. The overlapping region includes a target sub-region, and the target color identifier corresponding to the target sub-region is determined by the average pixel grayscale value of the target sub-region. The color identifier includes a first color identifier and a second color identifier; the standard grayscale value corresponding to the first color identifier is a preset value. The identifier determination module is further configured to, when the average pixel grayscale value is greater than the preset value, determine all pixels in the target sub-region as the first color identifier; and when the average pixel grayscale value is not greater than the preset value, determine all pixels in the target sub-region as the second color identifier.
8. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the tag processing method according to any one of claims 1-6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the tag processing method as described in any one of claims 1-6.
Citation Information
Patent Citations
Digital printing method and device
CN106778881A
Printing processing method and device and storage medium
CN111105468A