1
- # QR-Code
2
- [ * back to English* ] ( https://github.com/sylnsfar/qrcode/blob/master/README.md )
1
+ # Amazing-QR
3
2
4
- * ** 更新 (160906)** : 新增 ** exe** 版本 - [ myqr.exe in qrcode_win] ( https://github.com/sylnsfar/qrcode_win )
3
+ [](https://pypi.org/project/myqr/) [](https://pypi.org/project/myqr/) [](https://www.python.org/)  [](https://pypi.org/project/amzqr/)  [](https://pypi.org/project/amzqr/) [](https://github.com/x-hw/amazing-qr/blob/master/LICENSE.md)    
5
4
6
- * ** 更新 (160908) ** : 新增 ** 网页 ** 版本 - [ amazing-qrcode ] ( http ://www.amazing-qrcode. com/) * (made by [ Maras0830 ] ( https://github.com/Maras0830 ) ) *
5
+ [ ![ ] ( https://img.shields.io/badge/GitHub-x.hw-blue?logo=github )] ( https ://github. com/x-hw ) [ ![ sponsor ] ( https://img.shields.io/badge/sponsor--pink?logo=github-sponsors&labelColor=pink )] ( #打赏杯咖啡 )
7
6
8
- * ** 更新 (160910)** : 发布到 ** PyPI** - [ ** MyQR** ] ( https://pypi.python.org/pypi/MyQR ) !
9
-
10
- * 160911: 更新为可导入的模块
11
-
12
-
7
+ [ * back to English* ] ( https://github.com/x-hw/amazing-qr/blob/master/README.md )
13
8
14
9
## 概述
15
10
16
11
** Python 二维码生成器**
17
12
18
13
可生成* 普通二维码* 、* 带图片的艺术二维码(黑白与彩色)* 、* 动态二维码(黑白与彩色)* 。
19
14
20
-
21
-
22
-
23
-
24
15
## Contents 目录
25
16
26
- * [ 概述] ( #概述 )
27
- * [ 目录] ( #目录 )
28
- * [ 示例] ( #示例 )
29
- * [ 安装] ( #安装 )
30
- * [ 使用方法] ( #使用方法 )
31
- * [ 命令行方式] ( #命令行方式 )
32
- * [ 作为导入文件] ( #作为导入文件 )
33
- * [ 使用提示] ( #使用提示 )
34
- * [ 可用字符] ( #可用字符 )
35
- * [ 依赖库] ( #依赖库 )
36
- * [ 运行环境] ( #运行环境 )
37
- * [ 协议] ( #协议 )
38
-
39
-
40
-
17
+ * [ Amazing-QR] ( #amazing-qr )
18
+ * [ 概述] ( #概述 )
19
+ * [ 目录] ( #目录 )
20
+ * [ 示例] ( #示例 )
21
+ * [ 安装] ( #安装 )
22
+ * [ 使用方法] ( #使用方法 )
23
+ * [ 命令行方式] ( #命令行方式 )
24
+ * [ 作为导入文件] ( #作为导入文件 )
25
+ * [ 使用提示] ( #使用提示 )
26
+ * [ 可用字符] ( #可用字符 )
27
+ * [ 环境] ( #环境 )
28
+ * [ 协议] ( #协议 )
29
+ * [ 打赏杯咖啡☕️] ( #打赏杯咖啡 )
41
30
42
31
## 示例
43
32
44
- ![ ] ( https://github.com/sylnsfar/qrcode/blob/master/example/qrs0.jpg )
45
-
46
- ![ ] ( https://github.com/sylnsfar/qrcode/blob/master/example/qrs1.jpg )
33
+ ![ ] ( https://github.com/x-hw/amazing-qr/blob/master/example/qrs0.jpg )
47
34
48
- ![ ] ( https://github.com/sylnsfar/qrcode /blob/master/example/qrs2 .jpg )
35
+ ![ ] ( https://github.com/x-hw/amazing-qr /blob/master/example/qrs1 .jpg )
49
36
50
- ![ ] ( https://github.com/sylnsfar/qrcode /blob/master/example/c_qrcode.gif ) ![ ] ( https://github.com/sylnsfar/qrcode/blob/master/example/daftpunktocat-guy_qrcode.gif )
37
+ ![ ] ( https://github.com/x-hw/amazing-qr /blob/master/example/qrs2.jpg )
51
38
52
- ![ ] ( https://github.com/sylnsfar/qrcode /blob/master/example/zootopia_qrcode .gif ) ![ ] ( https://github.com/sylnsfar/qrcode /blob/master/example/daftpunktocat-guy_qrcode0 .gif )
39
+ ![ ] ( https://github.com/x-hw/amazing-qr /blob/master/example/c_qrcode .gif ) ![ ] ( https://github.com/x-hw/amazing-qr /blob/master/example/daftpunktocat-guy_qrcode .gif )
53
40
54
-
41
+ ![ ] ( https://github.com/x-hw/amazing-qr/blob/master/example/zootopia_qrcode.gif ) ![ ] ( https://github.com/x-hw/amazing-qr/blob/master/example/daftpunktocat-guy_qrcode0.gif )
55
42
56
-
57
43
58
44
## 安装
59
45
60
46
``` python
61
- # 通过 pip
62
- pip(3 ) install myqr(or MyQR)
47
+ pip install amzqr
63
48
```
64
49
65
-
66
-
67
-
68
-
69
50
## 使用方法
70
51
71
52
### 命令行方式
72
53
73
- * (** 提示** :如果你尚未安装 [ ** MyQR ** ] ( https://pypi.python.org/pypi/MyQR ) ,以下内容请使用` python(3) myqr .py ` 而非` myqr ` 。)*
54
+ * (** 提示** :如果你尚未安装 [ ** amzqr ** ] ( https://pypi.python.org/pypi/amzqr ) ,以下内容请使用` python(3) amzqr .py ` 而非` amzqr ` 。)*
74
55
75
56
``` python
76
57
# 概括
77
- myqr Words
78
- [- v {1 ,2 ,3 ,... ,40 }]
79
- [- l {L,M,Q,H}]
80
- [- n output- filename]
81
- [- d output- directory]
82
- [- p picture_file]
83
- [- c]
84
- [- con contrast]
85
- [- bri brightness]
58
+ amzqr Words
59
+ [- v {1 ,2 ,3 ,... ,40 }]
60
+ [- l {L,M,Q,H}]
61
+ [- n output- filename]
62
+ [- d output- directory]
63
+ [- p picture_file]
64
+ [- c]
65
+ [- con contrast]
66
+ [- bri brightness]
86
67
```
87
68
88
69
- [ 普通二维码] ( #普通二维码 ) 介绍了 ` Words ` , ` -v ` , ` -l ` , ` -n ` , ` -d `
89
70
- [ 艺术二维码] ( #艺术二维码 ) 介绍了 ` -p ` , ` -c ` , ` -con ` , ` -bri `
90
71
- [ 动态GIF二维码] ( #动态gif二维码 ) 介绍了动态的生成方法和注意点
91
72
92
-
93
-
94
-
95
-
96
73
#### 普通二维码
97
74
98
- ![ ] ( https://github.com/sylnsfar/qrcode /blob/master/example/0.png )
75
+ ![ ] ( https://github.com/x-hw/amzqr /blob/master/example/0.png )
99
76
100
77
``` markdown
101
78
#1 Words
102
- myqr https://github.com
79
+ amzqr https://github.com
103
80
```
104
81
105
82
* 在命令后输入链接或者句子作为参数,然后在程序的当前目录中产生相应的二维码图片文件,默认命名为” qrcode.png“。
106
83
107
-
108
-
109
84
``` markdown
110
85
#2 -v, -l
111
- myqr https://github.com -v 10 -l Q
86
+ amzqr https://github.com -v 10 -l Q
112
87
```
113
88
114
89
* ** 默认边长** 是取决于你输入的信息的长度和使用的纠错等级;
@@ -121,12 +96,9 @@ myqr https://github.com -v 10 -l Q
121
96
122
97
` -l ` 控制纠错水平,范围是** L、M、Q、H** ,从左到右依次升高。
123
98
124
-
125
-
126
-
127
99
``` markdown
128
100
#3 -n, -d
129
- myqr https://github.com -n github_qr.jpg -d .../paths/
101
+ amzqr https://github.com -n github_qr.jpg -d .../paths/
130
102
```
131
103
132
104
- ** 默认输出文件名** 是“ qrcode.png ",而** 默认存储位置** 是当前目录。
@@ -137,68 +109,46 @@ myqr https://github.com -n github_qr.jpg -d .../paths/
137
109
138
110
` -d ` 控制位置。
139
111
140
-
141
-
142
-
143
-
144
-
145
-
146
-
147
- #### 艺术二维码
148
-
149
- ![ ] ( https://github.com/sylnsfar/qrcode/blob/master/example/1.png ) ![ ] ( https://github.com/sylnsfar/qrcode/blob/master/example/2.png )
112
+ #### 艺术二维码
150
113
114
+ ![ ] ( https://github.com/x-hw/amazing-qr/blob/master/example/1.png ) ![ ] ( https://github.com/x-hw/amazing-qr/blob/master/example/2.png )
151
115
152
116
``` markdown
153
117
#1 -p
154
- myqr https://github.com -p github.jpg
118
+ amzqr https://github.com -p github.jpg
155
119
```
156
120
157
121
* 参数` -p ` 用来将QR二维码图像与一张同目录下的图片相结合,产生一张** 黑白** 图片。
158
122
159
-
160
-
161
-
162
-
163
-
164
123
``` markdown
165
124
#2 -c
166
- myqr https://github.com -p github.jpg -c
125
+ amzqr https://github.com -p github.jpg -c
167
126
```
168
127
169
128
* 加上参数 ` -c ` 可以使产生的图片由黑白变为** 彩色** 的。
170
129
171
-
172
-
173
-
174
-
175
130
``` markdown
176
131
#3 -con, -bri
177
- myqr https://github.com -p github.jpg [-c] -con 1.5 -bri 1.6
132
+ amzqr https://github.com -p github.jpg [-c] -con 1.5 -bri 1.6
178
133
```
179
134
180
135
* 参数` -con ` 用以调节图片的** 对比度** ,1.0 表示原始图片,更小的值表示更低对比度,更大反之。** 默认为1.0** 。
181
136
182
137
* 参数 ` -bri ` 用来调节图片的** 亮度** ,其余用法和取值与 ` -con ` 相同。
183
138
184
-
185
-
186
-
187
139
#### 动态GIF二维码
188
140
189
- ![ ] ( https://github.com/sylnsfar/qrcode /blob/master/example/daftpunktocat-guy_qrcode.gif ) ![ ] ( https://github.com/sylnsfar/qrcode /blob/master/example/daftpunktocat-guy_qrcode0.gif )
141
+ ![ ] ( https://github.com/x-hw/amazing-qr /blob/master/example/daftpunktocat-guy_qrcode.gif ) ![ ] ( https://github.com/x-hw/amazing-qr /blob/master/example/daftpunktocat-guy_qrcode0.gif )
190
142
191
143
动态二维码与上述的带图片的二维码的生成方法没什么区别,你只要采用 ` .gif ` 格式的图片即可生成黑白或者彩色的动态二维码。但** 注意** 如果使用了 ` -n ` 参数自定义输出的文件名,切记其格式也必须是 ` .gif ` 格式。
192
144
193
-
194
-
195
145
### 作为导入文件
196
146
197
147
``` python
198
148
# 安装模块后
199
- from MyQR import myqr
200
- version, level, qr_name = myqr .run(
201
- words,
149
+ from amzqr import amzqr
150
+ version, level, qr_name = amzqr .run(
151
+ words,
202
152
version = 1 ,
203
153
level = ' H' ,
204
154
picture = None ,
@@ -207,16 +157,13 @@ version, level, qr_name = myqr.run(
207
157
brightness = 1.0 ,
208
158
save_name = None ,
209
159
save_dir = os.getcwd()
210
- )
160
+ )
211
161
```
212
162
213
-
214
-
215
163
* 以下各个参数已经在[ 上文] ( #命令行方式 ) 有所介绍*
216
164
217
-
218
165
``` python
219
- # help(myqr )
166
+ # help(amzqr )
220
167
Positional parameter
221
168
words: str
222
169
@@ -230,23 +177,15 @@ Optional parameters
230
177
save_name: str , the output filename like ' example.png'
231
178
save_dir: str , the output directory
232
179
```
233
-
234
-
235
-
236
-
237
-
238
180
## 使用提示
239
181
240
182
* 请采用** 正方形** 或近似正方形的图片
241
183
242
184
* 建议在图片尺寸大的时候使用 ` -v ` 的值也应该** 适当** 变大。
243
185
244
- * 如果图片有透明无色部分,最终效果是:![ ] ( https://github.com/sylnsfar/qrcode/blob/master/example/aa.png )
245
-
246
- 你可以将透明部分修改成白色,最终效果会变成![ ] ( https://github.com/sylnsfar/qrcode/blob/master/example/a0.png )
247
-
248
-
186
+ * 如果图片有透明无色部分,最终效果是:![ ] ( https://github.com/x-hw/amazing-qr/blob/master/example/aa.png )
249
187
188
+ 你可以将透明部分修改成白色,最终效果会变成![ ] ( https://github.com/x-hw/amazing-qr/blob/master/example/a0.png )
250
189
251
190
## 可用字符
252
191
@@ -260,32 +199,26 @@ Optional parameters
260
199
· , . : ; + - * / \ ~ ! @ # $ % ^ & ` ' = < > [ ] ( ) ? _ { } | and (space)
261
200
```
262
201
202
+ ## 环境
263
203
264
-
265
-
266
- ## 依赖库
267
-
268
- * [ pillow] ( https://pypi.python.org/pypi/Pillow/3.3.1 )
269
- * [ numpy] ( https://pypi.python.org/pypi/numpy )
270
- * [ imageio] ( https://pypi.python.org/pypi/imageio )
271
-
272
-
204
+ - Python 3
273
205
206
+ ## 协议
274
207
275
- * ( ** 提示 ** :如果没有安装 [ ** MyQR ** ] ( https://pypi.python.org/pypi/MyQR ) ,使用命令 ` pip install -r requirements.txt ` 来安装所有依赖的库。) *
208
+ * GPLv3
276
209
277
-
210
+ ## 打赏杯咖啡
278
211
279
- ## 运行环境
212
+ [ ![ GitHub Sponsors ] ( https://img.shields.io/github/sponsors/x-hw?logo=github-sponsors&labelColor=pink&color=white )] ( https://github.com/sponsors#regions )
280
213
281
- * Linux, Python 3
282
- * Windows, Python 3
283
- * Mac, Python 3
214
+ * GitHub Sponsors 还用不了...*
284
215
216
+ 
285
217
286
-
218
+ < img src = " https://github.com/x-hw/amazing-qr/blob/master/example/wechatpay.jpg " width = " 124 " height = " 116 " alt = " wechatpay " align = center />
287
219
220
+ ![ alipay] ( https://img.shields.io/badge/-支付宝打赏-blue?logo=alipay&logoColor=ffffff&labelColor=blue )
288
221
289
- ## 协议
222
+ < img src = " https://github.com/x-hw/amazing-qr/blob/master/example/alipay.gif " width = " 132 " height = " 132 " alt = " alipay " align = center />
290
223
291
- * GPLv3
224
+ 🎉🎉🎉 感谢你的支持 🎉🎉🎉
0 commit comments