heuer / qrcode-artistic Goto Github PK
View Code? Open in Web Editor NEWSegno plugin to convert (Micro) QR Codes to Pillow/PIL
License: BSD 3-Clause "New" or "Revised" License
Segno plugin to convert (Micro) QR Codes to Pillow/PIL
License: BSD 3-Clause "New" or "Revised" License
qrcode-artistic
depends on segno
and Pillow
, but they aren’t listed in the setup.cfg.
I.e. use dark
/ light
instead of color
/ background
With the main module i can do something like this:
buff = io.BytesIO()
segno.make_qr("Some input").save(buff, kind="png", border=1, scale=10)
buff.getvalue()
Is there a way to do that also with artistic qr-codes?
See heuer/segno#28
Hi! I think there's an infinite loop in to_artistic()
when scale is a float. Example:
>>> qr.to_artistic(background='whatever.png', target='qr.png', scale=4.5)
^CTraceback (most recent call last):
File "<stdin>", line 1, in <module>
File ".../.direnv/python-3.10.4/lib/python3.10/site-packages/qrcode_artistic.py", line 134, in write_artistic
while scale % 3:
KeyboardInterrupt
I'm using qrcode-artistic==2.1.0, segno==1.5.2
I think this is happening here:
https://github.com/heuer/qrcode-artistic/blob/b93c548/qrcode_artistic.py#L140-L141
as you can see, this loops forever with any non-integer
>>> x = 4.5
>>> for i in range(20):
... print(x % 3)
... x += 1
...
1.5
2.5
0.5
1.5
2.5
0.5
is it reasonable to add a check before the loop which crashes if round(scale) != scale
? I'm happy to submit this PR if that's useful to you.
thanks for this library, I love the results
See heuer/segno#86
Hello,
When I create a QR code pointing to https://en.wikipedia.org/wiki/Main_Page with the scale set to 35 and with an image background using qrcode_artistic, the resulting QR image is very blurry even if the provided image is large.
If I use segno alone to create a simple QR, the resulting image is crisp.
This is the code:
image = 'firefoxLogo.png' qr = segno.make('https://en.wikipedia.org/wiki/Main_Page', micro=False) qrSimple = qr.save('outSimple.png', scale=35, border=1) qrArtistic = qr.to_artistic(background=image, border=1, target='outArtistic.png', scale=35)
In order to avoid scaling issues altogether (see #4), it would be great if vector images could be used as a backdrop (see https://en.wikipedia.org/wiki/File:Firefox_logo,_2019.svg).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.