59 comments

[ 2.0 ms ] story [ 117 ms ] thread
Interesting, this would allow QR codes in the terminal.
You could already use qr codes in the terminal because we’ve had black blocks and spaces for 60 years.
Would it still work when someone uses a white theme vs. a black theme for their terminal?
No, generally not. Some QR scanners will scan "inverted" codes, but it is outside of the spec.
I usually just select the qr code in the terminal to invert it and then scan it :)
Officially you do need to have the ‘dead space’ white area around the symbol as well or it won’t scan easily.
The 2015 spec clearly call for support for both dark over light and light over dark, and doesn't constrain light and dark to black and white.
You can usually define force and background colors in the Terminal, so you could force black on white. But then again someone can redefine the colors in their terminal. Some terminal emulators also support rgb; so a smart QR code program should be able to do it.
> Some terminal emulators also support rgb

* Most. Even cmd does.

Absolutely. A couple of years ago when my son was really into Beyblade Burst, I wrote a little script that displayed Beyblade codes in the terminal (they're not QR but a different kind of 2D black-and-white "barcodes"). The Android app would scan those just fine.
(comment deleted)
Well yes these are emoji, but i was expecting something more “:)”-ish
You could use skintone modifiers on some of the smilies - but I thought that was a bit weird.
They aren't emojis. Standard ASCII.
That's not quite the case. The blocks are available in the Miscellaneous Symbols and Arrows section of Unicode. That's usually rendered as plain text (although not ASCII).

But they're also paired with Variation Selector 16 (https://emojipedia.org/variation-selector-16/) which gives them an Emoji presentation on most modern systems.

Yeah blocks from unicode aren't exactly what I was expecting when I clicked through. Of course you can make a QR code with what are essentially big black and white pixels...
qrencode[1] has been doing this for a long time in the terminal. It even supports half-block UTF-8 character (two bits per character, which makes them more square).

[1]: https://fukuchi.org/works/qrencode/

(comment deleted)
I second qrencode. It is notoriously used by the password-store [0]. Theirs qr function is perfect to extract as a separate script and put them into the $PATH (especially useful when it is needed to generate and save some QR codes).

The opposite tool to qrencode is zbarimg, which accepts first parameter to image file containing the QR code and prints out the encoded content.

[0]: https://git.zx2c4.com/password-store/tree/src/password-store...

alias qr="qrencode -t UTF8"

Very handy thing to have in the toolbox for those who live in the terminal, along with magic-wormhole and friends

QR code built as ASCII art and then displayed prettily in Emoji Blocks to ensure proper contrast?
This is cool and iOS camera is able to scan the code even without the CSS that squashes the squares together if scanned from a large enough distance (about 30 cm).
Can't you tweet a QR code made from Braille ASCII?
The smallest QR codes are 21x21 pixels. Braille is 2x4. So you might be able to do it assuming there are the right patterns.
Braille characters occupy all 256 (for the 2x4, 8-bit matrix) combinations, so invalid (unused) characters do exist.
I don’t know why, but as a consumer I hate QR codes. Maybe because the hype there was? And the little bit of information they provide, like a link. I don’t know.
I am similar, as are most people I know, yet it just seems to be the kind of thing that people think is great and that people love
I think it's great for boarding passes, parking tickets, theater admission, etc.
> And the little bit of information they provide, like a link. I don’t know.

I share the lack of sentiment to hype and overusing its name and symbol but I cannot agree about the sentence I have quoted about.

The QR code comes with titles and URIs, which provides nice way how to share some information with a distinction of their type, i.e. a contact card, OTP passphrase, WiFi credentials (SSID/passphrase pair). Instead of providing a password, which is hard to spell out, we can just share an image and in a moment after scanning we are connected to the WiFi. Been there, works like a charm.

We can also use them to share data of multi-MB weight over just an animation combined with generated QRs [0].

[0]: https://github.com/divan/txqr

The hype was a bit too early when the codes were very hard to scan which was a big turn-off.

These days they scan instantly and have a lot of useful applications.

Here in spain a lot of restaurants have posted QR codes on the tables so people can see the menu without touching it. Its been a great help during the pandemic. The experience on the iPhone has been really good. Android.... depends on the phone / os version / app etc. QR is something that should be part of the OS and apps should be able to register apps / protocols so it opens directly.
Devs can already register their domains' links to be opened in their app (deeplinking into an app, called app links/universal links) :).

If the app is not installed, your backend could redirect the user to the app/play store together with the deeplink which will be opened after installation.

Until recently I would've more or less agreed, they didn't seem to add much.

COVID has suddenly made them a big deal here in Spain though. QR codes are everywhere now. Restaurants and bars aren't supposed to pass menus around for hygiene reasons, so those are now all QR codes on every table. Gyms and swimming pools etc now must require reservations for entry to control numbers, so those are all managed with emailed QR codes you scan at the door. You need a completed health form to enter the country, and you have to prove it at the border by scanning a QR code from the form.

