-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
75 changed files
with
1,658 additions
and
417 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 4 | ||
insert_final_newline = true | ||
end_of_line = lf | ||
charset = utf-8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
*.pyc | ||
.coverage | ||
.tox | ||
.idea | ||
.[nt]ox/ | ||
.idea/ | ||
*.egg-info | ||
htmlcov/* | ||
dist/* | ||
build/* | ||
venv/* | ||
dist/ | ||
build/ | ||
venv/ | ||
sandbox/out/*.svg | ||
sandbox/out/*.png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
Artistic QR Codes | ||
================= | ||
|
||
Segno focuses on creating (Micro) QR codes and offers many | ||
:ref:`output formats <serializers>` without additional dependencies on other | ||
libraries. | ||
|
||
Advanced graphic operations require the `qrcode-artistic <https://pypi.org/project/qrcode-artistic/>`_ | ||
plug-in, which in turn depends on the `Pillow <https://pypi.org/project/Pillow/>`_ library. | ||
|
||
The plugin can be used to create animated QR codes or static QR codes with a | ||
background image. | ||
|
||
To install the plugin, use:: | ||
|
||
pip install qrcode-artistic | ||
|
||
After that, every QR code created with :py:func:`segno.make` has two additional | ||
methods "to_pil" and "to_artistic". | ||
|
||
The former returns a Pillow `Image <https://pillow.readthedocs.io/en/stable/reference/Image.html>`_ | ||
instance, which can be used for further manipulations (e.g. rotating the QR code). | ||
|
||
.. code-block:: python | ||
>>> import segno | ||
>>> qr = segno.make('Yellow Submarine', error='h') | ||
>>> img = qr.to_pil(scale=3).rotate(45, expand=True) | ||
>>> img.save('yellow-submarine-rotated.png') | ||
.. image:: _static/artistic/yellow-submarine-rotated.png | ||
:alt: Colorful 3-H QR code encoding "Yellow Submarine" rotated by 45° | ||
|
||
The "to_pil" method provides all options of :doc:`colorful-qrcodes`. | ||
|
||
.. code-block:: python | ||
>>> import segno | ||
>>> qr = segno.make('Yellow Submarine', error='h') | ||
>>> img = qr.to_pil(scale=4, dark='darkred', data_dark='darkorange', | ||
data_light='yellow') | ||
>>> img.save('yellow-submarine.png') | ||
.. image:: _static/artistic/yellow-submarine.png | ||
:alt: Colorful 3-H QR code encoding "Yellow Submarine" | ||
|
||
|
||
The "to_artistic" method can create animated or static QR codes. | ||
|
||
.. code-block:: python | ||
>>> import segno | ||
>>> qr = segno.make('The Beatles -- Albums', error='h') | ||
>>> qr.to_artistic(background='src/albums.gif'), target='albums.gif' scale=8) | ||
.. image:: _static/artistic/albums.gif | ||
:alt: 3-H QR code encoding "The Beatles -- Albums" (animated) | ||
|
||
|
||
If the Pillow installation supports animated WebP images the plugin can | ||
save animated WebP images as well. | ||
|
||
.. code-block:: python | ||
>>> import segno | ||
>>> qr = segno.make('The Beatles -- Abbey Road', error='h') | ||
>>> qr.to_artistic(background='src/abbey-road-walking.gif', target='abbey-road.webp' scale=4) | ||
.. image:: _static/artistic/abbey-road.webp | ||
:alt: 4-H QR code encoding "The Beatles -- Abbey Road" (animated) | ||
|
||
|
||
The plugin also supports static backgrounds | ||
|
||
.. code-block:: python | ||
>>> import segno | ||
>>> qr = segno.make('The Beatles -- Let It Be', error='h') | ||
>>> qr.to_artistic(background='src/letitbe.jpg', target='letitbe.jpg' scale=5) | ||
.. image:: _static/artistic/letitbe.jpg | ||
:alt: 3-H QR code encoding "The Beatles -- Let It Be" with a background image | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.