A QR code built from Emoji
It's possible to encode QR images as text. In this case, Emoji!
⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️ ⬜️⬛️⬛️⬛️⬛️⬛️⬛️⬛️⬜️⬜️⬜️⬛️⬜️⬜️⬜️⬛️⬛️⬛️⬛️⬛️⬛️⬛️⬜️ ⬜️⬛️⬜️⬜️⬜️⬜️⬜️⬛️⬜️⬛️⬛️⬜️⬛️⬛️⬜️⬛️⬜️⬜️⬜️⬜️⬜️⬛️⬜️ ⬜️⬛️⬜️⬛️⬛️⬛️⬜️⬛️⬜️⬜️⬛️⬜️⬛️⬛️⬜️⬛️⬜️⬛️⬛️⬛️⬜️⬛️⬜️ ⬜️⬛️⬜️⬛️⬛️⬛️⬜️⬛️⬜️⬛️⬛️⬜️⬛️⬛️⬜️⬛️⬜️⬛️⬛️⬛️⬜️⬛️⬜️ ⬜️⬛️⬜️⬛️⬛️⬛️⬜️⬛️⬜️⬜️⬜️⬛️⬜️⬜️⬜️⬛️⬜️⬛️⬛️⬛️⬜️⬛️⬜️ ⬜️⬛️⬜️⬜️⬜️⬜️⬜️⬛️⬜️⬛️⬛️⬛️⬛️⬛️⬜️⬛️⬜️⬜️⬜️⬜️⬜️⬛️⬜️ ⬜️⬛️⬛️⬛️⬛️⬛️⬛️⬛️⬜️⬛️⬜️⬛️⬜️⬛️⬜️⬛️⬛️⬛️⬛️⬛️⬛️⬛️⬜️ ⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬛️⬜️⬛️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️ ⬜️⬛️⬛️⬛️⬛️⬛️⬜️⬛️⬛️⬛️⬛️⬜️⬛️⬛️⬛️⬜️⬛️⬜️⬛️⬜️⬛️⬜️⬜️ ⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬛️⬛️⬛️⬛️⬛️⬜️⬛️⬜️⬛️⬛️⬛️⬛️⬛️⬛️⬜️ ⬜️⬛️⬛️⬜️⬜️⬜️⬜️⬛️⬛️⬜️⬜️⬛️⬛️⬛️⬛️⬜️⬜️⬜️⬜️⬛️⬛️⬜️⬜️ ⬜️⬛️⬜️⬜️⬜️⬜️⬛️⬜️⬜️⬛️⬛️⬜️⬜️⬜️⬛️⬜️⬜️⬛️⬛️⬛️⬜️⬜️⬜️ ⬜️⬜️⬛️⬜️⬛️⬛️⬛️⬛️⬛️⬛️⬛️⬛️⬛️⬜️⬜️⬛️⬜️⬛️⬛️⬜️⬜️⬛️⬜️ ⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬛️⬛️⬜️⬜️⬜️⬛️⬜️⬛️⬛️⬛️⬛️⬜️⬛️⬜️ ⬜️⬛️⬛️⬛️⬛️⬛️⬛️⬛️⬜️⬛️⬜️⬜️⬜️⬛️⬜️⬜️⬛️⬜️⬜️⬛️⬛️⬜️⬜️ ⬜️⬛️⬜️⬜️⬜️⬜️⬜️⬛️⬜️⬜️⬛️⬛️⬜️⬛️⬛️⬜️⬜️⬛️⬛️⬛️⬜️⬜️⬜️ ⬜️⬛️⬜️⬛️⬛️⬛️⬜️⬛️⬜️⬛️⬛️⬛️⬛️⬛️⬜️⬛️⬜️⬛️⬛️⬜️⬜️⬜️⬜️ ⬜️⬛️⬜️⬛️⬛️⬛️⬜️⬛️⬜️⬛️⬜️⬜️⬛️⬜️⬛️⬜️⬛️⬛️⬜️⬛️⬛️⬜️⬜️ ⬜️⬛️⬜️⬛️⬛️⬛️⬜️⬛️⬜️⬛️⬜️⬜️⬛️⬛️⬛️⬜️⬛️⬜️⬜️⬛️⬜️⬜️⬜️ ⬜️⬛️⬜️⬜️⬜️⬜️⬜️⬛️⬜️⬛️⬛️⬜️⬜️⬜️⬛️⬜️⬛️⬛️⬜️⬛️⬜️⬜️⬜️ ⬜️⬛️⬛️⬛️⬛️⬛️⬛️⬛️⬜️⬛️⬛️⬜️⬛️⬜️⬜️⬛️⬛️⬛️⬛️⬜️⬛️⬜️⬜️ ⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️⬜️
How?
There are lots of ASCII block characters, but none are specifically marked as white / empty. Additionally, some fonts don't make the characters pure squares.
There are two characters which, generally, render as square Emoji:
- Unicode character U+2B1B is a large black square ⬛ .
- Unicode character U+2B1C is a large white square ⬜ .
These characters are from the Unicode block "Geometric Shapes". When paired with ️Variation Selector-16, they are given an Emoji presentation.
The above QR code is styled with "line-height:1em;"
to make sure there are no vertical gaps between characters, and "letter-spacing:-3px;"
to squash any horizontal gaps.
I found that it scanned reliably on my devices.
Why?
I was having a discussion with someone about the limitations of text based communication. How do you send a QR in, say, an email when you aren't allowed to attach anything? We were looking at a text only system which wouldn't allow attachments or BASE64 encoded inline.
So I knocked up a quick scrap of code to see if it would work with Emoji. It sort of works - but only if you can control the exact layout. On mobile screens, it might be too narrow, and you can't easily control the character spacing.
So, a nice idea, but a little pointless!
Can I tweet that??!?
The smallest possible QR code is 21x21 pixels, that's too many characters to fit into a Tweet. Sorry!
You can post it on something like Mastodon but without the fine-grained CSS control, it probably won't be readable.
Alan Bell said on twitter.com:
tweetable with this lot? ▖▗▘▙▚▛▜▝▞▟ not easy to construct!
Joshr. humanist, progressive, european said on twitter.com:
@briansuda and i used to run a wiki for this kind of test qr-practices.pbworks.com
Alan Bell said on twitter.com:
looks like all the bits are there, constructing by hand is tedious! ▗▄▄▄ ▐▗▄▐ ▐▐█▐ ▐▄▄▟
Lee says:
The iPhone (at least) will still detect QR codes using Unicode "quarter" blocks, even though they're not connected squares. There's a program, qrencode, that can generate QR codes to the terminal.
example here: https://www.godo.dev/tutorials/terminal-qr-code-generation/
Chris Midgley says:
How about unicode block elements? You can get up to 4 black pixels per characters using the quadrant versions. You'd need a light background to work as white, though.
George Cave said on twitter.com:
Never thought of using emoji, but I have a Lego QR code in my house that triggers wifi login when scanned. Seems like something you’d build 😉
Richard said on twitter.com:
Scanned eventually on my Samsung tablet, but took a while of fiddling to make it recognise it. Possibly because the code wasn't square on my screen
HackerNewsTop10 said on twitter.com:
A QR code built from Emoji Link: shkspr.mobi/blog/2020/12/a… Comments: news.ycombinator.com/item?id=253443…
Matt Stibbs said on twitter.com:
I wonder what would happen if you view that on a small phone screen with high zoom and some extreme line wrapping… ?
Karey Higuera said on kbravh.dev:
Trying an interesting twist on this with Braille characters.