Hidden QR code in an image: how to do it without breaking the scan
Paolo Matias TonelloUpdated 7 min read
Hiding a QR code inside a photograph, an illustration or a packaging pattern is a real design technique, not a trick. It works because the QR standard reserves part of every code for error correction. What breaks these designs is not the artwork itself but covering the structural zones a scanner needs to find and align the grid.
Which parts of a QR code are structural
A scanner does three things in order: it locates the three large squares in the corners, it uses the smaller alignment square and the dotted timing lines to work out the grid geometry, and only then does it read the data modules. The first two steps are pass or fail. If they fail, no amount of error correction saves the scan.
| Zone | Purpose | Safe to decorate |
|---|---|---|
| Three corner squares | Finder patterns | No |
| Dotted lines between corners | Timing patterns | No |
| Small square near bottom-right | Alignment pattern | No |
| Quiet zone (margin) | Separates code from background | No — keep it clear |
| Central data modules | Payload plus error correction | Yes, within limits |
How much of the code you can actually cover
Error correction level H can reconstruct roughly 30% of the code's data, which is why logo overlays work. But that budget is shared: print defects, glare, angle and a low-contrast background all consume it too. Treat 15% coverage as a practical ceiling for artwork so the remaining margin absorbs real-world conditions.
- Use error correction level H for any decorated code
- Keep coverage centred and contiguous rather than scattered across the grid
- Never let artwork bleed into the quiet zone around the code
- Keep true black-and-white contrast in the data area, even when the artwork is colourful
- Prefer a dynamic code so the payload stays short, which keeps the grid coarse and forgiving
How to blend a code into a photograph
- Generate the code as SVG so you can edit geometry instead of pixels.
- Pick a region of the image with flat, light tone — sky, wall, paper, fabric.
- Place the code there and darken its modules to true black against that light area.
- Keep the three finder patterns fully intact and fully contrasted.
- Blend only the data modules into the texture, module by module, never partially.
- Export the final artwork as vector or at print resolution, never as JPEG.
Test a hidden code properly
A hidden code that scans on your desk can still fail on a shelf. Test with at least three phones, including one older Android, at the real distance, under the real lighting, and at an angle. Then test the printed proof, not the screen: paper reflectance and ink spread change the contrast you measured on a monitor.
Put it into practice
Keep reading
- Invisible QR code: hidden codes that still scanInvisible QR codes hide the pattern inside artwork, use transparent inks, or embed data in ways the eye cannot see. Some work well; others are risky for production.
- QR code design: contrast, quiet zone and logosThe design rules that decide whether a QR code scans on the first try or not at all, from contrast ratios to logo placement.
- Low contrast QR codes: how far you can push colour before scans failContrast is the single biggest predictor of whether a QR code scans. Here are the thresholds, the colour pairs that fail, and how to check yours before print.