it encodes text into a compact printed pattern and decodes it back from a scan. It is a single HTML file and works offline. I tested the encode and decode logic in Node with simulated scans, but I haven’t printed a page and scanned it on real hardware.
How it works
- Your text is compressed, then protected with Reed-Solomon error correction, so dust, small scratches and printer defects can be repaired.
- Each byte becomes black and white cells. The page ends up as a dense grid inside a thick black frame.
- To decode, choose a scan or photo of the page in the same file. It finds the frame and corrects tilt and perspective. It also works if the page was scanned turned by 90° or upside down, and it recovers the text with a checksum.
Capacity on one A4 page
At the default 0.5 mm cell size the page holds about 25 KB. With compression that is roughly 60,000 to 100,000 characters of English text, depending on the text. At 0.35 mm it is about double that, but that needs a 600 dpi laser printer and a flatbed scanner at 600 dpi.
What I tested
- My Node tests simulated scans that were tilted up to 2.5°, turned 180°, noisy and speckled with dust, and one with a white stripe across the page. A 60,000-character text decoded back exactly in every case, at 0.35, 0.5 and 0.8 mm cells.
- The page’s “Self-test” button runs the same kind of simulated scan in your browser.
- Reed-Solomon correction held up to its limit and failed cleanly beyond it.
Practical limits
- Use a flatbed scan for 0.6 mm cells or smaller. Phone photos only work at 0.8 mm and 1.0 mm.
- Print in black on white at 100% scale with no headers or footers, and keep the page flat and unfolded. If decoding fails, raise the error correction or use a larger cell size.
- Very strong perspective distortion in photos, or a heavily damaged frame, can make decoding fail.
