GitHub Hot Board

GitHub Hot Board · Archive du dépôt

sz3/libcimbar

Optimized implementation for color-icon-matrix barcodes (Cette description provient du dépôt lui-même.)

C++#barcode#cpp17#fountain-codes

Données au October 29sz3

Meilleur rang

#465

Tous temps · C++ par langue

6.5K

Étoiles totales

486

Forks totaux

0

Jours classés (30 j)

Licence: MPL-2.0Dernier push: October 29Issues ouvertes (PR incl.): 39Collecté depuis 2026-10-25 ; inconnu = pas encore récolté

Documentation du projet

INTRODUCTION | ABOUT | CFC | LIBCIMBAR

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 (linux dev)

  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/.

Build (windows MSVC + vcpkg)

Install Visual Studio with the Desktop development with C++ workload, CMake 3.14 or newer, and vcpkg. Set VCPKG_ROOT to the vcpkg checkout, then configure and build from PowerShell:

cmake -S . -B build-windows -A x64 "-DCMAKE_TOOLCHAIN_FILE=$env:VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake"
cmake --build build-windows --config Release --target cimbar_send cimbar_recv cimbar_recv2 --parallel
cmake --install build-windows --config Release

The included vcpkg.json installs OpenCV, GLFW, and ANGLE during configuration. The executables and their runtime DLLs are installed under ./dist/bin/.

Note: native Windows is supported on a "best efforts" basis, so things may be a bit more buggy. (primary dev is for linux/android)

Build wasm (cimbar.js)

To build cimbar.js (what cimbar.org uses), see WASM. Or use the latest release.

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

Community Tools

  • cimbar-bigfile — A pure-frontend wrapper that splits files into multiple parallel encode_id streams (10–15 MB chunks per stream), and ships a manifest.json for SHA256-verified reassembly. Supports 100+ MB files. No changes to libcimbar or cfc required.

Inspiration

Would you like to know more?

Classements actuels

Évolution sur 30 jours

Aucun classement au cours des 30 derniers jours.

Mettez le badge dans votre README · sz3/libcimbar[![Mettez le badge dans votre README](https://git.vaiox.xyz/api/badge/sz3/libcimbar.svg)](https://git.vaiox.xyz/fr/repo/sz3/libcimbar)

Badge · 任何仓库都可以挂 —— 未上榜的仓库显示灰章,上完榜会自动点亮。

<a href="https://git.vaiox.xyz/fr/repo/sz3/libcimbar"><img src="https://git.vaiox.xyz/api/badge/sz3/libcimbar.svg" alt="Mettez le badge dans votre README" height="20"></a>

← Retour aux classements

GitHub Hot BoardMachine à remonter le tempsDécouvrir联系我们 · Contact