Trimming the outer margin of qr codes
sinazadeh opened this issue · 3 comments
sinazadeh commented
sinazadeh commented
Or add the option to the output files of the Sengo library. I don't know which one is more possible.
heuer commented
It's already possible. Segno and this plugin supports a "border" keyword. If set to zero, the border / quiet zone is omitted:
>>> import segno
>>> qr = segno.make('Yellow Submarine')
>>> qr.save('yellow-submarine-border-zero.png', scale=4, border=0, dark='darkred', data_dark='darkorange', data_light='yellow')
>>> qr = segno.make('Yellow Submarine', version=7)
>>> qr.save('yellow-submarine7-border-zero.png', scale=4, border=0, dark='darkred', data_dark='darkorange', data_light='yellow')
The different parameters are also mentioned in the docs: https://segno.readthedocs.io/en/latest/serializers.html
heuer commented
Example using this plugin:
>>> import segno
>>> qr = segno.make('Yellow Submarine', version=7)
>>> pil_img = qr.to_pil(scale=4, border=0, dark='darkred', data_dark='darkorange', data_light='yellow')
>>> pil_img.save('yellow-submarine-pil.png')
The result should be the same as above