Payments, login flows, restaurant menus, Wi-Fi sharing, tickets, product packaging, device pairing, authentication, links. They have become one of those technologies that quietly works almost everywhere.
QR Code is mature, standardized, extremely well optimized, and surprisingly resilient.
Why are we still representing data using only two visible states when the cameras scanning these codes can distinguish millions of colors?
Modern cameras, displays, image processing, and computing hardware are far more capable than when QR Code was originally designed.
What happens if a QR-inspired matrix code uses four reliably distinguishable visual states instead of two?
QuadQR is an experimental open-source 2D matrix-code format that uses Red, Green, Blue, and White as its four data states.
2 bits per data cell RGBW color calibration perspective correction camera scanning image scanning Reed-Solomon error correction confidence-assisted error recovery spectral-spatial interleaving CRC integrity checking optional AES-256-GCM encrypted payloads password and raw-key security modes multiple scanner-safe visual styles Node.js and browser APIs CLI support npm distribution benchmark tooling a documented wire format
| Color | Bits | | ----- | ---- | | Red | 00 | | Green | 01 | | Blue | 10 | | White | 11 |
There is no base-3 encoding, fractional packing, or unusual bit arithmetic required.
Using more colors sounds attractive because, mathematically, more states can carry more information.
A perfect (255, 0, 0) red pixel can become something completely different because of:
ambient lighting shadows reflections display brightness camera white balance printer ink paper color JPEG compression sensor noise exposure viewing angle screen color calibration
The more colors you add, the closer those states become in color space and the easier they are to confuse.
So instead of chasing the maximum theoretical density, I wanted a small set of colors with strong separation.
Black remains useful for structural information such as finder patterns, timing structures, and alignment references.
square overall matrix square modules three large finder patterns timing structures alignment references quiet zone masking error correction structured data placement
The major experiment happens primarily in the data representation and decoding pipeline.
Instead of interpreting data cells as black or white, QuadQR reconstructs the geometry and then classifies each payload position as:
