CN105718979B - A method of generating two-dimension code image - Google Patents
A method of generating two-dimension code image Download PDFInfo
- Publication number
- CN105718979B CN105718979B CN201610022985.7A CN201610022985A CN105718979B CN 105718979 B CN105718979 B CN 105718979B CN 201610022985 A CN201610022985 A CN 201610022985A CN 105718979 B CN105718979 B CN 105718979B
- Authority
- CN
- China
- Prior art keywords
- code
- point
- picture
- dimensional
- display area
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06K—GRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
- G06K19/00—Record carriers for use with machines and with at least a part designed to carry digital markings
- G06K19/06—Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code
- G06K19/06009—Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking
- G06K19/06046—Constructional details
- G06K19/06103—Constructional details the marking being embedded in a human recognizable image, e.g. a company logo with an embedded two-dimensional code
Abstract
Then a kind of method for generating two-dimension code image of the present invention calculates the size of code-point display area by reading the size of background picture according to the quantity of code-point, guarantee that finally formed PNG picture and background picture with two-dimensional barcode information are in the same size;When forming transparent PNG picture, to code-point size, shape does not limit, as long as falling completely in code-point display area, there is no the concept of fixed size, and code-point is allowed to show three-dimensional sense, it is unlikely to confuse with base map color contamination, more easily discriminate out code, reduce barcode scanning point error rate, decoding efficiency is higher, and utilize the serious forgiveness of two dimensional code, selective erase is carried out to the two dimensional code code-point for influencing background picture display effect, under the premise of not influencing the function of two dimensional code, background picture can completely be showed, preferably increase the visual effect of two dimensional code, the use function and range of two dimensional code can further be expanded.
Description
Technical field
The invention belongs to computer application technology and digital image processing field more particularly to a kind of generation two dimensional codes
The method of picture.
Background technique
As shown in Figure 1, two dimensional code to be fused is also known as QR code (Quick Response, quick response two dimensional code), it is to use certain
The specific geometric figure of kind is according to certain rules in the chequered with black and white graphic recording data symbol of plane (on two-dimensional directional) distribution
Information;Dexterously using " 0 " of composition computer-internal logical foundations, the concept of " 1 " bit stream in code compilation, if using
A geometrical body corresponding with binary system is done to indicate text numerical information, passes through image input device or photoelectric scanning device
Automatically identifying and reading is to realize automatic processing of information: it has some general character of barcode technology, and every kind of code system has its specific character set,
Each character occupies certain width, has certain verifying function, also have to the information automatic identification function that do not go together and
Handle the function of the rotationally-varying point of figure.
Two dimensional code to be fused includes attribute information area and data field, and the information in attribute information area and data field is all with symbol
Form indicate.Wherein data field is used to store the data of coding, and attribute information area is used to store the attribute of two dimensional code to be fused
Information, the attribute information are the necessary informations for identifying two dimensional code to be fused.Attribute information area includes position sensing figure, position spy
Mapping shape marker space, positioning pattern, correction graph, format information and version information etc..When two dimensional code to be fused first to
When a symbol in integration region is located at the attribute information area of two dimensional code to be fused, the symbol can determine that indicate to be fused two
Tie up the symbol of the attribute information of code.
Although two dimensional code stores the very capable of information, by information after coding obtains two dimensional code, user just can not
Directly know any information of the two dimensional code, it is necessary to can just know it using special two-dimensional code scanning software scans two dimensional code
The information of middle record.In order to improve the ability of two dimensional code expressing information, image and two dimensional code are melted there are a kind of in traditional technology
The means of conjunction, the serious forgiveness using two dimensional code will be added in two dimensional code after image down, be commonly added to the center of two dimensional code
Position.
Since 1994 by Japan the invention of DensoWave company since, two dimensional code makes extensively as a kind of recognition methods
For industries such as inventory tracking, traffic, manufacture, retails.Since the universal and two dimensional code of smart phone has and can quickly solve
For code with access online resource and with characteristics such as high capacity, two dimensional code is used for various application programs, for example accesses
Website, downloads personal credit card information, and the social networks of release information starts phone, replicating video or opening text document.This
Kind multifunctionality makes them all be a valuable tool in any industry.But the shape and color tolerance of two dimensional code have
Limit incorporates billboard design or printing material by drastic delimitations.
It is existing that there is also some color 2 D codes, such as wechat personal information two dimensional code, Alipay personal information two dimensional code
The structure of original " trellis " code block of two dimensional code is not significantly changed Deng, these color 2 D codes, it is only stiff will be after dyeing
Two dimensional code imbed in picture, or picture stiff ground small range is imbedded in two dimensional code, the two is not combined organically, and
And style sheet one.
Summary of the invention
The purpose of the present invention is to provide it is a kind of generate two-dimension code image method, make two dimensional code in a transparent manner with to
The background picture of fusion organically combines, and neither influences the function of two dimensional code, also can completely show background picture, more
Increase the visual effect of two dimensional code well, can further expand the use function and range of two dimensional code.
A kind of method for generating two-dimension code image of the present invention, specifically comprises the following steps:
Step 1 is made of the information of user's input according to the generation of the generated code rule of two dimensional code 0 or 1 code accordingly
Two dimensional code matrix M*M;
Step 2, acquisition background picture adjustment are square and obtain hem width pixel value;
Step 3, by the hem width pixel value of background picture divided by two dimensional code square matrix code count M, calculate each code-point most
Big pixel value N, obtains code-point display area N*N;
Step 4, the code-point that arbitrary size and shape are stamped in each code-point display area obtain one and background picture
The transparent PNG picture with two-dimensional barcode information of same size:
Step 41, according to two dimensional code matrix, if in code-point display area code-point color be black, first shown in code-point
The background color block that shape size is slightly larger than code-point shape is stamped in region, using the contrastive colours of black;
Step 42 does transparency process to the background color block in code-point display area;
Step 43, one shape of formation is smaller in the undercolor region and transparence value is 0 black code-point, this has vertical
The code-point of body effect can be arbitrary shape;
Step 44 repeats step 41 to step 43 until stamping code-point in each code-point display area;
Step 5, transparent PNG picture and background picture, which overlap, is completely coincident two pictures;
The two-dimension code image that two stack is output on webpage and is shown by step 6;
Step 7 determines that by the region that two positioning patterns in two-dimension code image surround be operable area, and user is in two dimension
In the range of code serious forgiveness allows, using plug-in unit JQUERY for two of influence background picture display effect on transparent PNG picture
It ties up code code-point and carries out selective erase;
Two are schemed when step 8, preservation while being scanned pixel-by-pixel, in scanning, if can be taken from the PNG picture of upper layer
To pixel value, then the pixel value of background picture, one new two dimensional code of scanned generation are used if not having with its pixel value
Picture.
A kind of method for generating two-dimension code image of the present invention, by reading the size of background picture, then according to code-point
Quantity calculates the size of code-point display area, guarantees that finally formed PNG picture and background picture with two-dimensional barcode information are big
It is small consistent;When forming transparent PNG picture, code-point size, shape are not limited, as long as falling completely in code-point display area i.e.
Can, the not no concept of fixed size, and code-point is allowed to show three-dimensional sense, it is unlikely to confuse with base map color contamination, distinguishes code and compare appearance
Easily, barcode scanning point error rate is reduced, decoding efficiency is higher;And using the serious forgiveness of two dimensional code, to influence background picture display effect
Two dimensional code code-point carry out selective erase background picture can completely be showed under the premise of not influencing the function of two dimensional code
Come, preferably increases the visual effect of two dimensional code, can further expand the use function and range of two dimensional code.
Detailed description of the invention
Fig. 1 is two dimensional code composition schematic diagram;
Fig. 2 is code-point display area of the present invention schematic diagram;
Fig. 3 A and Fig. 3 B are respectively the schematic diagram that white or black background color block are stamped in code-point display area of the invention;
Fig. 4 A and Fig. 4 B are respectively that the background color block of Fig. 3 A and Fig. 3 B do the effect diagram of transparency process;
Fig. 5 A and Fig. 5 B be respectively Fig. 4 A and Fig. 4 B background color block on stamp the effect diagram of code-point;
Fig. 6 is the schematic diagram that code-point does not do stereoscopic effect processing;
Fig. 7 is the two-dimension code image that the present invention merges the figure that has powerful connections.
Below in conjunction with drawings and examples, the invention will be further described.
Specific embodiment
A method of two-dimension code image is generated, is specifically comprised the following steps:
Step 1 is made of the information of user's input according to the generation of the generated code rule of two dimensional code 0 or 1 code accordingly
Two dimensional code matrix M*M;
Step 2, acquisition background picture adjustment are square and obtain hem width pixel value, which can be cromogram
Piece;
Step 3, by the hem width pixel value of background picture divided by two dimensional code square matrix code count M, calculate each code-point most
Big pixel value N, obtains code-point display area N*N, as shown in Figure 2;
Step 4, the code-point that arbitrary size and shape are stamped in each code-point display area obtain one and background picture
The transparent PNG picture with two-dimensional barcode information of same size:
Step 41, according to two dimensional code matrix, if in code-point display area code-point color be black, first shown in code-point
The background color block that shape size is slightly larger than code-point shape is stamped in region, can be the contrastive colours of black, such as white or shallow
Color, as shown in Figure 3A, it is assumed that code-point is black triangle, then code-point display area stamp one it is more bigger than code-point shape white
The undercolor region of color triangle, if code-point is white triangles shape, undercolor region is black, as shown in Figure 3B;
Step 42 does transparency process to the background color block in code-point display area, that is, sets the transparency of background color block
Value is threshold value, sees Fig. 4 A and Fig. 4 B;
Step 43 forms the black code-point that a shape is smaller and transparence value is 0, code-point at this in the undercolor region
For high contrast, high transparency and the arbitrary shape for having stereoscopic effect;
Step 44 repeats step 41 to step 43 until stamping code-point in each code-point display area;
Step 5, transparent PNG picture and background picture, which overlap, is completely coincident two pictures;
The two-dimension code image that two stack is output on webpage and is shown by step 6;
Step 7, as shown in Figure 1, determine that the region surrounded by two positioning patterns in two-dimension code image is operable area,
User is aobvious for background picture is influenced on transparent PNG picture using plug-in unit JQUERY in the range of two dimensional code serious forgiveness allows
Show that the two dimensional code code-point of effect carries out selective erase, due to being the upper layer PNG picture for stacking when operation, therefore will not influence down
Layer color background picture;
Two are schemed when step 8, preservation while being scanned pixel-by-pixel, in scanning, if can be taken from the PNG picture of upper layer
To pixel value, then the pixel value of background picture, one new two dimensional code of scanned generation are used if not having with its pixel value
Picture.
Of the invention focuses on: the size by reading background picture, and it is aobvious then to calculate code-point according to the quantity of code-point
Show the size in region, guarantees that finally formed PNG picture and background picture with two-dimensional barcode information are in the same size;It is saturating being formed
When bright PNG picture, code-point size, shape are not limited, as long as falling completely in code-point display area, without fixed size
Concept, and code-point is allowed to show three-dimensional sense, is unlikely to confuse with base map color contamination, the code-point in Fig. 6 does not do stereoscopic effect processing, white
Colour coding point oneself through having merged bad differentiation by background, code-point of the invention has done stereoscopic effect processing, as shown in fig. 7, distinguishing
Code is easier, and reduces barcode scanning point error rate, and decoding efficiency is higher;And using the serious forgiveness of two dimensional code, to influence background picture
The two dimensional code code-point of display effect carries out selective erase can be complete by background picture under the premise of not influencing the function of two dimensional code
Ground shows, and preferably increases the visual effect of two dimensional code, can further expand the use function and range of two dimensional code.
The above is only present pre-ferred embodiments, is not intended to limit the scope of the present invention, therefore
Any subtle modifications, equivalent variations and modifications to the above embodiments according to the technical essence of the invention, still belong to
In the range of technical solution of the present invention.
Claims (1)
1. a kind of method for generating two-dimension code image, it is characterised in that include the following steps:
The information of user's input is generated two be made of accordingly 0 or 1 code according to the generated code rule of two dimensional code by step 1
Tie up code matrix M*M;
Step 2, acquisition background picture adjustment are square and obtain hem width pixel value;
Step 3, by the hem width pixel value of background picture divided by two dimensional code square matrix code count M, calculate the maximum picture of each code-point
Plain value N, obtains code-point display area N*N;
Step 4, the code-point that arbitrary size and shape are stamped in each code-point display area, acquisition one are identical with background picture
The transparent PNG picture with two-dimensional barcode information of size:
Step 41, according to two dimensional code matrix, if in code-point display area code-point color be black, first in code-point display area
The background color block that shape size is slightly larger than code-point shape is inside stamped, using the contrastive colours of black;
Step 42 does transparency process to the background color block in code-point display area;
Step 43, one shape of formation is smaller in the undercolor region and transparence value is 0 black code-point, this has three-dimensional effect
The code-point of fruit can be arbitrary shape;
Step 44 repeats step 41 to step 43 until stamping code-point in each code-point display area;
Step 5, transparent PNG picture and color background picture, which overlap, is completely coincident two pictures;
The two-dimension code image that two stack is output on webpage and is shown by step 6;
Step 7 determines that by the region that two positioning patterns in two-dimension code image surround be operable area, and user holds in two dimensional code
In the range of error rate allows, using plug-in unit JQUERY for the two dimensional code for influencing background picture display effect on transparent PNG picture
Code-point carries out selective erase;
Two are schemed when step 8, preservation while being scanned pixel-by-pixel, in scanning, if picture can be got from the PNG picture of upper layer
Element value then uses the pixel value of background picture, one new two-dimension code image of scanned generation if not having with its pixel value
By reading the size of background picture, the size of code-point display area is then calculated according to the quantity of code-point, is guaranteed final
The PNG picture with two-dimensional barcode information and background picture formed is in the same size;It is big to code-point when forming transparent PNG picture
Small, shape does not limit, as long as falling completely in code-point display area, the not no concept of fixed size, and code-point is allowed to present
Three-dimensional sense out is unlikely to confuse with base map color contamination, distinguishes code and be easier, and reduces barcode scanning point error rate, and decoding efficiency is higher.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610022985.7A CN105718979B (en) | 2016-01-14 | 2016-01-14 | A method of generating two-dimension code image |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610022985.7A CN105718979B (en) | 2016-01-14 | 2016-01-14 | A method of generating two-dimension code image |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105718979A CN105718979A (en) | 2016-06-29 |
CN105718979B true CN105718979B (en) | 2019-06-25 |
Family
ID=56147054
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610022985.7A Expired - Fee Related CN105718979B (en) | 2016-01-14 | 2016-01-14 | A method of generating two-dimension code image |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105718979B (en) |
Families Citing this family (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106250833B (en) * | 2016-07-22 | 2019-11-19 | 深圳棒棒帮科技有限公司 | The recognition methods of the generation method of micrographics group for information MAP and micro- figure group |
CN106778998A (en) * | 2016-11-28 | 2017-05-31 | 北京慧眼智行科技有限公司 | The generation method and device of a kind of color 2 D code |
CN106779001B (en) * | 2016-12-12 | 2019-12-17 | 张国炜 | Manufacturing method of gradient two-dimensional code |
CN106991462B (en) * | 2017-03-13 | 2018-04-17 | 三维码(厦门)网络科技有限公司 | Three-dimensional code generating method |
CN107172259B (en) * | 2017-04-11 | 2020-09-25 | Tcl移动通信科技(宁波)有限公司 | Terminal and information interaction method and storage device based on two-dimensional code |
CN108197687A (en) * | 2017-12-27 | 2018-06-22 | 江苏集萃智能制造技术研究所有限公司 | A kind of webpage two-dimensional code generation method |
CN110909843B (en) * | 2019-11-21 | 2021-05-14 | 程烨 | Method, device, server and storage medium for modeling coded image |
CN111160501A (en) * | 2019-12-25 | 2020-05-15 | 北京亮亮视野科技有限公司 | Construction method and device of two-dimensional code training data set |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101059833A (en) * | 2006-04-19 | 2007-10-24 | At信息株式会社 | Two-dimensional code with a logo |
CN105009146A (en) * | 2012-06-26 | 2015-10-28 | 艾克尼特有限公司 | Image mask providing a machine-readable data matrix code |
CN105117760A (en) * | 2015-09-15 | 2015-12-02 | 牛建伟 | Method for generating color image two-dimensional code through fusion of two-dimensional code with color image |
-
2016
- 2016-01-14 CN CN201610022985.7A patent/CN105718979B/en not_active Expired - Fee Related
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101059833A (en) * | 2006-04-19 | 2007-10-24 | At信息株式会社 | Two-dimensional code with a logo |
CN105009146A (en) * | 2012-06-26 | 2015-10-28 | 艾克尼特有限公司 | Image mask providing a machine-readable data matrix code |
CN105117760A (en) * | 2015-09-15 | 2015-12-02 | 牛建伟 | Method for generating color image two-dimensional code through fusion of two-dimensional code with color image |
Also Published As
Publication number | Publication date |
---|---|
CN105718979A (en) | 2016-06-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105718979B (en) | A method of generating two-dimension code image | |
CN105718980B (en) | A method of generating two-dimension code image | |
CN105117760B (en) | A kind of method that Quick Response Code is merged to generation color image Quick Response Code with color image | |
EP3457327B1 (en) | Method and apparatus for generating two-dimensional code picture having dynamic effect | |
WO2020156552A1 (en) | Two-dimensional code generation and recognition methods and devices | |
US11797810B2 (en) | Machine-readable label generator | |
CN103400099B (en) | Terminal and two-dimensional code identification method | |
CN106991462B (en) | Three-dimensional code generating method | |
CN105701529B (en) | A method of realizing that color image is shown on two dimensional code | |
CN103218595A (en) | Terminal and method for recognizing two-dimensional codes | |
CN104778491A (en) | Image code applied to information processing, as well as device and method for generating and analyzing image code | |
US8550367B2 (en) | System and method for embedding machine-readable codes in combination with other images such as logos | |
CN104281830A (en) | Two-dimension code identification method and device | |
WO2021169502A1 (en) | A pixel image as well as its processing method and application system | |
US20170204543A1 (en) | Data-bearing fabric | |
TWI696954B (en) | Digital object unique identifier (DOI) recognition method and device | |
CN103150392A (en) | Method for comparing prices of similar commodities | |
US10395155B2 (en) | Billboard containing encoded information | |
CN109831309A (en) | A kind of safety code principle and method with multiple-authentication | |
CN106067054A (en) | A kind of Quick Response Code based on QR code | |
CN105894070B (en) | A kind of two dimension code encoding method and device | |
CN109389199A (en) | A kind of multidimensional code system and decoding method | |
CN106339907A (en) | Data tracing interaction method | |
CN106779001B (en) | Manufacturing method of gradient two-dimensional code | |
CN107273961A (en) | A kind of method that color 2 D code is automatically generated according to template |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20190625 Termination date: 20200114 |