A trademark graphic code layout method and system
By using masks and binary array fusion methods in dot matrix codes, a dot matrix code image with a special trademark form is generated, which solves the problem that dot matrix codes are difficult to become special trademarks in the prior art, and achieves higher aesthetics and space utilization.
Patent Information
- Application Number
- CN202510458518.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-14
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2045-04-14
AI Technical Summary
The prior art is difficult to turn the rectangular dot matrix code diagram into a "yang seal" and "yin seal" form of a special shape, trademark, and text outline, while maintaining its readability.
By determining the mask of the image to be generated, including black, white and gray, combined with the original dot matrix code binary array, a synthetic array of fusion of graph codes is generated, and color rendering is performed according to different binary values, the final dot matrix code image is obtained as the trademark graphic code.
It realizes that there is no need to prepare blank areas separately for coding, which significantly improves the aesthetics and space utilization of the packaging material surface, while ensuring the readability of the dot matrix code.
Smart Images

Figure CN120012811B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of anti-counterfeiting technology, and particularly to a method and system for typesetting trademark graphic codes. Background Art
[0002] At present, dot matrix codes have begun to be used as one code for one item in the market for manufacturers' anti-counterfeiting traceability inspection and consumers' anti-counterfeiting code scanning. Dot matrix codes generally have advantages such as beauty, concealment, and smaller requirements for readable footprint compared to two-dimensional codes. Among them, CN117292610A "A Method for Making Trademarks and a Hardware Part" proposes an idea of using a dot matrix code to form an image by laser to make a hardware part, but it cannot solve the problem of how to change the original rectangular full-paved code image with a specified width and height into a code image in the form of "positive printing" or "negative printing" of special shapes, trademarks, and text outlines and ensure its readability. Summary of the Invention
[0003] The purpose of the embodiments of the present invention is to provide a method and system for typesetting trademark graphic codes, which do not require separately preparing a blank area for code assignment, and significantly improve the aesthetics and space utilization rate of the packaging material surface.
[0004] To achieve the above purpose, the embodiments of the present invention provide a method for typesetting trademark graphic codes, the method including: determining the dot matrix code value, code system, and the shape and size of the image to be generated; determining the mask of the image to be generated according to the shape and size of the image to be generated, where the mask of the image to be generated includes at least black, white, and gray; generating an original dot matrix code binary array according to the dot matrix code value, code system, and the shape and size of the image to be generated; generating a synthesized array of code-image fusion according to the mask of the image to be generated and the original dot matrix code binary array, where the synthesized array of code-image fusion is a binary array; performing different color rendering on the pixels corresponding to different binary values in the synthesized array of code-image fusion to obtain the final dot matrix code image as the trademark graphic code.
[0005] Preferably, the value corresponding to the black pixel in the mask of the image to be generated is 0, the value corresponding to the white pixel is 255, and the value corresponding to the gray pixel is 1 - 254.
[0006] Preferably, the generating a synthesized array of code-image fusion according to the mask of the image to be generated and the original dot matrix code binary array includes: when the value corresponding to the pixel in the mask of the image to be generated is 0, generating the value corresponding to the pixel at the same coordinate in the synthesized array of code-image fusion as 1; when the value corresponding to the pixel in the mask of the image to be generated is 255, generating the value corresponding to the pixel at the same coordinate in the synthesized array of code-image fusion as 0; when the value corresponding to the pixel in the mask of the image to be generated is 1 - 254, generating the value corresponding to the pixel at the same coordinate in the synthesized array of code-image fusion as the value of the original dot matrix code binary array.
[0007] Preferably, according to different binary values in the synthesized array of the graphic code fusion, different color renderings are performed on the pixels corresponding to the binary values to obtain the final dot matrix code image as the trademark graphic code, including: when the value corresponding to the pixel in the synthesized array of the graphic code fusion is 0, the pixel where 0 is located is not color-rendered; when the value corresponding to the pixel in the synthesized array of the graphic code fusion is 1, the pixel where 1 is located is color-rendered to obtain the final dot matrix code image as the trademark graphic code.
[0008] An embodiment of the present invention further provides a trademark graphic code layout system, which includes: a code value size determination unit, a mask determination unit, an array generation unit, a fusion unit, and a rendering unit. Among them, the code value size determination unit is used to determine the dot matrix code value, code system, and the shape and size of the image to be generated; the mask determination unit is used to determine the mask of the image to be generated according to the shape and size of the image to be generated, and the mask of the image to be generated includes at least black, white, and gray; the array generation unit is used to generate an original dot matrix code binary array according to the dot matrix code value, code system, and the shape and size of the image to be generated; the fusion unit is used to generate a synthesized array of graphic code fusion according to the mask of the image to be generated and the original dot matrix code binary array, and the synthesized array of graphic code fusion is a binary array; the rendering unit is used to perform different color renderings on the pixels corresponding to different binary values in the synthesized array of graphic code fusion to obtain the final dot matrix code image as the trademark graphic code.
[0009] Preferably, the value corresponding to the black pixel in the mask of the image to be generated is 0, the value corresponding to the white pixel is 255, and the value corresponding to the gray pixel is 1-254.
[0010] Preferably, the fusion unit is further used to: when the value corresponding to the pixel in the mask of the image to be generated is 0, generate a value corresponding to the pixel at the same coordinate in the synthesized array of graphic code fusion as 1; when the value corresponding to the pixel in the mask of the image to be generated is 255, generate a value corresponding to the pixel at the same coordinate in the synthesized array of graphic code fusion as 0; when the value corresponding to the pixel in the mask of the image to be generated is 1-254, generate a value corresponding to the pixel at the same coordinate in the synthesized array of graphic code fusion as the value of the original dot matrix code binary array.
[0011] Preferably, the rendering unit is used to: when the value corresponding to the pixel in the synthesized array of graphic code fusion is 0, the pixel where 0 is located is not color-rendered; when the value corresponding to the pixel in the synthesized array of graphic code fusion is 1, the pixel where 1 is located is color-rendered to obtain the final dot matrix code image as the trademark graphic code.
[0012] Through the above technical solution, by adopting the trademark graphic code layout method and system provided by the present invention, in the way of using dot matrix codes and preset mask patterns, trademarks, LOGOs, and signs with promotional value and visible to the human eye and having a visual communication effect are formed by code points, solving the problem that traditional dot matrix codes need to separately prepare blank areas for code assignment, which affects the aesthetics and space utilization rate of the packaging material surface.
[0013] Other features and advantages of the embodiments of the present invention will be described in detail in the subsequent specific implementation part. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] The drawings are used to provide a further understanding of the embodiments of the present invention, and constitute a part of the specification. Together with the following specific implementation manners, they are used to explain the embodiments of the present invention, but do not constitute a limitation to the embodiments of the present invention. In the drawings:
[0015] Figure 1 is a flowchart of the trademark graphic code layout method provided by an embodiment of the present invention;
[0016] Figure 2 is a schematic diagram of the mask of the image to be generated provided by an embodiment of the present invention;
[0017] Figure 3 is a schematic diagram of the binary array of the original dot matrix code provided by an embodiment of the present invention;
[0018] Figure 4 is a schematic diagram of the image to be generated provided by an embodiment of the present invention;
[0019] Figure 5 is a structural block diagram of the trademark graphic code layout system provided by an embodiment of the present invention.
[0020] DESCRIPTION OF THE REFERENCE NUMERALS
[0021] 1 - Code value size determination unit 2 - Mask determination unit 3 - Array generation unit
[0022] 4 - Fusion unit 5 - Rendering unit DETAILED DESCRIPTION OF THE INVENTION
[0023] The following will describe in detail the specific implementation manners of the embodiments of the present invention with reference to the drawings. It should be understood that the specific implementation manners described herein are only used to illustrate and explain the embodiments of the present invention, and are not used to limit the embodiments of the present invention.
[0024] Figure 1 is a flowchart of the trademark graphic code layout method provided by an embodiment of the present invention. As Figure 1 shown, the method includes:
[0025] Step S101: Determine the dot matrix code value, code system, and the shape and size of the image to be generated;
[0026] Specifically, in the embodiments of the present invention, a dot matrix code system that supports adjustable pixel density per unit area is used, preferably the microdot code. The microdot code is a highly robust sparse dot matrix code, which is a non-open-source encoding algorithm and decoding algorithm, and the code map cannot be recognized by other open-source code system decoding algorithms. Compared with traditional dense two-dimensional codes that convert the code value into binary 1 and 0 and arrange them in the form of dark and light code points respectively, there will be an obvious gap of at least 1 data position between the data obtained by converting the code value of the microdot code into binary. The code value can be a string of any character encoding. The shape of the image to be generated can be any regular image or an irregular image.
[0027] Step S102: Determine the mask of the image to be generated according to the shape and size of the image to be generated, and the mask of the image to be generated includes at least black, white, and gray;
[0028] Specifically, in order to directly display trademarks, LOGOs, and signs in the area where the product packaging or the body is spray-coded and maintain beauty, the trademarks, LOGOs, and signs to be displayed need to be integrated with the dot matrix code in one area, replacing the traditional solution of using one area for trademarks, LOGOs, and signs and separately coding a rectangular area, which is not beautiful and wastes the product surface space additionally. In the embodiments of the present invention, a mask needs to be set for the generated image. The shape and size of the mask are the same as those of the image to be generated, and the color distribution of the mask should be set corresponding to the image to be generated. Preferably, the mask includes at least black, white, and gray. The value corresponding to a black pixel is 0, the value corresponding to a white pixel is 255, and the value corresponding to a gray pixel is 1 - 254, as Figure 2 shown.
[0029] Step S103: Generate an original dot matrix code binary array according to the dot matrix code value, code system, and the shape and size of the image to be generated;
[0030] Specifically, in the embodiments of the present invention, according to the code value, a dot matrix code is generated through the encoding algorithm unique to the code system and converted into an original dot matrix code binary array, which is composed of "0" and "1". It can be understood that the dot matrix code is divided into several pixels of appropriate size. The value corresponding to a pixel with a dot is 1, and the value corresponding to a pixel without a dot is 0. The shape and size of the original dot matrix code binary array should be the same as those of the image to be generated. As Figure 3 shows a schematic diagram of the original dot matrix code binary array of an embodiment. For the convenience of clear presentation, Figure 3 only a simple binary array example is provided.
[0031] Step S104: Generate a synthesized array of graphic-code fusion according to the mask of the image to be generated and the original dot-code binary array, where the synthesized array of graphic-code fusion is a binary array.
[0032] Specifically, when the value corresponding to the pixel in the mask of the image to be generated is 0, the value corresponding to the pixel at the same coordinate in the synthesized array of graphic-code fusion is 1; when the value corresponding to the pixel in the mask of the image to be generated is 255, the value corresponding to the pixel at the same coordinate in the synthesized array of graphic-code fusion is 0; when the value corresponding to the pixel in the mask of the image to be generated is 1 - 254, the value corresponding to the pixel at the same coordinate in the synthesized array of graphic-code fusion is the value of the original dot-code binary array.
[0033] Step S105: Render pixels corresponding to different binary values in the synthesized array of graphic-code fusion with different colors to obtain the final dot-code image as the trademark graphic code.
[0034] Specifically, when the value corresponding to the pixel in the synthesized array of graphic-code fusion is 0, the pixel where 0 is located is not color-rendered; when the value corresponding to the pixel in the synthesized array of graphic-code fusion is 1, the pixel where 1 is located is color-rendered to obtain the final dot-code image as the trademark graphic code, as Figure 4 shown. Although Figure 4 it is rendered in black in the figure, if the ink used is CMYK color ink or spot color ink, or even invisible ink, the finally presented pattern can be a color-printed pattern.
[0035] Figure 5 is the structural block diagram of the trademark graphic code layout system provided by an embodiment of the present invention. As Figure 5 shown, the system includes: a code value size determination unit 1, a mask determination unit 2, an array generation unit 3, a fusion unit 4, and a rendering unit 5. Among them, the code value size determination unit 1 is used to determine the dot-code value, code system, and the shape and size of the image to be generated; the mask determination unit 2 is used to determine the mask of the image to be generated according to the shape and size of the image to be generated, and the mask of the image to be generated includes at least black, white, and gray; the array generation unit 3 is used to generate the original dot-code binary array according to the dot-code value, code system, and the shape and size of the image to be generated; the fusion unit 4 is used to generate a synthesized array of graphic-code fusion according to the mask of the image to be generated and the original dot-code binary array, where the synthesized array of graphic-code fusion is a binary array; the rendering unit 5 is used to render pixels corresponding to different binary values in the synthesized array of graphic-code fusion with different colors to obtain the final trademark graphic code.
[0036] Preferably, the value corresponding to the black pixel in the mask of the image to be generated is 0, the value corresponding to the white pixel is 255, and the value corresponding to the gray pixel is 1 - 254.
[0037] Preferably, the fusion unit 4 is further configured to: when the value corresponding to the pixel in the mask of the image to be generated is 0, generate a value corresponding to the pixel at the same coordinate of the synthesized array of graphic code fusion as 1; when the value corresponding to the pixel in the mask of the image to be generated is 255, generate a value corresponding to the pixel at the same coordinate of the synthesized array of graphic code fusion as 0; when the value corresponding to the pixel in the mask of the image to be generated is 1 - 254, generate a value corresponding to the pixel at the same coordinate of the synthesized array of graphic code fusion as the value of the original dot matrix code binary array.
[0038] Preferably, the rendering unit 5 is configured to: when the value corresponding to the pixel in the synthesized array of graphic code fusion is 0, no color rendering is performed on the pixel where 0 is located; when the value corresponding to the pixel in the synthesized array of graphic code fusion is 1, color rendering is performed on the pixel where 1 is located to obtain the final trademark graphic code.
[0039] The embodiments of the trademark graphic code layout system described above are similar to the embodiments of the trademark graphic code layout method described above, and will not be elaborated here.
[0040] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memory, CD-ROM, optical memory, etc.) containing computer-usable program code.
[0041] The present application is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram, and the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate means for implementing the functions specified in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.
[0042] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory produce a manufacture including an instruction device that implements the functions specified in one process Figure 1 one process or multiple processes and / or blocks Figure 1 specified in one block or multiple blocks.
[0043] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one process Figure 1 one process or multiple processes and / or blocks Figure 1 specified in one block or multiple blocks.
[0044] In a typical configuration, a computing device includes one or more processors (CPUs), an input / output interface, a network interface, and memory.
[0045] The memory may include non-permanent memory in the form of computer-readable media, random access memory (RAM), and / or non-volatile memory such as read-only memory (ROM) or flash memory (flash RAM). The memory is an example of computer-readable media.
[0046] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can store information by any method or technology. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette tapes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media, such as modulated data signals and carrier waves.
[0047] It should also be noted that the term "comprise", "include" or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, commodity or device comprising a series of elements not only includes those elements but also includes other elements not expressly listed, or further includes elements inherent to such process, method, commodity or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, commodity or device comprising the element.
[0048] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, various changes and modifications can be made to the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included within the scope of the claims of the present application.
Claims
1. A trademark graphic code typesetting method, characterized in that: The method comprises: Determine the dot matrix code value, code system and shape and size of the image to be generated; Determine a mask of the image to be generated according to the shape and size of the image to be generated, wherein the mask of the image to be generated includes at least black, white and gray, and the value corresponding to the black pixel in the mask of the image to be generated is 0, the value corresponding to the white pixel is 255, and the value corresponding to the gray pixel is 1-254; Generate an original dot matrix code binary array according to the dot matrix code value, the code system and the shape and size of the image to be generated, the array consisting of "0" and "1"; According to the mask of the image to be generated and the original dot code binary array, a synthetic array of image-code fusion is generated, and the synthetic array of image-code fusion is a binary array, which includes: When the value corresponding to the pixel in the mask of the image to be generated is 0, the value corresponding to the pixel at the same coordinate of the synthetic array of the generated image code fusion is 1; When the value corresponding to the pixel in the mask of the image to be generated is 255, the value corresponding to the pixel at the same coordinate of the synthetic array for generating image-code fusion is 0; When the value corresponding to the pixel in the mask of the image to be generated is 1-254, the value corresponding to the pixel at the same coordinate of the synthetic array of the generated image code fusion is the value of the original dot matrix code binary array; According to different binary values in the synthetic array of the fusion of the graphic codes, different colors are rendered for pixels corresponding to the binary values to obtain a final dot matrix code image as the trademark graphic code, including: when the value corresponding to the pixel in the synthetic array of the fusion of the graphic codes is 0, the pixel where 0 is located is not rendered in color, and when the value corresponding to the pixel in the synthetic array of the fusion of the graphic codes is 1, the pixel where 1 is located is rendered in color to obtain the final dot matrix code image as the trademark graphic code.
2. A trademark graphic code typesetting system, characterized in that: The system includes: A code value size determination unit, a mask determination unit, an array generation unit, a fusion unit and a rendering unit, wherein: The code value size determination unit is used to determine the code value of the dot code, the code system and the shape and size of the image to be generated; The mask determination unit is used to determine the mask of the image to be generated according to the shape and size of the image to be generated, the mask of the image to be generated at least includes black, white and gray, the value corresponding to the black pixel in the mask of the image to be generated is 0, the value corresponding to the white pixel is 255, and the value corresponding to the gray pixel is 1-254; The array generation unit is used to generate an original dot matrix code binary array according to the dot matrix code value, the code system and the shape and size of the image to be generated, and the array is composed of "0" and "1"; The fusion unit is used to generate a composite array of image-code fusion according to the mask of the image to be generated and the original dot matrix code binary array, wherein the composite array of image-code fusion is a binary array, including: When the value corresponding to the pixel in the mask of the image to be generated is 0, the value corresponding to the pixel at the same coordinate of the synthetic array of the generated image code fusion is 1; When the value corresponding to the pixel in the mask of the image to be generated is 255, the value corresponding to the pixel at the same coordinate of the synthetic array for generating image-code fusion is 0; When the value corresponding to the pixel in the mask of the image to be generated is 1-254, the value corresponding to the pixel at the same coordinate of the synthetic array of the generated image code fusion is the value of the original dot matrix code binary array; The rendering unit is used to perform different color rendering on pixels corresponding to binary values according to different binary values in the synthetic array of the fusion of the image code to obtain a final dot matrix code image as the trademark graphic code, including: when the value corresponding to the pixel in the synthetic array of the fusion of the image code is 0, the pixel where 0 is located is not rendered in color, and when the value corresponding to the pixel in the synthetic array of the fusion of the image code is 1, the pixel where 1 is located is rendered in color to obtain the final dot matrix code image as the trademark graphic code.
Citation Information
Patent Citations
Trademark manufacturing method and hardware
CN117292610A
Method and system for generating scannable image fused with binary digital coding
CN119047505A