Skip to content

Commit cb0d1ca

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 76f07c8 + a773916 commit cb0d1ca

20 files changed

+188
-264
lines changed

.gitignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,5 +92,8 @@ ENV/
9292
# Rope project settings
9393
.ropeproject
9494

95-
setup.py
96-
MANIFEST
95+
MANIFEST
96+
97+
.idea
98+
.vscode
99+

README-cn.md

Lines changed: 62 additions & 129 deletions
Original file line numberDiff line numberDiff line change
@@ -1,114 +1,89 @@
1-
# QR-Code
2-
[*back to English*](https://github.com/sylnsfar/qrcode/blob/master/README.md)
1+
# Amazing-QR
32

4-
* **更新 (160906)**: 新增 **exe** 版本 - [myqr.exe in qrcode_win](https://github.com/sylnsfar/qrcode_win)
3+
[![former name](https://img.shields.io/badge/old%20name-MyQR-yellow)](https://pypi.org/project/myqr/) [![PyPI - Downloads](https://img.shields.io/pypi/dm/myqr?label=downloads@myqr)](https://pypi.org/project/myqr/) [![](https://img.shields.io/badge/language-Python-blue)](https://www.python.org/) ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/amzqr?logo=python&logoColor=ffffff&label=Python&labelColor=blue&color=ffffff) [![PyPI](https://img.shields.io/pypi/v/amzqr?logo=pypi&logoColor=ffffff&label=PyPI&labelColor=blue)](https://pypi.org/project/amzqr/) ![PyPI - Wheel](https://img.shields.io/pypi/wheel/amzqr) [![PyPI - Downloads](https://img.shields.io/pypi/dm/amzqr)](https://pypi.org/project/amzqr/) [![PyPI - License](https://img.shields.io/pypi/l/amzqr)](https://github.com/x-hw/amazing-qr/blob/master/LICENSE.md) ![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/x-hw/amazing-qr) ![macos](https://img.shields.io/badge/-macOS-black?logo=macos) ![linux](https://img.shields.io/badge/-Linux-yellow?logo=linux) ![windows](https://img.shields.io/badge/-Windows-blue?logo=windows)
54

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)](#打赏杯咖啡)
76

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)
138

149
## 概述
1510

1611
**Python 二维码生成器**
1712

1813
可生成*普通二维码**带图片的艺术二维码(黑白与彩色)**动态二维码(黑白与彩色)*
1914

20-
21-
22-
23-
2415
## Contents 目录
2516

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+
* [打赏杯咖啡☕️](#打赏杯咖啡)
4130

4231
## 示例
4332

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)
4734

48-
![](https://github.com/sylnsfar/qrcode/blob/master/example/qrs2.jpg)
35+
![](https://github.com/x-hw/amazing-qr/blob/master/example/qrs1.jpg)
4936

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)
5138

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)
5340

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)
5542

56-
5743

5844
## 安装
5945

6046
```python
61-
# 通过 pip
62-
pip(3) install myqr(or MyQR)
47+
pip install amzqr
6348
```
6449

65-
66-
67-
68-
6950
## 使用方法
7051

7152
### 命令行方式
7253

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` 。)*
7455

7556
```python
7657
# 概括
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]
8667
```
8768

8869
- [普通二维码](#普通二维码) 介绍了 `Words`, `-v`, `-l`, `-n`, `-d`
8970
- [艺术二维码](#艺术二维码) 介绍了 `-p`, `-c`, `-con`, `-bri`
9071
- [动态GIF二维码](#动态gif二维码) 介绍了动态的生成方法和注意点
9172

92-
93-
94-
95-
9673
#### 普通二维码
9774

98-
![](https://github.com/sylnsfar/qrcode/blob/master/example/0.png)
75+
![](https://github.com/x-hw/amzqr/blob/master/example/0.png)
9976

10077
```markdown
10178
#1 Words
102-
myqr https://github.com
79+
amzqr https://github.com
10380
```
10481

10582
* 在命令后输入链接或者句子作为参数,然后在程序的当前目录中产生相应的二维码图片文件,默认命名为” qrcode.png“。
10683

107-
108-
10984
```markdown
11085
#2 -v, -l
111-
myqr https://github.com -v 10 -l Q
86+
amzqr https://github.com -v 10 -l Q
11287
```
11388

11489
* **默认边长**是取决于你输入的信息的长度和使用的纠错等级;
@@ -121,12 +96,9 @@ myqr https://github.com -v 10 -l Q
12196

12297
`-l` 控制纠错水平,范围是**L、M、Q、H**,从左到右依次升高。
12398

124-
125-
126-
12799
```markdown
128100
#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/
130102
```
131103

132104
- **默认输出文件名**是“ qrcode.png ",而**默认存储位置**是当前目录。
@@ -137,68 +109,46 @@ myqr https://github.com -n github_qr.jpg -d .../paths/
137109

138110
`-d` 控制位置。
139111

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+
#### 艺术二维码
150113

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)
151115

152116
```markdown
153117
#1 -p
154-
myqr https://github.com -p github.jpg
118+
amzqr https://github.com -p github.jpg
155119
```
156120

157121
* 参数`-p` 用来将QR二维码图像与一张同目录下的图片相结合,产生一张**黑白**图片。
158122

159-
160-
161-
162-
163-
164123
```markdown
165124
#2 -c
166-
myqr https://github.com -p github.jpg -c
125+
amzqr https://github.com -p github.jpg -c
167126
```
168127

169128
* 加上参数 `-c` 可以使产生的图片由黑白变为**彩色**的。
170129

171-
172-
173-
174-
175130
```markdown
176131
#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
178133
```
179134

180135
* 参数`-con` 用以调节图片的**对比度**,1.0 表示原始图片,更小的值表示更低对比度,更大反之。**默认为1.0**
181136

182137
* 参数 `-bri` 用来调节图片的**亮度**,其余用法和取值与 `-con` 相同。
183138

184-
185-
186-
187139
#### 动态GIF二维码
188140

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)
190142

191143
动态二维码与上述的带图片的二维码的生成方法没什么区别,你只要采用 `.gif` 格式的图片即可生成黑白或者彩色的动态二维码。但**注意**如果使用了 `-n` 参数自定义输出的文件名,切记其格式也必须是 `.gif` 格式。
192144

193-
194-
195145
### 作为导入文件
196146

197147
```python
198148
# 安装模块后
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,
202152
version=1,
203153
level='H',
204154
picture=None,
@@ -207,16 +157,13 @@ version, level, qr_name = myqr.run(
207157
brightness=1.0,
208158
save_name=None,
209159
save_dir=os.getcwd()
210-
)
160+
)
211161
```
212162

213-
214-
215163
*以下各个参数已经在[上文](#命令行方式)有所介绍*
216164

217-
218165
```python
219-
# help(myqr)
166+
# help(amzqr)
220167
Positional parameter
221168
words: str
222169

