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.

  • ChaoticNeutralCzech@feddit.org
    link
    fedilink
    English
    arrow-up
    4
    ·
    edit-2
    3 days 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 and tell the reader which coefficients to use in the error correction equation and how far a solution could be. The percentage is approximate and pertains to full bytes, not bits. 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
    link
    fedilink
    English
    arrow-up
    3
    ·
    4 days 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.

    • evenwicht@lemmy.sdf.orgOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      edit-2
      2 days ago

      I’m so tired of overly busy qr codes.

      I’m tired of having to search through text to get enough of an idea of what a QR code is before I go to the trouble of pulling out a scanner. Is it an URL? Wi-Fi creds? It’s not about being cute. It’s about being informative in as little space as possible. Do you scan a naked QR code without cause? Street wise users want an indication of what they are scanning in the very least.

      It should also be noted that the QR code pixels will get smaller and smaller the more data you’re encoding.

      You have control over that. If you want to hold the pixel size constant, the qr code’s geometry gets bigger. The qrcode LaTeX pkg includes a size parameter. Either way, up to 30% of the space could be wasted, depending on the use case.

      QR codes have countless applications. Not all QR codes need to be scanned from the other side of a room. When a QR code appears on a document that someone is holding, as opposed to a sign, it only needs to function within 10cm. I’m working on 2-column bilingal legal documents citing laws from different countries. There is insufficient space for country indicators and 30% of the QR code is just wasted space in this context, which really adds up of you have many QR codes. In a corner case, flaws from multiple generations of photocopies could manifest but 30% redundancy is overkill. So putting the country indicator for the law being referenced inside the QR code makes the most efficient use of page real estate without resorting to poor aesthetics.

      Also, QR codes are ugly. I’m happy to see creative people dress them up. Of course there is only room for clever artists in this space and easy for kids making qr codes to get carried away.