MOX
Products
Learn about our additional services
Resources & Elements
Return

MOXNicolás Aravena
29-09-2021

How QR codes work

The pandemic has opened up new uses for QR codes, such as the mobility pass scanner for certain activities. It's also used for airplane travel, buses, and even food menus. It's an intuitive mechanism that we've already standardized.

So, what's behind QR codes? How do they work?


To begin, the first elements to consider are the corner boxes; they serve as the skeleton of the code. When a QR code is scanned with a cell phone, a program on the device begins to look for patterns in the image, its main guide being the top corners and the bottom left corner.

Depending on the number of dots and squares it has, it will contain more or less information. More technically, it is explained that bytes, or 8-bit blocks, are represented in the QR code as blocks of 8 white or black dots. For each bit I want to "draw," I'll put a white square if the bit is 0 or a black square if it's 1.

The dot density of a QR code represents the amount of information it contains. There are images configured to store the address to a web page, where a few pixels are sufficient, but the more text stored, the more spots and spaces within the code. Furthermore, the fact that they are black and white makes it easier for cameras to capture them quickly.

Although QR codes can be customized in color and shape, the generic choice of black and white is not accidental. Contrast helps cameras identify the codes even in low light. In addition, the codes are surrounded by a frame without content, the so-called "still zone," which helps isolate them from the rest of the environment to make them more recognizable to our cameras.

The smaller squares, called alignment squares, help the device correct the position and orientation of the code in the image, so that they can read the code even if we take the photo upside down.


Other articles that might interest you