update
104
README.md
@ -5,31 +5,109 @@
|
||||
|
||||
## Example 示例
|
||||
|
||||
```console
|
||||
python myqrcode.py -l H https://github.com/sylnsfar/QR-Code
|
||||
```
|
||||

|
||||
|
||||

|
||||

|
||||
|
||||

|
||||
|
||||
## Usage 用法
|
||||
|
||||
```con
|
||||
python myqrcode.py [-l [L,M,Q,H]] xxxxxx
|
||||
### Common QR-Code 普通QR二维码
|
||||
|
||||
```
|
||||
python myqr.py [-h]
|
||||
[-v {1,2,3,...,40}]
|
||||
[-l {L,M,Q,H}]
|
||||
Words
|
||||
```
|
||||
|
||||
* The `myqrcode.py` is the main file.
|
||||
* Use argument `-h` for help.
|
||||
|
||||
`myqrcode.py` 是主文件。
|
||||
使用参数 `-h` 来获得使用帮助。
|
||||
|
||||
* Argument `-l` or `--level` means the Error Correction Level: L(Low), M(Medium), Q(Quartile) and H(High). **The default level is Q**, so that you can just `python myqrcode.py xxxxxxx` .
|
||||
|
||||
|
||||
参数`-l` 或者`--level` 代表纠错等级:L、M、Q 和 H(从低到高)。默认使用的等级是 Q,所以可以直接`python myqrcode.py xxxxx` 。
|
||||
|
||||
* `xxxxxx` is the words that you are putting into a QR-Code. You can write a URL or a sentence.
|
||||
```console
|
||||
python myqr.py https://github.com
|
||||
```
|
||||
|
||||
`xxxxxx` 代表要生成 QR 二维码的信息,可以是一个链接地址,也可以是其它字符串。
|
||||
* **Simplest way**: Just input a URL or a sentence, then get your QR-Code in the current directory.
|
||||
|
||||
## Supported 可用字符
|
||||
**最简单的用法**:在命令后输入链接或者句子作为参数,然后在程序的当前目录中产生相应的QR二维码图片。
|
||||
|
||||
|
||||
|
||||
```console
|
||||
python myqr.py https://github.com -v 10 -l Q
|
||||
```
|
||||
|
||||
* The **default** length of a side of QR-Code depends on both the numbers of words you input. And the **default** level (Error Correction Level) is **H** (the highest).
|
||||
|
||||
默认边长是取决于你输入的信息的长度,而默认纠错等级是最高级的H。
|
||||
|
||||
* **Customize size**: If you want to control the length and the error-correction-level, use the `-v` and `-l` arguments. The `-v` representing the length is from 1 to 40 that 1 means minimum and 40 means maximum. The `-l` representing the level is one of L, M, Q and H that L means lowest and H means highest.
|
||||
|
||||
**自定义尺寸**:如果想要控制边长和纠错水平就使用 `-v` 和 `-l` 参数。使用 `-v` 来控制边长,范围是1至40,数字越大边长越大;使用 `-l` 来控制纠错水平,范围是L、M、Q、H,从左到右依次升高。
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
### Artistic QR-Code 艺术QR二维码
|
||||
|
||||
python myqr.py [-h]
|
||||
[-v {1,2,3,...,40}]
|
||||
[-l {L,M,Q,H}]
|
||||
[-p picture_file]
|
||||
[-c]
|
||||
[-con contrast]
|
||||
[-bri birghtness]
|
||||
Words
|
||||
* arguments `-h`, `-v` and `-l` is as mentioned above.
|
||||
|
||||
参数 `-h`, `-v` 和 `-l` 如上文述。
|
||||
|
||||
|
||||
|
||||
```console
|
||||
python myqr.py https://github.com -p github.jpg
|
||||
```
|
||||
|
||||
* The `-p` is to combine the QR-Code with the following picture which is at the same directory as the program. The resulting picture is **black and white** by default.
|
||||
|
||||
参数`-p` 用来将QR二维码图像与一张同目录下的图片相结合,产生一张黑白图片。
|
||||
|
||||
* Suggestion: If the size of the picture is large, you should choose a correct large `-v` too instead of using the default one.
|
||||
|
||||
建议在图片尺寸大的时候使用 `-v` 的值也应该适当变大。
|
||||
|
||||
|
||||
|
||||
```console
|
||||
python myqr.py https://github.com -p github.jpg -c
|
||||
```
|
||||
|
||||
* The `-c` is to make the resulting picture colorized.
|
||||
|
||||
加上参数 `-c` 可以使产生的图片由黑白变为彩色的。
|
||||
|
||||
|
||||
|
||||
```console
|
||||
python myqr.py https://github.com -p github.jpg [-c] -con 1.5 -bri 1.6
|
||||
```
|
||||
|
||||
* The `-con` changes the contrast of the picture that 1.0 means original image, lower values mean less contrast and higher mean more. Default: 1.0.
|
||||
|
||||
参数`-con` 用以调节图片的对比度,1.0 表示原始图片,更小的值表示更低对比度,更大反之。默认为1.0。
|
||||
|
||||
* The `-bri` changes the brightness and the value is just like `-con`'s.
|
||||
|
||||
参数 `-bri` 用来调节图片的亮度,其余用法和取值与 `-con` 相同。
|
||||
|
||||
## Supported Characters 可用字符
|
||||
|
||||
* Numbers: `0~9`
|
||||
|
||||
|
BIN
example/flash0.jpg
Normal file
After Width: | Height: | Size: 74 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 19 KiB |
BIN
example/flash_qrcode1.jpg
Normal file
After Width: | Height: | Size: 49 KiB |
BIN
example/flash_qrcode2.jpg
Normal file
After Width: | Height: | Size: 59 KiB |
BIN
example/github.png
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
example/github0.jpg
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
example/github_qrcode1.jpg
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
example/github_qrcode2.jpg
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
example/qrs.jpg
Before Width: | Height: | Size: 54 KiB |
BIN
example/qrs0.jpg
Normal file
After Width: | Height: | Size: 150 KiB |
BIN
example/qrs1.jpg
Normal file
After Width: | Height: | Size: 207 KiB |
BIN
example/qrs2.jpg
Normal file
After Width: | Height: | Size: 178 KiB |
BIN
example/riven0.jpg
Normal file
After Width: | Height: | Size: 75 KiB |
Before Width: | Height: | Size: 18 KiB |
BIN
example/riven_qrcode1.jpg
Normal file
After Width: | Height: | Size: 52 KiB |
BIN
example/riven_qrcode2.jpg
Normal file
After Width: | Height: | Size: 55 KiB |
BIN
example/zootopia.png
Normal file
After Width: | Height: | Size: 161 KiB |
BIN
example/zootopia0.jpg
Normal file
After Width: | Height: | Size: 41 KiB |
BIN
example/zootopia_qrcode1.jpg
Normal file
After Width: | Height: | Size: 31 KiB |
BIN
example/zootopia_qrcode2.jpg
Normal file
After Width: | Height: | Size: 27 KiB |