Decoding QR Codes, The Quick Response Squares: Scan And Discover

From menus in restaurants to payment links at cashiers. From boarding passes to product pages. QR codes are everywhere.

They come in squares, traditionally in black and white, and that their presence help people access a range of services and information in the blink of an eye. The two-dimensional matrix barcodes may look simple, but things are more than what meets the eyes.

These codes may look like modern wizardry, when in fact, they were actually invented all the way back in 1994.

At the time, Japanese auto manufacturing company Denso Wave.

At first, they were used to enable high-speed scanning and tracking of components during the assembly process. They were designed the least-used ratio (1:1:3:1:1) in black and white areas on printed matter, so that they can be easily readable by imaging devices.

QR code, Eyerys

But most importantly, They were designed in such a way, so they cannot be misidentified, even at high speed.

Fast forward, QR code has evolved, as compatible technology has matured to provide new ways to engage customers.

In simple explanation, QR codes (or Quick Response codes) are like next-level barcodes.

Whereas barcodes only contain machine-readable information from their horizontal lines, readable from left to right, QR codes are written both vertically and horizontally.

Unlike barcodes’ one-dimensional, linear arrangement, which is limited to its horizontal space, and that it typically stores up to 20-25 characters, QR codes can store a lot more data.

Coming in a grid of black and white squares, often with three distinctive squares in the corners, QR codes can store up to 7,089 characters.

And because QR codes can be scanned from any direction, they offer much more flexibility than the traditional barcodes.

Because of this, QR codes can contain data for a locator, identified and also web tracking.

QR codes became extremely popular because of these traits.

And also since mobile devices become increasingly more powerful, and that many of them are equipped with capable cameras, QR codes become so ubiquitous in the fast-paced world, where digital and reality blend.

How do QR codes work?

QR code, explain

QR codes work by arranging a series of black and white squares (pixels) into a unique pattern that encodes a string of data. This pattern, when scanned, can be translated into human-readable information.

  1. Quiet Zone: The empty white border around the outside of a QR code.
  2. Finder pattern: The three black squares in the bottom-left, top-left, and top-right corners.
  3. Alignment pattern: A small square near the bottom-right corner, in order to give information about the QR code's orientation, relative to the scanner.
  4. Timing pattern: An L-shaped line that helps to identify individual squares within the whole code, making it possible for a damaged QR code to be read.
  5. Version information: Identifies which version of the QR code is being read.
  6. Data cells: The rest of the QR code communicates the actual information.

All QR codes have this standard structure that makes information within them readable.

QR code, explain

When a smartphone or a device that can read a QR code has its cameras pointed at a QR code, it will follow the following steps, in order:

  1. The software captures an image containing the QR code using a camera or other input method to be processed.
  2. The captured image undergoes preprocessing to enhance its quality and remove noise.
  3. The software identifies the QR code’s position within the image.
  4. The data is then extracted from the QR code’s matrix.
  5. The software does this by locating the timing patterns and modules (black and white squares) to decode the information.
  6. Error correction algorithms (such as Reed-Solomon) are applied to handle damaged or missing modules.

It's worth noting that due to its two-dimensional nature, the information within QR codes is encoded in a zigzag pattern.

It follows a serpentine path, alternating between scanning rows left-to-right and right-to-left.

This ensures that that the entire image can be used efficiently.

QR code, explain

When scanning a QR code, the scanner will follow the same path.

Once data is extracted, the software will then retrieve the encoded data, which can include URLs, text, or other information.

Depending on the QR code type (e.g., URL, contact, Wi-Fi credentials), the software interprets the data accordingly.

Software that can read QR codes can also validate the data, and handle errors.

For example, if the QR code is partly damaged, or have incorrect decoding, it can attempts to correct them using error correction codes.

If it can finally validate the data, the software can then perform the appropriate action based on the decoded data. For example, if the QR code stores a URL, it will open the link in a web browser. Of, if it's a contact information, it can automatically add the details to the address book.