A open source, python implementation of Aztec 2D barcode.
Aztec is a ISO/IEC 24778:2008 specified 2D Barcode specification. The primary advantage of Aztec is that it doesn't need a quiet zone surrounding the barcode.
I have not yet submitted it to pip so the only way to install this project would be by cloning (or using Download as ZIP from Github)
git clone https://github.com/ronniebasak/pyztec
cd pyztec
pip install -r requirement.txt
pip install .
Note: You need to write
pip install -e .
if you want to keep editing the project
Currently, you need a perfectly cropped and centered picture in order to be decoded, there is no correction of rotation nor reflection in any axis whatsoever.
Reed solomon error correction is present. So a slightly corrupted image data will hopefully be recovered. There is no support for Erasure detection. The current version brings support for Reed Solomon Erasure detection.
python aztec_decoder.py <image_path> <layers> [<channel>]
TIP: to calculate the number of layers, subtract 11 from the dimention (squares) and divide by 4 Channel: Which channel to the image exists in (0-R, 1-G, 2-B, 3-A)
python aztec_encoder.py <msg> <output_file>
TIP: We've only tested PNG output files so far.
This project aims to add a fast, standards compliant AZTEC barcode encoding and decoding support
It all started when I was boarding a plane and it was raining and an edge of my boarding pass got ripped. It still scanned flawlessly. This hit me, this is why airline industry uses Aztec and not QR. If the corner of a QR is ripped, the finder pattern is gone.
Anyways, I got intrigued and I tried to find open source implentation of Aztec Codec and couldn't find any. Had to watch this YT video https://www.youtube.com/watch?v=xtlqYx6e1TE, read a patent and go through wikipedia 8 times to even get started. the IEC paper costs more than I am willing to shell on a pet project. If someone have a copy, please send me
- Lowercase and Uppercase characters
- Digits
- Punctionation symbols
- Encoding shifts: When encoding an aztec code, after adding stuffed bits, it might be better shift to a higher layer, rather than staying in the same layer size. This is not yet supported, right now, we will remove ECC codewords to facilitate encoding
- FLG_N Escape sequences (ECI codes and FNC1)
- GS1 Compliant codes
- Binary data
- Non ASCII character sets
- They contain 1 extra ring.
- They contain 40 bit mode message instead of 28 bit
- They have upto 12 bits per symbol
- They contain a grid that needs to be erased and skipped while en/decoding
- Add Binary Data codec support
- Add Escape sequences support (including FNC1 and GS1 symbols)
- Add Non ASCII Charset support
- Add Full Aztec codec support (and seamlessly transition)
- Add mixed mode support (honestly, I have no clue why it exists)
- Recognition of finder pattern from an arbitrary image
- Add reflection/rotation detection and correction
- Add a better API for integration