Dithered QR Codes

273 points · 26 comments on HN · read original →

Points and comments are a snapshot, not live.

Dithering hides QR data modules in images without affecting scannability.

A QR code has function patterns (finder/alignment) and data modules. Data modules can be shrunk to a 3x3 grid, using the center pixel for data and surrounding pixels for a dithered photo. Floyd-Steinberg error diffusion on the forced data-module colors hides the salt-and-pepper noise they would otherwise create. The generator tool at andrewt.net allows rotating the QR code before embedding the image and toggling alternative encodings. Practical limits: margin and error correction matter for print; a code that scans on a laptop screen may fail in poor conditions.

What commenters are saying

Commenters praised the writeup's clarity and explored related projects: color QR codes with dithering, animated QR codes, and AI-generated QR codes. Some noted that the technique relies on scanners reading only the center of each module, which might fail on scanners that sample the whole square. Others raised concerns about scannability degradation from aesthetics (logos, dithered images) eroding QR error correction, comparing it to car safety features being offset by driver complacency. A few pointed to tools like SAT solvers for minimal valid QR codes.