
A looks like a picture of the information, and every pixel in it looks necessary. And yet you can print a logo right through the middle, crease it and dirty it, and it still scans. How does that work?
It is not a picture of the information. It is an encoding of the information together with extra marks for , calculated from the data so that any distortion creates a contradiction that points to its own location. At the higher correction levels you can lose a substantial share of the code and still read it. Which is why does not break it, and why a creased or dirty code still scans.
The assumption that is easy to get wrong is that the code is a picture of the information. It is not. It is an encoding of the information together with extra marks meant for error correction, which is why a substantial share of the black squares are not data but insurance.
The idea behind that insurance is mathematical. You add marks calculated from the data, so that if something changed a contradiction appears. From the contradiction you can work out both where the error fell and what the value there used to be. Nothing has to be known in advance about what will be damaged.
The standard defines four correction levels, and at the highest you can lose about a third of the code and still read it. That is why a creased, dirty or corner-cut code still scans, and it is also why a logo can be printed in the middle: you erase data on purpose and lean on the rebuilding.
The price is plain and there is no getting around it: costs space. The higher the correction level, the less information fits into a code of the same size. And that same principle, of paying up front so as never to need a resend, protects data on discs, in satellite broadcasts and in computer memory.
wat. The logo in the middle of the code does not break it, because the missing data is rebuilt from the correction marks around it.
wat wat
The same principle of deliberate redundancy protects data on discs, in satellite broadcasts and in computer memory.
How do we know?
The QR standard defines four levels of error correction and the share of data recoverable at each. The mechanism rests on well-known mathematical error-correcting codes.
What is still unknown
Redundancy costs space. The higher the correction level, the less information fits into a code of the same size.
Learn something?
Where to next
How do you defend data against a computer nobody has built yet?standards
What happens to an important report when many companies publish on the same day?information
Does the choice of a share pass between neighbors?information