this post was submitted on 07 May 2022
16 points (100.0% liked)

Asklemmy

43939 readers
384 users here now

A loosely moderated place to ask open-ended questions

Search asklemmy πŸ”

If your post meets the following criteria, it's welcome here!

  1. Open-ended question
  2. Not offensive: at this point, we do not have the bandwidth to moderate overtly political discussions. Assume best intent and be excellent to each other.
  3. Not regarding using or support for Lemmy: context, see the list of support communities and tools for finding communities below
  4. Not ad nauseam inducing: please make sure it is a question that would be new to most members
  5. An actual topic of discussion

Looking for support?

Looking for a community?

~Icon~ ~by~ ~@Double_A@discuss.tchncs.de~

founded 5 years ago
MODERATORS
 

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.

all 39 comments
sorted by: hot top controversial new old
[–] cypherpunks@lemmy.ml 17 points 2 years ago (3 children)

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@nerdica.net 7 points 2 years ago (1 children)

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

[–] southerntofu@lemmy.ml 6 points 2 years ago (2 children)

Vector images can be a good fit though! If you can fit a URL in there, a SVG could fit in too :)

[–] Amicchan@lemmy.ml 4 points 2 years ago

Yep. It's another advantage of Vector Graphics.

[–] liwott@nerdica.net 4 points 2 years ago (1 children)

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.

[–] southerntofu@lemmy.ml 5 points 2 years ago (1 children)

SVGs can be minified after edition, but of course nothing will beat hand-crafted SVGs...

[–] liwott@nerdica.net 2 points 2 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.ml 5 points 2 years ago (2 children)

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. 😭

[–] Amicchan@lemmy.ml 3 points 2 years ago (1 children)

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

What did you want to do?

[–] Gmork@lemmy.ml 3 points 2 years ago (1 children)

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.

[–] jonahhw@lemmy.ml 2 points 2 years ago (1 children)

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.ml 2 points 2 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!

[–] roastpotatothief@lemmy.ml 3 points 2 years ago (1 children)

If it doesn't exist, then you can invent it.

QR codes are perfect for encoding text, even though most people just use them to send URLs. It should be a very good tool for flyers.

If you want rich text, colours and fonts and sizes, I'm sure that's easy too. But you might need to invent a type of markup to compress the style information better. Or it might already exist.

[–] Gmork@lemmy.ml 2 points 2 years ago (2 children)

That's just it though, it is very limited and has issues with even simple text. Tryp said in this thread that they had to download additional stuff in order to display the text in a QR code.

I had similar issues when scanning a text QR Code. Being a QR code, it opened my browser... Simple text was displayed in my search bar in linear fashion. So basic formatting of text to make an ASCII bar graph, for example is not possible.

Without basic formatting capabilities it's almost useless for my purpose, unfortunately.

[–] liwott@nerdica.net 1 points 2 years ago

Being a QR code, it opened my browser...

This is very much a problem with the app you use to scan rather than with the QR code itself.

[–] roastpotatothief@lemmy.ml 1 points 2 years ago* (last edited 2 years ago)

Do all QR code phone apps do that, or just the one? Maybe it's a setting in the app that you can turn off. You'd think the app would be clever enough to recognise whether the message is a URL or not, and treat it appropriately.

QR codes can often be ticket numbers or lists of information. It's literally just text, but in a machine-readable form, instead of human-readable.

[–] Amicchan@lemmy.ml 2 points 2 years ago* (last edited 2 years ago) (1 children)

I just read about the error correction in QRCode; that's pretty clever. Could an oppressed class obscure QRCodes enough to hide information from the oppressors while still communicating information?

[–] cypherpunks@lemmy.ml 4 points 2 years ago* (last edited 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.)

[–] liwott@nerdica.net 7 points 2 years ago

@Gmork
I think QR-code is not intrisically an online thing. You can basically represent any string, it's just that it's often use to represent a url.

[–] jakob@lemmy.schuerz.at 5 points 2 years ago (1 children)

Funny guy... Put an image in a QR-code om a Picture...

If i want to keep thy flyer itself, i can take a photo from this flyer... up to as many megapixels as my camera can do. On qrcode i only need an *.ics file, to add the apointment to add it easy to my calendar...

