Hiding Space Invaders In QR Codes
One of the lovely aspects of QR codes is the variable levels of error correction built in. On even the most basic code you can obscure or deform up to 7% of the code and most readers will still decode it.
This leads us in to the amusing territory of "hiding" human readable data in the code. I say "hiding" because we are hiding it from the scanner - not from the human.
One of the more famous examples of this is Duncan Robertson's BBC logo.
What works particularly well is the fact that the BBC logo is already black and white, and fairly blocky.
Aliens!
After my sojourn alien hunting in Paris, I realised that there is another blocky character which most people will recognise - the humble Space Invader!
In this first code, I've made the Invader small and hidden her in some blank space. Because she's around the same size as the surrounding pixels, any error she generates is cancelled out.
We can also use Duncan's technique and obscure part of the code.
How Not To Be Seen
While the boys of Monty Python can tell you how not to be seen, for computer vision, it's rather different.
Essentially, what most QR scanners do is look at a greyscale view of the image in front of them. The lighter the colour, the more likely the optical recognition algorithm is to see it as "white". This allows you to put dark coloured QR codes on to a light coloured background and still have them read.
So, in theory, we could fill up every pixel of white space with a different light colour and still be perfectly readable.
In this example, I've filled in some of the white space with light green. When seen in greyscale, the green is discarded and no extra error is introduced.
Other Examples
Optiscan have gone a whole lot further and coloured in the entire code
They claim that their app will quite happily read this code. As it's iPhone only, I wasn't able to verify - but as a rule, increasing the colour complexity will reduce the chances of a phone being able to successfully read your code. It's a fine balance between readability and aesthetic improvement.
The excellent QR Monkey has a blog post detailing several different techniques for prettifying your QR Codes.
Another example of how far you can go is this QR Quilt from Rubi Studios.
In short - you can go pretty wild with your QR designs. Just remember to up the error correction and make sure that contrast between the colours you use is sufficiently high for most scanners. When in doubt - test!
Benjamin says:
Love'em 🙂 - Are there any good ways to check how badly you've mangled the QR code once you've redesigned it, or is it just a matter of %'age change?
Terence Eden says:
It's mostly a matter of %age change. There are some online decoders like http://zxing.org/w/decode.jspx - but none that I know of which will tell you how many errors it encountered.
You can change the level of error correction, see http://code.google.com/apis/chart/docs/gallery/qr_codes.html#overview * L - [Default] Allows recovery of up to 7% data loss * M - Allows recovery of up to 15% data loss * Q - Allows recovery of up to 25% data loss * H - Allows recovery of up to 30% data loss Obviously, the more error correction, the bigger the code.
Wife says:
'QR codes gone Wild!' There's an ITV series in that somewhere...
Steve says:
Hi Terence, thanks for including my alien QR in your blog post! I guarantee it reads perfectly (and quickly) in Optiscan, although I know others have issues. Error correction helps, but - as you say - getting the balance right between light and dark is essential. One complete failure of QR Code use recently was in a print piece for the Vatican - the QR Code colours were reversed to fit the ad better and so consequently didn't read at all!
Ming-Ling says:
I made a QR code entirely out of Space Invaders, as well as the Tetris tetrads. http://ming-ling.livejournal.com/164535.html I also did one for Super Mario Brothers, because I... am a geek. http://ming-ling.livejournal.com/tag/qr%20code
Dan says:
Yeah, it definetely damages the readability, but at the same time you can obscure 30% of the code, just get it done by someone who knows what they are doing- you can check out our post for a couple professionals who do QR code branding- http://mcloughlin.ca/insights/custom-brand-your-qr-code-mobile-barcode-scanning-trends/