Go to file
sz 75d6cfb77b
Some tiny css tweaks for the 0.6.1f release
Using innerHeight instead of outer, and getting rid of a white border
that showed up in testing.
2024-06-30 20:00:00 -05:00
.github/workflows Pin the emscripten/emsdk docker image 2023-06-10 00:15:56 -05:00
bitmap Add back a few test cases, add some comments, and check in the 5x5 tileset 2023-06-01 00:24:38 -05:00
samples@7443f61449 Use new samples submodule rev 2024-02-21 21:46:21 -06:00
src Decoder: when we known there's a mismatch between the fountain chunk size... 2024-03-02 04:21:11 -06:00
test Tweaks to Encoder default params 2024-02-09 02:19:39 -06:00
web Some tiny css tweaks for the 0.6.1f release 2024-06-30 20:00:00 -05:00
.gitignore ok 2020-11-27 18:06:37 -06:00
.gitmodules Ignore local changes to the samples submodule. 2020-08-20 23:43:56 -05:00
CMakeLists.txt More warnings \o/ 2023-05-31 21:22:52 -05:00
DETAILS.md Update docs for mode B! 2024-02-21 21:53:06 -06:00
LICENSE
PERFORMANCE.md Cleanup some includes/comments 2024-02-21 21:53:06 -06:00
README.md Update sample image in README 2024-02-21 21:53:07 -06:00
TODO.md Update docs for mode B! 2024-02-21 21:53:06 -06:00
WASM.md Update docs for mode B! 2024-02-21 21:53:06 -06:00
package-cimbar-html.py Post cimbar_js.html as part of package build. 2022-07-17 22:59:46 -05:00
package-portable-linux.sh Tweak to make package-portable-linux slightly less docker dependent 2024-01-11 02:05:49 -06:00
package-wasm.sh Less && in package-wasm, so we can re-run the script with (some) impunity 2024-02-21 21:53:06 -06:00

README.md

INTRODUCTION | ABOUT | CFC | LIBCIMBAR

DETAILS | PERFORMANCE | TODO

libcimbar: Color Icon Matrix Barcodes

Behold: an experimental barcode format for air-gapped data transfer.

It can sustain speeds of 850 kilobits/s (~106 KB/s) using just a computer monitor and a smartphone camera!

Explain?

The encoder outputs an animated barcode to a computer or smartphone screen:

While the decoder is a cell phone app that uses the phone camera to read the animated barcode:

No internet/bluetooth/NFC/etc is used. All data is transmitted through the camera lens. You can try it out yourself, or take my word that it works. :)

How does it work?

cimbar is a high-density 2D barcode format. Data is stored in a grid of colored tiles -- bits are encoded based on which tile is chosen, and which color is chosen to draw the tile. Reed Solomon error correction is applied on the data, to account for the lossy nature of the video -> digital decoding. Sub-1% error rates are expected, and corrected.

libcimbar, this optimized implementation, includes a simple protocol for file encoding built on fountain codes (wirehair) and zstd compression. Files of up to 33MB (after compression!) are encoded in a series of cimbar codes, which can be output as images or a live video feed. Once enough distinct image frames have been decoded successfully, the file will be reconstructed and decompressed successfully. This is true even if the images are received out of order, or if some have been corrupted or are missing.

Platforms

The code is written in C++, and developed/tested on amd64+linux, arm64+android (decoder only), and emscripten+WASM (encoder only). It probably works, or can be made to work, on other platforms.

Crucially, because the encoder compiles to asmjs and wasm, it can run on anything with a modern web browser. For offline use, you can either install cimbar.org as a progressive web app, or download the latest release of cimbar_js.html, save it locally, and open it in your web browser.

Library dependencies

OpenCV and GLFW (+ OpenGL ES headers) must be installed before building. All other dependencies are included in the source tree.

Build

  1. install opencv and GLFW. On ubuntu/debian, this looks like:
sudo apt install libopencv-dev libglfw3-dev libgles2-mesa-dev
  1. run the cmake + make incantation
cmake .
make -j7
make install

By default, libcimbar will try to install build products under ./dist/bin/.

To build cimbar.js (what cimbar.org uses), see WASM.

Usage

Encode:

  • large input files may fill up your disk with pngs!
./cimbar --encode -i inputfile.txt -o outputprefix

Decode (extracts file into output directory):

./cimbar outputprefix*.png -o /tmp

Decode a series of encoded images from stdin:

echo outputprefix*.png | ./cimbar -o /tmp

Encode and animate to window:

./cimbar_send inputfile.pdf

You can also encode a file using cimbar.org, or the latest release.

Performance numbers

PERFORMANCE

Implementation details

DETAILS

Room for improvement/next steps

TODO

Inspiration

Would you like to know more?

INTRODUCTION | ABOUT