{"id":13620592,"url":"https://github.com/tsoding/bng","last_synced_at":"2025-09-10T08:40:30.206Z","repository":{"id":91697917,"uuid":"292820729","full_name":"tsoding/bng","owner":"tsoding","description":"BNG Image Format Implementation","archived":false,"fork":false,"pushed_at":"2020-09-19T05:44:01.000Z","size":179,"stargazers_count":11,"open_issues_count":4,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-02T21:22:56.704Z","etag":null,"topics":["hacktoberfest","hacktoberfest2020"],"latest_commit_sha":null,"homepage":"","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/tsoding.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}},"created_at":"2020-09-04T10:35:10.000Z","updated_at":"2024-08-10T05:00:27.000Z","dependencies_parsed_at":"2024-01-14T04:58:08.269Z","dependency_job_id":"4184a4b1-cfb8-421a-bb80-d27086c660f8","html_url":"https://github.com/tsoding/bng","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tsoding/bng","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsoding%2Fbng","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsoding%2Fbng/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsoding%2Fbng/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsoding%2Fbng/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tsoding","download_url":"https://codeload.github.com/tsoding/bng/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsoding%2Fbng/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273377691,"owners_count":25094624,"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","status":"online","status_checked_at":"2025-09-03T02:00:09.631Z","response_time":76,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["hacktoberfest","hacktoberfest2020"],"created_at":"2024-08-01T21:00:57.466Z","updated_at":"2025-09-03T02:20:09.081Z","avatar_url":"https://github.com/tsoding.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"# Extending Native Browser Capabilities with WebAssembly\n\n## Quick Start\n\n```console\n$ make -B\n$ python -m SimpleHTTPServer 8080\n$ iexplorer.exe http://localhost:8080/bng.html\n```\n\n## Research Notes\n\n- [x] Premise: Performance of WASM is probably comparable to native code\n  - [x] Let's check it by implementing a Prime Number Crunching as a \"Benchmark\":\n    - [x] https://github.com/tsoding/prime-benchmark\n- [ ] Idea: Let's imagine we invented a new image format that didn't exist before\n  - [ ] If we implement the image support in WASM can we make it feel like a native browser support\n    - [x] [Implement png2bng](./png2bng.c)\n    - [x] [Implement bngviewer](./bngviewer.c)\n    - [x] Implement bng support in WASM\n      - [x] fetch(\"tsodinw.bng\"):\n        ```js\n          fetch(\"./tsodinw.bng\").then((x) =\u003e console.log(x.arrayBuffer()))\n        ```\n      - [x] Put the fetched file into WASM memory\n        ```js\n          let bngFile = await fetch(\"tsodinw.bng\");\n          let fileData = await bngFile.arrayBuffer();\n          let memory = new WebAssembly.Memory({initial: 10, maximum: 10});\n          new Uint8Array(memory.buffer).set(new Uint8Array(fileData));\n        ```\n      - [x] Call a WASM function that turns the file into Image Data\n      - [x] Take out the Image Data from WASM memory and display it\n    - [x] Add more interesting features to bng to test the support\n      - [x] Different pixel formats\n      - [x] Different compressions\n    - [ ] Reusable BNG library that works both natively and being compiled to WASM\n      - [ ] Check out this article: https://surma.dev/things/c-to-webassembly/\n    - [ ] img tag integration\n      - [ ] Check out object URLs: https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsoding%2Fbng","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftsoding%2Fbng","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsoding%2Fbng/lists"}