0

I am looking for a library to use to generate a QR code that contains email contact details with a logo in the centre. It seems Segno seems to be quite popular and has the ability to create artistic QR codes, however, I can't seem to find any examples of a simple QR with a logo in the centre.

I've generated a few POC QR codes containing the relevant email data and it looks perfect, anyone have any idea if segno supports adding a logo in the centre?

Example Basic Email QR

from segno import helpers

qrcode = helpers.make_mecard(name='Doe,John', email='me@example.org', phone='+1234567')
# Some params accept multiple values, like email, phone, url
qrcode = helpers.make_mecard(name='Doe,John',email=('me@example.org', 'another@example.org'),url=['http://www.example.org', 'https://example.org/~joe'])
qrcode.save('emailCode.svg', scale=4)
iNoob
  • 1,375
  • 3
  • 19
  • 47

2 Answers2

0

I don't know how to do this with segno to be honest, but you can easily embbed a logo inside a QRcode using the pyqrcode library like this stack overflow post or using the qrcode library like this geeksforgeeks tutorial.

robinood
  • 1,138
  • 8
  • 16
  • Thanks for the response, I have taken a look at both of those and I didn't see any options for email contact details. I will run my eye over them both again, just in case I missed something. – iNoob Oct 19 '22 at 12:39
  • My bad, I was focused on the logo part and not on the email details one. Let me have a look and see how I can edit my answer. – robinood Oct 19 '22 at 12:43
0

An example of how to create a QR code with a logo image in the center can be found here in the segno doc: https://segno.readthedocs.io/en/latest/pillow-qrcodes.html

I found I had to make the logo slightly smaller than what the example does in order for my phone to decode the resulting QR code image (since the logo overlays part of the code). Changing the divisor from 3 to 3.5 when computing max_logo_size did the trick for me.

randulfir
  • 71
  • 8