Metadata-Version: 2.0
Name: segno-pil
Version: 0.1.5
Summary: PIL/Pillow plugin for the Segno (Micro) QR Code generator
Home-page: https://github.com/heuer/segno-pil/
Author: Lars Heuer
Author-email: heuer@semagia.com
License: BSD
Keywords: QR Code,Micro QR Code,ISO/IEC 18004,ISO/IEC 18004:2006(E),ISO/IEC 18004:2015(E),PIL,Pillow
Platform: any
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Multimedia :: Graphics
Classifier: Topic :: Printing
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Utilities
Requires-Dist: Pillow
Requires-Dist: segno

Segno PIL -- Segno plugin for creating PIL/Pillow images from QR Codes
----------------------------------------------------------------------

This `Segno`_ plugin converts a (Micro) QR Code to a PIL/Pillow Image.

This plugin is not required to write PNG, EPS or PDF files. Segno's native
implementations usually generate smaller files in less time. This plugin
might be useful to modify the QR Codes (i.e. rotate or blur) or to save the
QR Codes in an image format which is not supported by Segno.

The resulting image is either a greyscale (PIL mode "1"), an indexed-color
image (PIL mode "P") or an RGBA image. The mode depends on the provided
(background) color values. The plugin chooses the optimal (minimal) mode
automatically. Use the ``mode`` parameter to enforce a specific mode. Mode "RGB"
is not supported, though.


Usage:

.. code-block:: python

    >>> import segno
    >>> qr = segno.make('Hello world')
    >>> pil_img = qr.to_pil()  # Greyscale image, default scale
    >>> pil_img.save('example.png')
    >>> qr.to_pil(scale=10).show()  # Show img with scale 10
    >>> # Different scale
    >>> pil_img = qr.to_pil(scale=10)
    >>> pil_img.save('example-2.png')
    >>> # Different scale and change module color
    >>> pil_img = qr.to_pil(scale=10, color='darkblue')  # Indexed-color image
    >>> pil_img.save('example-3.png')
    >>> # Different scale and change module color and transparent background
    >>> pil_img = qr.to_pil(scale=10, color='#36c', background=None)
    >>> # transparency = 0 means that the first color in the palette should be
    >>> # transparent. The background color is ALWAYS the first entry in the palette
    >>> pil_img.save('example-4.png', transparency=0)
    >>> # Different scale and change module color and yellow background
    >>> # Enforce 'RGBA' mode since 'P' isn't supported by JPEG even if no color
    >>> # uses the alpha channel
    >>> qr.to_pil(scale=10, color='#36c', background='yellow', mode='RGBA').save('example-4.jpg')
    >>> rotated_img = pil_img.rotate(45, expand=True)
    >>> rotated_img.convert('RGB').save('example-5.jpg')


.. _Segno: https://github.com/heuer/segno

Changes
=======

0.1.5 -- 2016-08-24
-------------------
* Adapt Segno's 0.1.6 API changes.


0.1.4 -- 2016-08-16
-------------------
* Updated docs


0.1.3 -- 2016-08-14
-------------------
* Initial release


