![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
This Segno <https://github.com/heuer/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.
Usage:
.. code-block:: python
>>> import segno
>>> qr = segno.make("One, two, three, four, one, two"
"Let me tell you how it will be"
"There's one for you, nineteen for me")
>>> img = qr.to_pil() # Greyscale image, default scale
>>> img.save('example.png')
>>> qr.to_pil(scale=10).show() # Show img with scale 10
>>> # Different scale
>>> img = qr.to_pil(scale=3)
>>> img.save('example-2.png')
>>> # Different scale and change module color
>>> img = qr.to_pil(scale=3, dark='darkblue')
>>> img.save('example-3.png')
>>> # Different scale and change dark and light module colors
>>> img = qr.to_pil(scale=3, dark='#36c', light=None)
>>> img.save('example-4.png')
>>> # Invert the example above
>>> img = qr.to_pil(scale=3, dark=None, light='#36c')
>>> img.save('example-5.png')
>>> # Save JPEG
>>> qr.to_pil(scale=3, dark='#36c', light='yellow').convert('RGB').save('example-6.jpg')
>>> rotated_img = img.rotate(3, expand=True)
>>> rotated_img.convert('RGB').save('example-7.jpg')
>>> # Multiple module colors
>>> qr = segno.make('Yellow Submarine', version=7, error='h')
>>> img = qr.to_pil(scale=4, dark='darkred', data_dark='darkorange',
data_light='yellow')
>>> img.save('yellow-submarine.png')
Support for multiple module colors
Support for Segno's API >= 1.0.0
API breaking changes:
FAQs
PIL/Pillow plugin for the Segno (Micro) QR Code generator
We found that segno-pil demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.