Qraft

The Art Hidden in QR Codes - The World of Designs That Push the Limits of Scannability

Why Art Can Be Embedded in a QR Code

The reason a QR code can still be read when an illustration or logo is placed over it lies in error correction. QR codes use an error correction algorithm called the Reed-Solomon code and are designed so that the data can be restored even if part of the code gets dirty or damaged. At error correction level H (the highest), the code can be read correctly even if about 30% of the data (codewords) is lost. This 30% is a proportion of the data, and it does not mean that you may cover 30% of the area.

Using this "30% margin" for art rather than for dirt or damage is the basic principle of the design QR code. Even if you place a logo in the center, change the shape of the modules (the black and white dots) to circles or stars, or turn the colors into a gradient, the scan succeeds as long as the changes stay within the range of error correction.

Techniques and Examples of Art QR Codes

Art QR code techniques can be broadly divided into three types.

1. The overlay method: This is the simplest technique, placing a logo or image over the center of an ordinary QR code. Because data density in the center is relatively low, the guideline on the safe side is to keep it to about 20%, but if you assume error correction level H, covering up to about 25% with an image is unlikely to interfere with reading. It is the most widely used method for corporate brand QR codes.

2. The module transformation method: This technique changes the black and white square modules into circles, diamonds, hearts, and other shapes. As long as the center positions of the modules and the light and dark contrast are maintained, readers can recognize them even if the shape is not square. It is used a lot by fashion brands and in event invitations.

3. The full art method: This is an advanced technique that blends the whole code with an illustration or photo while keeping the structure of the QR code. Since around 2023, techniques that use image generation AI such as Stable Diffusion to blend QR code patterns into landscapes and portraits have been attracting attention. With the QR Code Monster model for ControlNet, it is possible to generate works that look like nothing but paintings at first glance yet can be scanned when you hold up a smartphone.

The Line Where Codes Become Unreadable - An Analysis of Failure Patterns

The biggest risk of art QR codes is the self-defeating result of "beautiful to look at but impossible to scan." Analyzing the failure patterns, the following three emerge as the main causes.

Altering the position detection patterns: The nested square patterns in three corners of a QR code (the finder patterns) are the most important element that lets a reader recognize "this is a QR code." If you alter them for design reasons, the reader cannot recognize the code as a QR code in the first place. The iron rule is never to touch the finder patterns.

Insufficient contrast: If you make the module colors pale pastels or reduce the difference in lightness from the background, the camera can no longer tell the black and white boundaries apart. If, in the pursuit of design, the contrast ratio between dark and light modules falls below 3:1, the reading failure rate rises sharply.

Exceeding the limit of error correction: Changes beyond the tolerance of error correction, such as a logo overlay that is too large or module transformations that are too extreme, naturally make the code impossible to scan. As a safety margin, the practical guideline is to choose error correction level H and keep the altered area within 20%.

The Impact of AI-Generated Art QR Codes

AI-generated art QR codes, which appeared in 2023, fundamentally overturned the concept of the design QR code. The conventional idea was to "put art on top of a QR code," but AI generation takes the approach of "weaving the structure of a QR code into the art."

Technically, the ControlNet extension for Stable Diffusion is used to control image generation with the QR code pattern as a "condition." To the human eye, the generated image looks like a cyberpunk-style cityscape or an ukiyo-e-style landscape, but when you hold up a smartphone camera, it is recognized as a QR code.

The limitation of this technology is that the reading success rate of the generated results is not stable. Even with the same prompt and seed value, a slightly different image is output each time, and images that can be scanned are mixed with ones that cannot. In practice, you need a step of generating several times and selecting the ones that pass a scan test. Also, because reading accuracy differs by smartphone model and camera app, testing on multiple devices is essential.

Five Principles for Making Design QR Codes Safely

When you use art QR codes in practice, following the five principles below lets you achieve both design quality and readability.

  1. Protect the finder patterns at all costs: Do not alter the position detection patterns in the three corners at all. If they break down, the code cannot be read no matter how high you raise the error correction level
  2. Choose error correction level H: Always choose the highest level to absorb as much of the "damage" from design changes as possible
  3. Keep the altered area to about 20% on the safe side: If you assume error correction level H, the guideline for the upper limit is up to about 25%. The theoretical restoration capability is equivalent to 30% of the data (codewords), but this does not mean you may cover 30% of the area
  4. Maintain a contrast ratio of 4:1 or higher: Secure enough difference in lightness between dark and light modules. In situations where backlighting and lower print density combine, leave a margin up to 7:1 or higher. The WCAG text contrast standard (4.5:1) is a separate standard for people reading text and belongs to a different area from a decoder's threshold judgment
  5. Run scan tests on at least 5 models: Check reading with an iPhone, several Android models, and different camera apps. It is not unusual for a code that succeeds on one model to fail on another