mnooner256 / pyqrcode

Python 3 module to generate QR Codes
BSD 3-Clause "New" or "Revised" License
410 stars 76 forks source link

Is there any way to import logo in the center of qr code? #58

Open nipungarg59 opened 7 years ago

nipungarg59 commented 7 years ago

Here is the link to stackoverflow question.

heuer commented 7 years ago

No, that's beyond the scope of this project, I'd think.

You can use the generated QR Code and modify it with an application or use (in case of PNG) https://pypi.python.org/pypi/Pillow to modify it with Python.

nipungarg59 commented 7 years ago

Thanks tried this and its working, I will be contributing this feature soon to this repo.

heuer commented 7 years ago

Thanks tried this and its working, I will be contributing this feature soon to this repo.

Well, that may create a depencency on Pillow / PIL. IMO that's against the goal of this project "(almost) no dependencies". But your solution may be interesting for others.

BTW: You don't have to create a file. Use io.BytesIO and write the data into a memory buffer. Pillow should work with the buffer as well.

nipungarg59 commented 7 years ago

Okay Thanks Will try that for sure!!

mfrasca commented 6 years ago

I'm curious, not so much about the final step of placing whatever image on top of the QR code, but the whole idea that the code would still work after being "defaced" ( :wink: ) this way. It only works because of redundancy in the QR code, isn't it so? Can you calculate the amount of necessary error correction, given the size of the hole you already plan to cut in the resulting QR code?

mfrasca commented 6 years ago

what about being able to produce things like this? image https://research.swtch.com/qr/draw

tobiasherp commented 4 years ago

FYI, I have a little project for a commandline tool which injects the Plone logo into the SVG code via lxml. I'm willing to generalize it once version 1.0 is released.

06parv commented 3 years ago

Is there any way to import the logo in the center of SVG qr code