ChromaCode is a 2D barcode system that stores data in a square grid of coloured pixels.
Unlike traditional QR codes that use only black and white, ChromaCode uses 8 distinct colours to encode data, allowing it to store up to three times more information than a standard QR code of the same size. It uses white, cyan, magenta, yellow, red, green, blue and black. Each coloured pixel encodes more information than a binary (black/white) pixel, significantly increasing data density.
Note
This script generates Version-2 ChromaCode with Medium amount of Error Correction
- Up to 78 characters per ChromaCode
- 15% error correction capability
- 8-colour multi-bit pixel encoding
- Similar enough to QR Code
| Feature | QR Code | ChromaCode |
|---|---|---|
| Colours Used | 2 (Black, White) | 8 Colours |
| Data Density | Low | High |
| Pixel Type | Binary | Multi-valued |
| Maximum Char | 26 Chars | 78 Chars |
- Language: Python
- Libraries Used: Python Imaging Library (PIL)
- Concepts Used:
- Colour-based symbol mapping
- Image generation and processing
- Reed-Solomon error correction
- Galois Field arithmetic
- Polynomial handling
- Clone the repository
git clone https://github.com/sdswoc/ChromaCode.git- Install PIL
pip install pillow- Run main,py
python main.pyA string (of maximum 78 characters), of which the ChromaCode is to be generated, is divided into three nearly equal parts. Each part is made into its own QR Code. These three black-white QR Codes are coloured forming cyan-white, magenta-white and yellow-white QRs which are overlayed on top of wach other to get a complete and working ChromaCode.
A ChromaCode, while scanning, is read in all three channels (R, G, B). In red channel, a QR code emerges which was the cyan-white and scanning that provides the first part of the data. This is repeated for blue and green channels to get magenta-white and yellow-white. Reading the three QRs and concatinate them to get the orignal data back.