diff --git a/README.md b/README.md index f246809..5446992 100644 --- a/README.md +++ b/README.md @@ -5,31 +5,109 @@ ## Example 示例 -```console -python myqrcode.py -l H https://github.com/sylnsfar/QR-Code -``` +![](https://github.com/sylnsfar/QR-Code/blob/master/example/qrs0.jpg) -![](https://github.com/sylnsfar/QR-Code/blob/master/example/qrs.jpg)![](https://github.com/sylnsfar/QR-Code/blob/master/example/riven.png) +![](https://github.com/sylnsfar/QR-Code/blob/master/example/qrs1.jpg) + +![](https://github.com/sylnsfar/QR-Code/blob/master/example/qrs2.jpg) ## 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` diff --git a/example/flash0.jpg b/example/flash0.jpg new file mode 100644 index 0000000..a607ca1 Binary files /dev/null and b/example/flash0.jpg differ diff --git a/example/flash_qrcode 1.jpg b/example/flash_qrcode 1.jpg deleted file mode 100644 index cc0bf46..0000000 Binary files a/example/flash_qrcode 1.jpg and /dev/null differ diff --git a/example/flash_qrcode.jpg b/example/flash_qrcode.jpg deleted file mode 100644 index e36903b..0000000 Binary files a/example/flash_qrcode.jpg and /dev/null differ diff --git a/example/flash_qrcode1.jpg b/example/flash_qrcode1.jpg new file mode 100644 index 0000000..1e46045 Binary files /dev/null and b/example/flash_qrcode1.jpg differ diff --git a/example/flash_qrcode2.jpg b/example/flash_qrcode2.jpg new file mode 100644 index 0000000..a999577 Binary files /dev/null and b/example/flash_qrcode2.jpg differ diff --git a/example/github.png b/example/github.png new file mode 100644 index 0000000..35dcbed Binary files /dev/null and b/example/github.png differ diff --git a/example/github0.jpg b/example/github0.jpg new file mode 100644 index 0000000..454f316 Binary files /dev/null and b/example/github0.jpg differ diff --git a/example/github_qrcode1.jpg b/example/github_qrcode1.jpg new file mode 100644 index 0000000..3fd9969 Binary files /dev/null and b/example/github_qrcode1.jpg differ diff --git a/example/github_qrcode2.jpg b/example/github_qrcode2.jpg new file mode 100644 index 0000000..16e8f6f Binary files /dev/null and b/example/github_qrcode2.jpg differ diff --git a/example/qrs.jpg b/example/qrs.jpg deleted file mode 100644 index 805cfe5..0000000 Binary files a/example/qrs.jpg and /dev/null differ diff --git a/example/qrs0.jpg b/example/qrs0.jpg new file mode 100644 index 0000000..9b0f234 Binary files /dev/null and b/example/qrs0.jpg differ diff --git a/example/qrs1.jpg b/example/qrs1.jpg new file mode 100644 index 0000000..bb8f628 Binary files /dev/null and b/example/qrs1.jpg differ diff --git a/example/qrs2.jpg b/example/qrs2.jpg new file mode 100644 index 0000000..a4e7485 Binary files /dev/null and b/example/qrs2.jpg differ diff --git a/example/riven0.jpg b/example/riven0.jpg new file mode 100644 index 0000000..19f8e75 Binary files /dev/null and b/example/riven0.jpg differ diff --git a/example/riven_qrcode.jpg b/example/riven_qrcode.jpg deleted file mode 100644 index 36681c7..0000000 Binary files a/example/riven_qrcode.jpg and /dev/null differ diff --git a/example/riven_qrcode1.jpg b/example/riven_qrcode1.jpg new file mode 100644 index 0000000..7ddbab0 Binary files /dev/null and b/example/riven_qrcode1.jpg differ diff --git a/example/riven_qrcode2.jpg b/example/riven_qrcode2.jpg new file mode 100644 index 0000000..ae009ea Binary files /dev/null and b/example/riven_qrcode2.jpg differ diff --git a/example/zootopia.png b/example/zootopia.png new file mode 100644 index 0000000..501bc31 Binary files /dev/null and b/example/zootopia.png differ diff --git a/example/zootopia0.jpg b/example/zootopia0.jpg new file mode 100644 index 0000000..b9302a4 Binary files /dev/null and b/example/zootopia0.jpg differ diff --git a/example/zootopia_qrcode1.jpg b/example/zootopia_qrcode1.jpg new file mode 100644 index 0000000..8913e5f Binary files /dev/null and b/example/zootopia_qrcode1.jpg differ diff --git a/example/zootopia_qrcode2.jpg b/example/zootopia_qrcode2.jpg new file mode 100644 index 0000000..8e75666 Binary files /dev/null and b/example/zootopia_qrcode2.jpg differ