@@ -230,23 +177,15 @@ Optional parameters
230177
save_name: str, the output filename like 'example.png'
231178
save_dir: str, the output directory
232179
```
233-
234-
235-
236-
237-
238180
## 使用提示
239181

240182
* 请采用**正方形**或近似正方形的图片
241183

242184
* 建议在图片尺寸大的时候使用 `-v` 的值也应该**适当**变大。
243185

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)
249187

188+
你可以将透明部分修改成白色,最终效果会变成![](https://github.com/x-hw/amazing-qr/blob/master/example/a0.png)
250189

251190
## 可用字符
252191

@@ -260,32 +199,26 @@ Optional parameters
260199
· , . : ; + - * / \ ~ ! @ # $ % ^ & ` ' = < > [ ] ( ) ? _ { } | and (space)
261200
```
262201

202+
## 环境
263203

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
273205

206+
## 协议
274207

275-
***提示**:如果没有安装 [**MyQR**](https://pypi.python.org/pypi/MyQR) ,使用命令`pip install -r requirements.txt` 来安装所有依赖的库。)*
208+
* GPLv3
276209

277-
210+
## 打赏杯咖啡
278211

279-
## 运行环境
212+
[![GitHub Sponsors](https://img.shields.io/github/sponsors/x-hw?logo=github-sponsors&labelColor=pink&color=white)](https://github.com/sponsors#regions)
280213

281-
* Linux, Python 3
282-
* Windows, Python 3
283-
* Mac, Python 3
214+
*GitHub Sponsors 还用不了...*
284215

216+
![wechatpay](https://img.shields.io/badge/-微信打赏-brightgreen?labelColor=brightgreen&logo=data:image/png;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAQAABILAAASCwAAAAAAAAAAAAAAAAAAGa0aABmtGg4ZrRoOGa0aABmtGgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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Rr/Ga0a/xmtGv8ZrRr/Ga0a/xmtGv8ZrRr/Ga0a1BmtGiwZrRoAGa0aABmtGgAZrRowGa0arRmtGvQZrRr/Ga0a/xmtGv8ZrRr/Ga0a/xmtGv8ZrRr2Ga0asRmtGjQZrRoAGa0aAAAAAAAZrRoAGa0aABmtGgsZrRpFGa0ajRmtGrsZrRrPGa0azxmtGr0ZrRqQGa0aSBmtGgwZrRoAGa0aAAAAAAAAAAAAAAAAAAAAAAAAAAAAGa0aABmtGgEZrRoKGa0aFBmtGhUZrRoKGa0aARmtGgAAAAAAAAAAAAAAAAAAAAAAz/8AAMAPAADAAwAAgAEAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAgAEAAMADAADgBwAA+B8AAA==)
285217

286-
218+
<img src="https://github.com/x-hw/amazing-qr/blob/master/example/wechatpay.jpg" width = "124" height = "116" alt="wechatpay" align=center />
287219

220+
![alipay](https://img.shields.io/badge/-支付宝打赏-blue?logo=alipay&logoColor=ffffff&labelColor=blue)
288221

289-
## 协议
222+
<img src="https://github.com/x-hw/amazing-qr/blob/master/example/alipay.gif" width = "132" height = "132" alt="alipay" align=center />
290223

291-
* GPLv3
224+
🎉🎉🎉 感谢你的支持 🎉🎉🎉

0 commit comments

Comments
 (0)