this post was submitted on 06 May 2025
8 points (100.0% liked)

TeX typesetting

179 readers
1 users here now

A place to share ideas, resources, tips, and hacks for Donald Knuths typesetting software TeX. All variants and formats like OpTeX, LaTeX and ConTeXt are welcome.

founded 2 years ago
MODERATORS
 

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.

top 2 comments
sorted by: hot top controversial new old
[–] ChaoticNeutralCzech@feddit.org 4 points 1 day ago* (last edited 1 day ago)

The spec allows only 4 error correction levels (L, M, Q, H) so no more than 30% redundancy. These are indicated as the first 2 bits below the left-top finder pattern. Also, non-data areas (finder patterns, as well as 1px stripes around the big finder patterns and between them) are not redundantly encoded so you have to be careful with those.

[–] Reddfugee42@lemmy.world 2 points 1 day ago

I'm so tired of overly busy qr codes. I don't need your logo, it doesn't need to be cute. I would much rather something that works more often and from greater distances than something that's cute.

It should also be noted that the QR code pixels will get smaller and smaller the more data you're encoding. People will encode 200 character urls that result in overly high resolution QR codes instead of just using something like tinyURL to generate a 10-15 character URL which generates an easily scanned QR code every time.