创建与图像合并的二维码。

prettyqr的Python项目详细描述


创建与图像合并的二维码。

安装

pip install prettyqr

你需要Pythonpip

示例用法

拍摄背景图像:

Original image

以及URL或其他文本:

foo.com

组合它们:

prettyqr --qr-opacity 150 --outfile img/dna-qr.png foo.com img/dna-orig.png
QR code image

命令行选项

usage: prettyqr [-h] [--border BORDER] [--out-file OUT_FILE]
                [--qr-opacity QR_OPACITY] [--qr-red QR_RED]
                [--qr-green QR_GREEN] [--qr-blue QR_BLUE]
                DATA IMAGE-FILE

Make pretty QR codes.

positional arguments:
  DATA                  Data to encode (e.g., "http://example.com").
  IMAGE-FILE            Image file to composite (e.g., "lena.jpg").

optional arguments:
  -h, --help            show this help message and exit
  --border BORDER       Size of border (in multiples of QR module size).
                        Defaults to 4. Can be zero if the QR code is intended
                        for printing or use on a light background.
  --out-file OUT_FILE   Path to write composite image file to. Extension will
                        determine the output format. Defaults to
                        "prettyqr.png".
  --qr-opacity QR_OPACITY
                        Opacity of the QR code modules, between 0 (invisible)
                        and 255 (opaque). Default is 200.
  --qr-red QR_RED       Red element of the QR module color, between 0 and 255.
                        Default is 0.
  --qr-green QR_GREEN   Green element of the QR module color, between 0 and
                        255. Default is 0.
  --qr-blue QR_BLUE     Blue element of the QR module color, between 0 and
                        255. Default is 0.

限制

prettyqr是一个相当原始的概念证明,目前有一个 各种限制:

  • 仅支持方形图像。
  • 仅支持方形QR模块。
  • 不支持源图像中的复杂颜色更改。

它将在图像焦点不在的情况下最有效 中央的,而且不能很好地处理黑色背景。

所有这些问题都相当容易处理;欢迎使用补丁程序。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java能否使用OpenJPA将一个实体持久化到多个持久化单元?   java如何访问当前按下的键   java singleton是否意味着哈希代码总是返回相同的值?   inputstream无法在Java中同时使用STDIN和STDERR读取程序输出   java运行时有多贵。getRuntime()与获取内存度量相结合   java AndroidStudio ListView适配器更新   java小程序请求未扩展实时会话   java是设置布尔值所必需的关键部分?   java比较两个字符串,并突出显示发现的不匹配项   java带抽屉布局,无论哪个屏幕处于活动状态,如何在按下后退键时关闭应用程序?   爪哇:颜色有什么区别。黑色和彩色。黑色   Velocity模板中子类的java访问方法   java如何快速学习Drools或其他规则引擎   从Java应用程序访问时缓存数据库查询结果   java cassandra nodetool JPLISAgent。c错误   java我正在解析一个没有pubDate的RSS提要,有没有其他方法可以确定一个项目是何时发布的?