Dithered QR Codes: How to Hide a Photo in a Scannable Code

QR codes can be made to look like dithered photos by replacing the data modules with image pixels. This page explains the basics of QR code structure, then shows how to use Floyd-Steinberg error diffusion to mask the required data modules, producing a cleaner image. It also covers advanced tricks like rotating the code or allowing a few data modules to be changed, and warns about the trade-off between aesthetics and scannability in real-world use.
The error will potentially be quite big — normally we get to choose the colour so the error can never be more than 50%, but here we might have to make a pixel in a dark area pure white and end up creating 95% error.