Skip Navigation

The qrcodes pkg does not support embedding images or logos within a QR code. After investigating, it turns out logos are not even part of the QR code spec.

I was disappointed to see that the qrcode package gives no way to insert an image into the center of the QR code. But in fact it turns out that QR codes cannot be made to have an alternate center. QR codes are simply spec’d to have 30% redundancy. So you can simply overwrite up to 30% of a QR code arbitrarily and it will still decode as long as you don’t mess with the boxes on the 4 corners.

Also worth noting that you can exceed 30% interference if you play games with colors. That is, if a transparent pic uses sufficiently light colors that pass as white (in a black vs white dithering algo), then those pixels obviously don’t count in the 30% tolerance. So some quite clever work could exploit this to make a QR code look less like a pixel blob.

I guess the gripe that I have is that redundancy is fixed at 30% for all QR codes, IIUC.

In principle, we should be able to generate a code with 50% redundancy and then clobber up to 50% of it.

1

You're viewing a single thread.

1 comments