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.
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.
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).
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).
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.
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).
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.
> 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].
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.
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).
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).
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.
> 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.
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).
But the existing box drawing characters might work better, possibly combined with the upcoming symbols for legacy computing being introduced in Unicode 13.
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.
59 comments
[ 2.0 ms ] story [ 117 ms ] thread* Most. Even cmd does.
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.
[1]: https://fukuchi.org/works/qrencode/
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...
Very handy thing to have in the toolbox for those who live in the terminal, along with magic-wormhole and friends
[1] https://en.wikipedia.org/wiki/Data_Matrix
Edit: HN cuts them away. But the idea is using these https://en.m.wikipedia.org/wiki/Box-drawing_character section Historical
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
These days they scan instantly and have a lot of useful applications.
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.
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.
In Germany everything was either closed or the employees simply desinfected stuff after use.
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).
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!
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.
(A little too long for twitter. Also, I could find a font that displayed these characters correctly.)
> 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
A QR with "H" error correction can lose about 30% - but the code takes up a lot more pixels.
But the existing box drawing characters might work better, possibly combined with the upcoming symbols for legacy computing being introduced in Unicode 13.
https://en.wikipedia.org/wiki/Box-drawing_character
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...)
[1] https://mitxela.com/projects/hr_code
https://github.com/elliottcarlson/slack_qr