Applied Research05 / 14
Codex — High-Density Archiving of Media on Paper
A print-and-scan data channel for 1 to 10 MB media files on ordinary A4 paper, about 383 KB per page; it recovers them byte for byte and prints its own decoder.
Decode it yourself
An ordinary A4 sheet can carry about 383 KB of media, recovered byte for byte from a flatbed scan, with the decoder printed alongside.
Key figures
- net payload per A4 page
- 383 KB
- archives restored byte for byte
- 4 / 4
- one page lost each
- bytes corrected on damaged pages
- ≤ 0.90 %
- stains, scratches
- fewer pages than the typeset text
- ≈ 136×
Abstract
My family media sit on disks that die within a few years; paper lasts centuries. How much can an A4 sheet hold and still be read with a flatbed scanner? Data are printed as grey-level cells, protected within each page and across pages. A printed appendix carries the format and the full decoder, so the archive outlives today’s software.
Key notions
- print-scan channel
- erasure coding
- self-describing archive
- digital preservation
Where it started
My family media live on hard drives, and hard drives die. The files degrade within a few years, and the software that knows how to open them eventually disappears. Paper, for its part, lasts centuries. The project began as an ideation exercise, almost a piece of fiction: if I had to entrust my photos and videos to a stack of A4 sheets, for someone to read back in a hundred years with an office scanner, what would I print, and how would I explain to them how to read it?
The technical question followed straight away. The printed codes everyone knows, QR and DataMatrix, are built to survive anything, and so settle for kilobytes. I wanted megabytes per sheet, readable with an ordinary flatbed scanner, and an archive that carries its own instructions with it. I built the whole chain as personal R&D, then put it to the test in simulation.
What I built
flowchart TB
A["Photo, video, voice, text"] --> B["Format-conservative reduction"]
B --> C["Archive + checksum"]
C --> D["Erasure code across pages"]
D --> E["Error correction within each page"]
E --> F["Grey-level cells, printed A4"]
F --> G["Print → scan"]
G --> H["Geometry recovery<br/>corner marks + local alignment"]
H --> I["Self-calibrated grey levels"]
I --> J["Decode + checksum"]
J --> K["Byte-exact files<br/>or partial recovery"]
F -.-> L["Printed appendix:<br/>format + decoder"]Each printed cell carries several grey levels at the printer’s native resolution, which is what fits megabytes onto an A4 sheet. Two layers of protection stack up. Error correction inside each page repairs stains and scratches; an erasure code across pages rebuilds the archive even when a whole page is lost. A printed appendix holds the format specification, a reading procedure and the full decoder source, a few hundred lines that need nothing beyond common Python libraries. That appendix is what keeps the archive readable on the day today’s software is gone.
The print-and-scan channel is noisy in several ways at once: toner spreads, density varies, scanners rotate, scale and blur, and the paper stretches unevenly. The reader first fixes the global geometry from the corner marks, then absorbs local stretch with markers spread across the page, and estimates the printed grey levels from the page itself, with no dependence on the printer’s settings. If the final checksum fails, it still returns every complete file that sits before the damaged region.



What the numbers say
One page carries 383,469 bytes of payload, about 49 bits/mm² over the sheet and 59 over the data grid. The four test archives, photo, video, voice and text, weigh from 0.91 to 8.30 MB and take 5 to 25 pages. All of them were restored byte for byte, with no error-correction failure and one page lost in each. Clean pages needed under 0.01 % of bytes corrected; on pages damaged by stains and scratches, the decoder corrected at most 0.90 %.
For the text, I took the Mémoires d’outre-tombe, in the public domain: 5.43 million characters, about 1,357 typeset pages, which fit on 10 pages, parity included. In degraded mode, an archive cut to a quarter still returned 1.42 MB of its 5.58 MB of text, and the decoder accepted rotated scans, 600 dpi and JPEG input.
What it is worth, and what is missing
Everything is simulated. The figures come from a software model of laser-printer and scanner defects, stains, scratches and one lost page per archive; I have not yet run a single physical print-and-scan test. There was only one run, with a fixed seed, on four archives, and the lost page was always the same one. A sweep over defect severity, scan resolution and paper is still to be done.
Nothing has been measured on the physical side: neither the long-term ageing of paper and toner, nor how easy it is to read the decoder back from paper. Lastly, the body text of the appendix depends on a system font.
Technical details
Archive sizes: photo 2.86 MB → 10 pages; video (800 × 600, 24 s, with sound) 8.30 MB → 25 pages; voice 0.91 MB → 5 pages; text 5.58 MB → 10 pages. Each archive includes 2 to 4 parity pages.


Stack
Python · NumPy · SciPy · Pillow · reedsolo · ReportLab · soundfile · ffmpeg · Tesseract (OCR-B)
Topics
Licensed under CC BY 4.0
How to cite
Boris Dupoux. (2026). Codex — High-Density Archiving of Media on Paper. borisdupoux.com. https://borisdupoux.com/research/codex-paper-archive/
Related content
Back to Applied ResearchPreviousExplainable Processing Atoms for Documents & Data