They've gone right the way from niche gimmick to day-to-day necessity at incredible speed. En route this has improved lots of things too - e.g. quite a few bars & fast food restaurants let you order and pay directly from the menu behind their QR code, and there's far fewer annoying paper forms anywhere. I don't see them going away.

Interesting.

In Germany everything was either closed or the employees simply desinfected stuff after use.

I was in exactly one restaurant indoors during Covid in Germany, and they used lamitated QR codes on the table for an online menu, so it was in use here as well. But generally I agree, yes.
On the whole, I agree that the adoption of QR codes more widely is a good thing - they are a useful tool to solve a certain class of problems, but in pre-COVID times, they often weren't practical as only a small proportion of people would know how to use one, making it not a viable option to solve the problem.

However, one downside of mobile phone ordering is that it has made the ordering process significantly less streamlined. Some restaurants/bars require you to install an app, some are fully web-based (good) but require you to register, but only some of them are web-based, don't ask for more information than is required, and integrate well with fast/easy payment systems (such as Google Pay or Apple Pay).

In my experience they lived up to the hype.

Boarding passes have them so you can easily see if your flight is delayed.

Restaurants have them so they offer cheaper meals by not printing menus.

All venues in Western Australia now MUST have them for the SafeWA app (for contact tracing).

Most warehouses I’ve seen, including Australia Post, have them on their articles so workers can quickly scan them (without needing to line up the old linear barcodes or manually enter a code).

Many pamphlets handed out at various events have them so you can quickly find them on social media (often via LinkTree).

They seem like a success to me!

I love how low tech they are. Bluetooth and NFC and all that are cool, but not many of these protocols are compatible with a VT100 or plain old paper.
There’s something foolish about paying for printed media intended to communicate with people, and use it to only communicate with machines. Regular printed text can be understood by humans and machines alike, while QR codes are completely useless for humans. Most QR codes seem to encode URLs, and it wouldn’t exactly be a technical marvel if your smartphone camera was simply able to spot printed URLs and offer to follow the link.

There are places where QR codes make sense though, and at least it seems like people have stopped putting QR codes on billboards, advertisements, etc.

(comment deleted)
> Can I tweet that??!?

> The smallest possible QR code is 21×21 pixels, that’s too many characters to fit into a Tweet. Sorry!

Ah, but you're thinking inside the box! With Unicode block elements[1] you can divide a single character into a 2x2 block of "pixels", thus requiring a grid of only 11x11 (121 characters + 10 line breaks). Unicode braille patterns[2] come in 2x3 or 2x4 dot patterns, so depending on your font and how forgiving your QR code reader is, you might be able to use braille patterns for even larger QR codes.

[1]: https://en.wikipedia.org/wiki/Block_Elements

[2]: https://en.wikipedia.org/wiki/Braille_Patterns

Also, couldn't error correction allow you to only put part of the QR code?
Sort of. The 21x21 QR has an error correction of "L". That means up to 7% of the data area can be obscured. Realistically, as the code is a square, you could only lose data from the right hand side while maintaining integrity.

A QR with "H" error correction can lose about 30% - but the code takes up a lot more pixels.

QR code needs alignment patterns (5 by 5 bullseye shape) at correct positions to compensate distortion, so that limits the actual saving from entirely omitting the data because removing anything left of alignment patterns would not reduce the size. You also have to account for masking but that's a minor issue (the optimal masking algorithm is a recommendation and not a requirement).
For the testing purpose, the following is the QR code in the post rendered with braille patterns:

    ⡏⣭⡍⡇⣲⢱⡆⡏⣭⡍⡇
    ⠧⠭⠥⠇⠖⡗⡆⠧⠭⠥⠇
    ⡭⠉⢁⠽⣛⠾⢽⠘⣚⡾⠂
    ⡬⠬⠭⡍⢟⡉⣔⠱⣛⡦⠃
    ⡇⠿⠇⡇⣏⠹⢵⢱⡋⡖⠀
    ⠉⠉⠉⠁⠉⠈⠀⠉⠉⠈⠀
(comment deleted)
Couldn't get this one to work. I'm curious if anyone else is able to get that to work.
I tried to scan this emoji QR code, and it didn't work on my iPhone.
Worked fine on my Pixel Gcam. Links to the author's portfolio.
Now we need to go deeper, we need to encode a smaller unicode qrcode as a bigger qrcode.
What always bugged me about QR codes is that they're not human-readable.

I'd love if there were a standard where you'd simply have a human-readable URL plus some markers at the start and end to help with OCR. And you could standardize the font too.

For example: |: google.com [|

(edit: hackernews removes unicode...)