If i want the flyer too... i can add a photo as attachment to the calendar-event...

[–] Gmork@lemmy.ml 3 points 2 years ago

Ha! Yeah. When said like that it does sound kind of funny.

I understand what you are saying, but this is to make it discreet. This way people don't exactly know what it is until they scan it.

Basically I posted some flyers around work and got quite a rise out of everyone. When management found them they tore them all down.

There are QR codes all over the factory that I work at. So I wanted something that could blend in. Something that I could deploy on the back of stall doors in the bathrooms and on the sides of machinery and equipment that employees would discover over time and management would have a hell of a time finding them all.

Then when they think they have found them all I can go back and slap stickers on everything again.

My current QR code is linking to a telegram channel for employees to join, but I really wanted something with some permanence. So that's why I was hoping I could encode information directly into a QR code and not just a URL.

[–] leanleft@lemmy.ml 5 points 2 years ago

an offline version of the internet would be cool. and i think it's very possible for like-minded people to create a quality subset.
but to duplicate the whole trash dump of mostly spam.. yeah that's gonna require more storage capacity than most people have. [except maybe on the cloud]
so, to conclude:
i think it's totally possible!
it just needs to be highly selective for community curated quality content.

[–] agertudici@lemmy.ml 5 points 2 years ago (1 children)

An NFC/RFID tag can apparently hold up to a megabyte. Also I think some devices can store the data in a different way and just transmit through RFID, meaning much more data could be accessed offline that way.

[–] Gmork@lemmy.ml 1 points 2 years ago (1 children)

That is something I had not considered.

QR codes could be deployed on stickers cheaply. This sounds like a more expensive endeavor, albiet an interesting one.

I don't know much about in NFC or RFID. I'll have to look into it. Thanks for the idea.

[–] southerntofu@lemmy.ml 3 points 2 years ago (1 children)

NFC or RFID requires specific hardware (badges) whereas QR codes can be hand drawn, printed...

[–] Gmork@lemmy.ml 2 points 2 years ago

Absolutely. That's what I was getting at.

Being able to run down to my local postal Service and print out QR codes on stickers for next to nothing is much more realistic.

Whereas NFC or RFID would be more expensive, not as easy or convenient to replicate and the average person knows what to do when they see a QR code and that's not necessarily true of RFID or NFC.

[–] Tryp@fuckreddit.tryp.digital 4 points 2 years ago (1 children)

You can definitely do plain text but your phone might not support it without an additional application which seems silly but they didn't work on my s9. URLs only.

[–] Gmork@lemmy.ml 3 points 2 years ago (1 children)

That's good to hear. I have seen plain text mention but have not I figured out how to achieve that. I have made several QR codes that link to URLs. Perhaps I need to try another program.

I was hoping for something a little more like a JPEG so I can put whatever I wanted into it, but worst case scenario sounds like I can go old school with plain text and ascii art. πŸ™ƒ

[–] Gmork@lemmy.ml 2 points 2 years ago (2 children)

Looks like I'm having a similar issue to Tryp.

I found a program that lets me input text as a QR code but when it is scanned the text opens in the search box of my browser.

Everything is displayed in linear fashion and not organized as I type it.

[–] QueenLilac@lemmy.ml 3 points 2 years ago (1 children)

This will do the trick. I use this app for my camera! It works very very well and only requires one permission needed, which is camera. Also camera quality is better than the default camera app.

QR Code scanner on this app can scan really large QR's.

https://play.google.com/store/apps/details?id=app.grapheneos.camera.play

Hope this helps

[–] Gmork@lemmy.ml 1 points 2 years ago (2 children)

That looks excellent!

It does not look like it is on the F-Droid store but I'll check out your Google Play link. Thanks a lot.

[–] QueenLilac@lemmy.ml 2 points 2 years ago

That is open source on github https://github.com/grapheneos/Camera there's a different appstore they use for it.

[–] QueenLilac@lemmy.ml 1 points 2 years ago

If the app works, leave a review if you may please.

[–] morrowind@lemmy.ml 3 points 2 years ago

I think you want nfc, it was supposed to be what qr codes are now.