Custom 2D Barcodes

2024-11-11

I have made a 2D barcode format that is as basic as it gets. No orientation squares, no error correction other than for correcting misread brightness values. Just a 1bpp, 2bpp or 4bpp pixel grid.

The main use is for converting archives to images to be printed, mailed and scanned to "remote airgapped devices" in a fast way. The lack of orientation marks makes them useless for scanning with a camera.

I thought about calling them slow response codes or high density multi-file barcodes but for now I'm just going to call it a custom 2D barcode. I made some basic python3 scripts for encoding and decoding.

I will link an archive containing the scripts, a README and a test file.

How they work

The Python code reads in a file that the user specifies as a list of bytes, splits each byte into 1, 2 or 4-bit chunks depending on the mode (1bpp, 2bpp, 4bpp), assigns each possible value of that chunk to a

brightness value and then arranges everything into a grid with the width specified by the user. The final step is to export the grayscale PNG with a user-specified filename.