Colour buys capacity in exchange for illumination.

Research

8 min read

POLYCHROME CODES

What a polychrome barcode actually gains, what it gives up, and the one problem it might solve that nothing else does.

The preceding two articles established a budget: roughly one kilobyte of usable payload in a QR code sized for an identity card, of which 960 bytes is the measured floor for a face that a matcher can still use. The first examined the payload; the second examined the physical channel. Everything else, including metadata, signature and framing, competes for what remains. The competition is already tight with a 72-byte ECDSA signature.

An obvious way to widen the budget is to stop encoding one bit per module.

The arithmetic, and why it is three and not eight

A monochrome module carries one bit. A module drawn from a palette of P distinguishable colours carries log₂(P) bits.

That logarithm is the central arithmetic. Four colours double capacity. Eight colours triple it. A palette of 256 reliably distinguishable colours would carry eight bits per module in principle, but the optical discrimination problem becomes much harder long before that point.

Meanwhile, the probability of misreading a module grows with how crowded the palette becomes in colour space. Doubling the palette halves the average distance between neighbouring entries while adding one bit. Capacity scales logarithmically; the discrimination problem scales geometrically.

This helps explain why JAB Code focuses on four or eight colours.

JAB Code, short for Just Another Barcode, was developed by Fraunhofer SIT on behalf of Germany’s Federal Office for Information Security, published as open source under LGPL v2.1, and standardised as ISO/IEC 23634:2022. It uses four or eight colours: the CMYK primaries cyan, magenta, yellow and black, plus blue, red, green and white as secondaries. Eight colours can provide roughly three times the data density of a binary symbol at equal module count. JAB Code also supports symbol cascading and non-square shapes, and one of its intended applications is digitally signed document content that can be verified offline with a phone.

Three times one kilobyte is three kilobytes. That is a meaningful change in what a card can carry.

What the extra capacity would actually buy

Applied to the budget from part one, roughly 3 KB opens three options that are currently mutually exclusive:

  • A larger face. Moving from 960 bytes to 2 KB moves comfortably clear of the accuracy threshold and improves the compact image for human review, which is where the compact-image approach is weakest.
  • A second modality. An ISO/IEC 39794-2 fingerprint minutiae record fits easily and has a standardized interchange format with cross-vendor interoperability testing, unlike proprietary face templates.
  • A post-quantum signature. ML-DSA-44 produces a 2,420-byte signature. That does not fit in a monochrome QR sized for a card at any error-correction level. It exceeds the version 40 capacity at level H, and a card-sized symbol is far smaller than version 40.

The third is the interesting one. Credentials issued now will be presented for the next five to ten years, into the period where classical signatures are scheduled for deprecation. A card-mounted credential that carries a post-quantum signature is, on current monochrome capacity, arithmetically impossible.

Colour capacity may be the difference between a post-quantum card credential existing and not existing. That framing is more useful than “three times the data”, and it is the argument worth testing rather than the marketing one.

What colour gives up

The costs are real and they are concentrated in the verification environment, which is the part of the system the issuer controls least.

Illumination. A monochrome decoder needs to separate light from dark, a decision that is relatively tolerant of changes in illumination. A colour decoder must identify which palette entry a module belongs to, and the apparent colour of a printed patch is the product of the ink and the light falling on it. Tungsten, fluorescent and LED sources at various correlated colour temperatures, daylight through a window, and mixed sources all shift the observed values. The decoder must estimate and compensate for those shifts, typically using reference modules embedded in the symbol. Those modules consume capacity and are themselves subject to distortion.

The camera’s own pipeline. This is the least obvious problem and possibly the most severe. Phone cameras apply automatic white balance before the decoder sees anything, and the algorithm is tuned for photographs of scenes, not for colour metrology. Many capture and image pipelines also expose or encode chroma at lower spatial resolution than luminance. In 4:2:0 sampling, one pair of chroma values represents a 2 by 2 block of luma samples. A decoder asked to distinguish eight colours per module must therefore be evaluated against the actual capture path, not only against pristine RGB images.

Printing. Monochrome symbols survive almost any marking process. Colour requires a calibrated colour process, and gamut varies by printer, ink set and substrate. Dot gain distorts colour differently than it distorts a binary threshold, because overlapping inks change hue rather than merely blurring edges.

Card personalisation. This is a hard constraint rather than a difficulty. High-security ID-1 cards are commonly personalised by laser engraving into polycarbonate, which carbonises the material to produce marks that are inherently monochrome. A polychrome symbol is not produced by that personalisation method. It can be pre-printed, but pre-printing cannot carry per-holder data, which is the entire point of the credential.

Reproduction. A QR code survives photocopying, faxing, greyscale printing and monochrome thermal receipt printers. A polychrome symbol does not survive any of them. Where credentials are copied, re-issued as printouts or transmitted through legacy document workflows, this eliminates the format.

