Is there anything similar to a QR code that works offline?

Say I have a flyer that I want to discreetly distribute and there is no internet.

Is there something like a QR code that contains the data itself and not just a URL?

This way someone with no data plan could scan the icon/code with an app and the unrecognizable bits and bytes from the icon/code would show up on their screen as a .JPEG of a flyer or something.

  • Arthur Besse
    link
    fedilink
    162 years ago

    There are many types of QR code. iirc a single qrcode can contain up to a few kilobytes, but the more data you put in it the more difficult it will be to scan.

    so, you could use qrcodes for offline distribution of short text messages or very low resolution images. I think mobile devices’ qrcode scanners will display the contents of TEXT type qrcodes, but they probably don’t have support for decoding an image from one (so such an app would need to be written). you can create TEXT type qrcodes using the qrencode tool (packaged in major linux distros) or using websites like https://www.qr-code-generator.com/ (note that I think only their URL and TEXT types are offline; the others upload a file to their servers and make a qrcode containing a URL for it).

    This qrcode says “Hello”:

    This qrcode contains this 88x26 pixel (1467 byte) image:

    (created using cat lemmy.png |base64 |qrencode -o lemmy_qr.png; can be decoded using zbarimg lemmy_qr.png |sed 's/QR-Code://'|base64 -d > output.png. on debian/ubuntu you can apt install qrencode zbar-tools to get the two required commands.)

    • liwott
      link
      fedilink
      72 years ago

      I didn’t know there was an actual limit to the size of a QR code, but as we see a big problem with (raster) images is that the QR code rapidly becomes much more complex than the image itself

        • liwott
          link
          fedilink
          42 years ago

          I agreed a priori, which, as you probably guessed, is exactly why I put that parenthesis 😀 But I think in practice the starting point already is too complex. For example, I opened inkscape and saved the empty image, the result is already more than 1KB. Similarly, Lemmy’s very simple logo is already 3KB.

            • liwott
              link
              fedilink
              22 years ago

              Thanks for the clarification ! This indeed makes the code readable, although way more complex than the original logo. Also, not everyone has an app able to read that svg on their smartphone

    • @Gmork@lemmy.mlOP
      link
      fedilink
      42 years ago

      Awesome! Thanks for the in depth response and examples.

      I’ll have to see if I can successfully decode your lemmy picture when I get home to my computer.

      I learned alot today! Unfortunately I also learned that there are no ‘QR codes’ that can achieve the scope of what i wanted. 😭

        • @Gmork@lemmy.mlOP
          link
          fedilink
          32 years ago

          Think of a one-page flyer/poster JPEG that has textual information but also some bar graphs or pie charts to convey statistical information but discreetly disguised as a QR code.

          All of the data would be contained in the QR code. This way it could work indefinitely… Rather than the QR code containing a URL and loading up a website so you don’t have to worry about the website going offline or being censored. Not to mention websites can be tracked back to the owner. There are digital footprints.

          It appears that QR codes can do very limited textual information, but nothing to the scope of what I need.

          • Jonah
            link
            fedilink
            22 years ago

            From personal experience, the Cowboy Bebop opening text (around 700 characters) is the most I could fit on a QR code while still being able to print it and scan it with my phone, in case that helps.

            • @Gmork@lemmy.mlOP
              link
              fedilink
              22 years ago

              What do you mean the opening text? Like the credits? All the animator names and stuff?

              That is a decent amount of info. My issues so far has been the formatting of the text.

              I downloaded a new camera app that is geared towards QR scanning. Someone suggested it in this thread. Perhaps it would have better results and fewer issues with formatting.

              Thanks for the info!

      • Arthur Besse
        link
        fedilink
        4
        edit-2
        2 years ago

        you’re looking for steganography; I’m not aware of any steganographic constructions involving qrcodes, but there could be some. generally speaking, stego becomes practical in settings where there is unimportant high-entropy data which can be replaced with an encoding of the (typically encrypted) hidden message without altering the “cover” message in a detectable way. it might seem like this is the case with qrcodes due to the error correction; if you change a few random parts of the qrcode, due to the error correction it might still decode properly. However, this is probably easily detectable if the adversary has a high-resolution image of a candidate “maybe stego” qrcode: if decoding and re-encoding it produces a different qrcode, that would indicate that there had been extra data hidden in the error correction. (or, using a more advanced decoder than the typical ones, they could also simply see what the error rate is.)