This is actually an upscaled work in progress, not finished yet, but I’m working on templates for a future tattoo.

Yes that’s hand drawn. Yes it’s already scannable…

  • Warl0k3@lemmy.world
    link
    fedilink
    arrow-up
    17
    ·
    5 days ago

    Yeah the QR standard is astoundingly resilient to noise. iirc the highest redundancy can still be read with 60% of the glyph obscured, it’s really a fascinating protocol.

    • ChaoticNeutralCzech@feddit.org
      link
      fedilink
      English
      arrow-up
      12
      ·
      edit-2
      4 days ago

      Nah, it’s 30%, and very much depends on how the damage is laid out.

      QR structure

      • The corner squares (finder patterns) must keep a ⬜⬛⬜⬛⬛⬛⬜⬛⬜ cross-section at most angles. Most readers will accept even round ones. This applies to the smaller squares (alignment patterns) on larger QR codes too.
      • The zebra strips ⬛⬜⬛⬜⬛ (“timing patterns” if you’re a nerd) connecting the finder patterns must remain intact. Very few readers can correct for errors in that.
      • At this point, a good reader will be able to detect the QR code’s position in the image and its resolution (“version” if you consume ISO propaganda), and thus calculate the location of every pixel (“element”, ditto). Each of those will usually be sampled at a radius of around ⅓ of the distance between them. This allows for slightly wavy codes but also codes with rounded pixels or even unrelated content in the edges. (For the record, this is lazy and I prefer this version of the concept that uses almost up-to-spec QR codes.) Google Lens is more sophisticated than just using a 3D perspective transform, as I already mentioned.
      • One line of pixels around finder patterns is necessary for decoding (mask and ECC level info) and has basically no error correction so it should be also clear except the ⅓²=⅑ trick described above.
      • The data is stored with robust Reed-Solomon correction, which is bytewise. You can safely cover about half of the advertised recoverable area with contiguous damage anywhere except the sections mentioned above. Still, you can damage more area (and reach the advertised percentage) by taking several things into account:
        • Know how the data is laid out in the specific QR resolution, and keep in mind that Reed-Solomon is bytewise. Thus, you want to damage as few bytes as possible, and for most total area, the strategy is to ruin all 8 bits in each. Without deeper analysis (looking up the byte layout), a good rule of thumb is that vertical damage aligned to an even number of columns from the right (skipping Column 7 with the vertical zebra stripe and thus no data) is likely to ruin the least amount of bytes partially.
          • Looking up the byte layout will also reveal that there are probably 1-7 unused pixels in the leftmost two columns (marked “X” in the image), probably arranged like ⡿ in the very top of the data portion (Row 10 and below) or ​⣷ in the very bottom (Row 9 from last anď above). These can be damaged without consequence!
        • Damage whose very dark spots line up with original black pixels (and vice versa) does not really count. Keep in mind that while using this strict definition of damage results in way fewer damaged bits, those are most likely not contiguous, so only a few 8-bit bytes will remain intact through this.
      • Warl0k3@lemmy.world
        link
        fedilink
        arrow-up
        4
        ·
        4 days ago

        This is fascinating, thank you so much! I knew about image emebdding in the pixels themselves, it was slightly trendy back in the day, but I had no idea people had progressed it to animation like in the second video.

    • FishFace@lemmy.world
      link
      fedilink
      arrow-up
      4
      ·
      5 days ago

      With hand drawn codes it’s also that the scanners are very good. It’s no good having high redundancy if the scanner can’t transform the 3D code to a square and find the timing bits etc