Human fallback. Roughly eight percent of men of northern European descent have some form of colour vision deficiency. This does not affect machine decoding, but it does affect the accessibility of any human-facing element of a colour-coded system, and it is a question a public-sector issuer will be asked.

Where the honest comparison sits

Colour is one of several ways to widen a byte budget, and it should be compared against the others rather than adopted on its capacity figure alone.

  • Smaller modules with better optics. Module size is limited by the reading device, not by physics. As phone cameras improve, the monochrome budget grows without any change to the symbology or the printing process. This option costs nothing and arrives on its own schedule.
  • Symbol cascading. Multiple linked symbols multiply capacity exactly, at the cost of card area and a slightly more complex scan interaction. JAB Code supports it; so do several monochrome symbologies.
  • A smaller payload. Better compression of the face, a more compact metadata schema, or a signature scheme with smaller output. JPEG XL remains unevaluated in the cited NIST work below one kilobyte. FN-DSA produces signatures near 666 bytes where a platform can accommodate its more demanding implementation requirements.
  • Accepting that a card is not the only medium. A credential displayed on a phone screen has different constraints, and screens reproduce colour more consistently than paper does. They introduce moiré and brightness problems of their own.

Colour is strongest where the medium is printed, colour-capable, read under controlled or at least predictable illumination, and where the payload genuinely will not fit otherwise. Pharmaceutical packaging and document authentication fit that description better than a laser-engraved national identity card.

An open experiment

None of the above resolves the question this article exists to raise, and the resolving experiment is not large. Proposed, for anyone with a colour printer, a lightbox and a few phones:

  1. Establish the real capacity ratio. Encode identical payloads as QR and as eight-colour JAB Code at equal physical dimensions and equal nominal error correction. Measure the achieved payload, not the theoretical one, after reference modules and palette metadata are accounted for.
  2. Sweep the illuminant. Decode both under tungsten, fluorescent, warm and cool LED, daylight and mixed sources, at several illuminance levels. Report decode rate per condition. This is the measurement that decides the question, and it is the one least often published.
  3. Sweep the device. Colour performance is a function of the camera’s white-balance and chroma-subsampling behaviour, which varies by model and by operating system version. A result on one phone is not a result.
  4. Vary the substrate. Coated card stock, uncoated paper, laminated card, thermal receipt paper. Include a photocopy of each as a negative control.
  5. Age the samples. Abrasion and ultraviolet exposure affect inks differentially. One channel may fade before the others, moving palette entries in colour space rather than merely blurring them. The failure mode of an aged colour symbol may therefore differ from that of an aged monochrome one, and we are not aware of published data covering this full comparison.
  6. Test the actual target payload. A signed compact face at 960 bytes plus metadata plus an ML-DSA-44 signature, which is the configuration that monochrome cannot carry. Does it decode reliably at card dimensions, or does the capacity gain evaporate into the error correction that colour needs to survive the illumination problem?

The sixth item is the whole question. Everything before it is instrumentation.

The trade, stated plainly

Eight colours can triple the payload. They also make the decoder dependent on a variable that the issuer cannot fully specify or control: the spectrum of the light in the room.

For a credential presented once, at a known desk, under fixed lighting, that dependency is manageable and the capacity is worth having. For a credential presented anywhere, by anyone, on any device, for ten years, it is a new failure mode introduced to solve a byte shortage that has other solutions.

Whether the post-quantum signature requirement changes that balance is, as far as we can determine, unpublished. It is a good question for someone with a printer.


References

  1. ISO/IEC 23634:2022: JAB Code polychrome bar code symbology specification
  2. JAB Code reference implementation, Fraunhofer SIT (LGPL v2.1)
  3. Fraunhofer SIT: colour barcode becomes ISO standard
  4. NIST SP 500-343: Preparation of Compact Face Images for 2D Barcodes
  5. ISO/IEC 15415: Bar code symbol print quality test specification, two-dimensional symbols
  6. FIPS 204: Module-Lattice-Based Digital Signature Standard

Related Articles

Three connected trust objects: a sealed glass sphere, a metal token and a ceramic credential card.

The other three questions.

Most cryptography education for children begins and ends with confidentiality. Integrity, authentication and credentials can be modelled with simple roles and objects, even as age-assurance systems make those properties part of children’s digital lives.

Paper envelope with a glass seal, metal key and ceramic blocks on a pale surface.

Cryptography can start before algebra.

Children can learn the questions cryptography answers before they can learn the mathematics behind its algorithms. Existing school materials teach secrecy well, but leave integrity, authentication, identity and trust comparatively unexplored.

Three compact containers of translucent glass, matte ceramic and machined metal arranged on a pale laboratory surface.

What “hardware-backed” means on Android.

Android exposes software, TEE-backed and StrongBox-backed keys through one keystore API. The effective security level, mandated algorithm set and available attestation evidence vary by device and release.