{"id":18322211,"url":"https://github.com/kikuchan/libqrean","last_synced_at":"2025-06-11T21:37:53.354Z","repository":{"id":212489711,"uuid":"731128271","full_name":"kikuchan/libqrean","owner":"kikuchan","description":"A portable QR and Barcode generation / manipulation library written in C.","archived":false,"fork":false,"pushed_at":"2024-02-17T08:40:48.000Z","size":10714,"stargazers_count":92,"open_issues_count":0,"forks_count":6,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-06-09T10:47:43.381Z","etag":null,"topics":["arduino","barcode","c","code39","code93","ean","itf","jan","microqr","mqr","nw7","qr","qrcode","rmqr","tqr"],"latest_commit_sha":null,"homepage":"https://github.com/kikuchan/libqrean","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kikuchan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-12-13T12:18:29.000Z","updated_at":"2025-05-15T09:00:37.000Z","dependencies_parsed_at":"2025-04-05T23:31:14.568Z","dependency_job_id":"a1b53a94-6ec9-4ca5-9551-9a6d7760142c","html_url":"https://github.com/kikuchan/libqrean","commit_stats":null,"previous_names":["kikuchan/libqrean"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/kikuchan/libqrean","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kikuchan%2Flibqrean","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kikuchan%2Flibqrean/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kikuchan%2Flibqrean/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kikuchan%2Flibqrean/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kikuchan","download_url":"https://codeload.github.com/kikuchan/libqrean/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kikuchan%2Flibqrean/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259346649,"owners_count":22843765,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arduino","barcode","c","code39","code93","ean","itf","jan","microqr","mqr","nw7","qr","qrcode","rmqr","tqr"],"created_at":"2024-11-05T18:23:47.247Z","updated_at":"2025-06-11T21:37:53.332Z","avatar_url":"https://github.com/kikuchan.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"QR and Barcode library `libqrean`\n----\n\n# What's this?\n\nA portable QR and Barcode generation / manipulation library written in **C**.\n\n![animation](https://github.com/kikuchan/libqrean/assets/445223/1fdf9b2f-df63-4c0e-8cd6-a72633f2abc3)\n![rmqr-animation](https://github.com/kikuchan/libqrean/assets/445223/e56d97b3-24a3-44d2-8ee3-d0f4339c6157)\n\n# DEMO\n\n[Wasm](https://kikuchan.github.io/libqrean/wasm/) (thanks @taisukef)\n\n\n# CLI Usage\n## Generation\n```\n% qrean -t rmqr Hello\n███████████████████████████████\n██ ▄▄▄▄▄ █ ▀ █ █ █▄█ █▄█▄█▄▄ ██\n██ █   █ ██▄ ▄█▀▄▄  ▄▄   ▀█ ▄██\n██ █▄▄▄█ ██▀▀▀▄█▄▄█▀█▄   █▀▀▄██\n██▄▄▄▄▄▄▄█▄██ ▄ ▀▄█▀▀█▀▄ ▄▄▄ ██\n██ ▄▀▀ ▀▄ ▄█▄███▀▀▄▄▀▄▀▄ █▄█ ██\n██▄▄▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄▄▄▄▄██\n▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀\n% qrean -t mQR Hello \u003e mqr.png     # CAVEAT: Outputs PNG stream for not a tty\n% qrean -o qr.png Hello            # You can also specify output filename\n% qrean -h\nUsage: qrean [OPTION]... [STRING]\nGenerate QR/Barcode image\n\n  General options:\n    -h                Display this help\n    -o FILENAME       Image save as FILENAME\n    -i FILENAME       Data read from FILENAME\n    -f FORMAT         Output format, one of the following:\n                          TXT    (default for tty)\n                          PNG    (default for non tty)\n                          PPM\n    -t CODE           Output CODE, one of the following:\n                          QR, mQR, rMQR, tQR\n                          EAN13, EAN8, UPCA\n                          CODE39, CODE93\n                          ITF, NW7\n    -p PADDING        Comma-separated PADDING for the code\n\n  QR family specific options:\n    -v VERSION        Use VERSION, one of the following:\n                          1 ... 40           (for QR)\n                          M1 ... M4          (for mQR)\n                          R7x43 ... R17x139  (for rMQR)\n                            R{H}x{W}\n                              H: 7, 9, 11, 13, 15, 17\n                              W: 43, 59, 77, 99, 139\n                          tQR                (for tQR)\n    -m MASK           Use MASK pattern, one of the following:\n                          0 ... 7            (for QR)\n                          0 ... 4            (for mQR)\n    -l LEVEL          Use ecc LEVEL, one of the following:\n                          L, M, Q, H         (for QR)\n                          L, M, Q            (for mQR)\n                             M,    H         (for rMQR)\n```\n## Detection\n```\n% qrean-detect qr.png   # The source file must be a PNG file so far\nHello\n%\n```\n\n# Library Usage\n```c\nqrean_t qrean = create_qrean(QREAN_CODE_TYPE_QR);\nqrean_write_string(\u0026qrean, \"Hello, world\", QREAN_DATA_TYPE_AUTO);\n\nsize_t len = qrean_read_bitmap(\u0026qrean, buffer, sizeof(buffer), 8);\nfwrite(buffer, 1, len, stdout);\n```\n\n```c\nqrean_write_pixel(\u0026qrean, qrean.canvas.symbol_width - 1, qrean.canvas.symbol_height - 1, 0);\nqrean_fix_errors(\u0026qrean);\n\nqrean_read_string(\u0026qrean, buffer, sizeof(buffer));\nprintf(\"%s\\n\", buffer);\n```\n\n```c\nqrean_t *qrean = new_qrean(QREAN_CODE_TYPE_QR);\nqrean_set_qr_version(qrean, QR_VERSION_3);\nqrean_set_qr_errorlevel(qrean, QR_ERRORLEVEL_M);\nqrean_set_qr_maskpattern(qrean, QR_MASKPATTERN_7);\n\nqrean_write_qr_finder_pattern(qrean);\nqrean_write_qr_alignment_pattern(qrean);\nqrean_write_qr_timing_pattern(qrean);\nqrean_write_qr_format_info(qrean);\nqrean_write_qr_version_info(qrean);\n```\n\nSee [examples/](examples/) directory for working examples.\n\n\n# JavaScript / TypeScript Usage (Powered by Wasm)\n\n```js\nimport { Qrean } from 'qrean';\n\nconst qrean = new Qrean();\nconst img = await qrean.encode('Hello, world');\nconsole.log(img);\n// {\n//   width: 116,\n//   height: 116,\n//   data: Uint8ClampedArray(53824) [\n//    :\n\nconst { detected } = await qrean.detect(img);\nconsole.log(detected[0].text);\n// Hello, world\n```\n\nIt requires Wasm to run, but don't worry, most engines support it; Node, Deno, Bun and browsers.\n\n# Install\n\n## As a CLI\n\n* Windows\n  - Download from [Release Page](https://github.com/kikuchan/libqrean/releases)\n* UNIX-like systems (Linux / macOS / *BSD)\n  - Just `make install`\n\n## As a JavaScript / TypeScript library\n\n```sh\n% npm install qrean\n```\n\n## As a C library for embedded systems\n\nTake a look at [src/](src/) and include (or copy) them!\n\n# Why?\n\nAs you can see, you can take control.\nI love QR and Barcodes.\n\nThe core (encode/decode) doesn't rely on `malloc()` for portability. It uses a stack instead of a heap, but you can still use `new_qrean` for example if you prefer.\n\nYou can also configure a callback to draw a pixel directly on a screen for example.\n\n# Supported codes\n\n| type                | encode | decode | detect\n|---------------------|--------|--------|-----------\n| QR                  | ✓      | ✓      | ✓\n| mQR                 | ✓      | ✓      | ✓\n| rMQR                | ✓      | ✓      | ✓\n| tQR                 | ✓      | ✓      | ✓\n| UPCA / EAN13 / EAN8 | ✓      | ✓      | ✓\n| CODE39              | ✓      | ✓      | ✓\n| CODE93              | ✓      | ✓      | ✓\n| NW7                 | ✓      | ✓      | ✓\n| ITF                 | ✓      | ✓      | ✓\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkikuchan%2Flibqrean","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkikuchan%2Flibqrean","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkikuchan%2Flibqrean/lists"}