Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to add logo to qr codes

I am using zxing (java) to generate qr codes and want to know a method to add logo to the qr code. Is there any built in method for adding logo to it or any alternate for same.

like image 334
kakabali Avatar asked Feb 15 '23 13:02

kakabali


2 Answers

You will have to add an image overlay perhaps using another image library. I managed to find this resource that was able to do it. http://skrymerdev.wordpress.com/2012/09/22/qr-code-generation-with-zxing/

However I am certain you cannot add an image directly in the center of an QR code it will not allow the QR code to scan. You may be able to put a small one at the top.

enter image description here

like image 187
Joban Dhillon Avatar answered Feb 20 '23 09:02

Joban Dhillon


You can use set, setRegion and flip methods of output BitMatrix to change bits in output matrix, and add any (if you have a good error correction level) monochrome image in your output code, or you can export your BitMatrix to mutable Image and do whatever you want with Image.getGraphics(), which gives you built-in Graphics object where you can draw as usual, but don't forget to increase your ERROR_CORRECTION level.

like image 45
Pavlus Avatar answered Feb 20 '23 09:02

Pavlus