{"id":26784471,"url":"https://github.com/image-js/fast-bmp","last_synced_at":"2025-04-19T16:51:43.803Z","repository":{"id":50486832,"uuid":"76245397","full_name":"image-js/fast-bmp","owner":"image-js","description":"Library to encode BMP images","archived":false,"fork":false,"pushed_at":"2025-04-11T14:44:50.000Z","size":1207,"stargazers_count":4,"open_issues_count":4,"forks_count":1,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-04-11T15:47:42.707Z","etag":null,"topics":["bmp","image"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/image-js.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2016-12-12T10:16:27.000Z","updated_at":"2025-03-25T13:08:32.000Z","dependencies_parsed_at":"2025-04-04T07:27:33.082Z","dependency_job_id":"d67455ed-cc07-44bf-a546-99edfbe96a95","html_url":"https://github.com/image-js/fast-bmp","commit_stats":{"total_commits":49,"total_committers":4,"mean_commits":12.25,"dds":"0.16326530612244894","last_synced_commit":"94289d8673eb591b71d3de5af23ecc04e1b841d8"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/image-js%2Ffast-bmp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/image-js%2Ffast-bmp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/image-js%2Ffast-bmp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/image-js%2Ffast-bmp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/image-js","download_url":"https://codeload.github.com/image-js/fast-bmp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249742316,"owners_count":21318895,"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":["bmp","image"],"created_at":"2025-03-29T10:28:47.954Z","updated_at":"2025-04-19T16:51:43.798Z","avatar_url":"https://github.com/image-js.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fast-bmp\n\n\u003ch3 align=\"center\"\u003e\n\n  \u003ca href=\"https://www.zakodium.com\"\u003e\n    \u003cimg src=\"https://www.zakodium.com/brand/zakodium-logo-white.svg\" width=\"50\" alt=\"Zakodium logo\" /\u003e\n  \u003c/a\u003e\n\n  \u003cp\u003e\n    Maintained by \u003ca href=\"https://www.zakodium.com\"\u003eZakodium\u003c/a\u003e\n  \u003c/p\u003e\n\n[![NPM version][npm-image]][npm-url]\n[![Test coverage][codecov-image]][codecov-url]\n[![npm download][download-image]][download-url]\n\n\u003c/h3\u003e\n\nA library for encoding and decoding bmp image file format.\nReferences:\n\n- [Wikipedia BMP format page](https://en.wikipedia.org/wiki/BMP_file_format)\n- [Microsoft BMPV5 format page](https://learn.microsoft.com/en-us/windows/win32/api/wingdi/ns-wingdi-bitmapv5header)\n\n# Supported features\n\nThis library only supports V5 headers.\n\n- binary (1-bit per pixel)\n- greyscale (8-bits per pixel)\n- RGB (24-bits per pixel)\n- RGBA (32-bits per pixel)\n\n# Usage\n\n## Encoding\n\n```js\nimport { encode } from 'fast-bmp';\n\n// 0 0 0 0 0\n// 0 1 1 1 0\n// 0 1 0 1 0\n// 0 1 1 1 0\n// 0 0 0 0 0\nconst data = new Uint8Array([\n  0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0,\n]);\nconst imageData = {\n  width: 5,\n  height: 5,\n  data,\n  bitsPerPixel: 1,\n  components: 1,\n  channels: 1,\n};\n// Encode returns a Uint8Array.\nconst encoded = encode(imageData);\nfs.writeFileSync('image.bmp', encoded);\n```\n\n## Decoding\n\n```ts\nimport { decode } from 'fast-bmp';\n\n// 0 0 0 0 0\n// 0 1 1 1 0\n// 0 1 0 1 0\n// 0 1 1 1 0\n// 0 0 0 0 0\nconst buffer = fs.writeFileSync('image.bmp');\nconst imageData = decode(buffer);\n/* Returns object:\n{\nwidth: 5,\nheight: 5,\ndata: new Uint8Array([\n    0, 0, 0, 0, 0, \n    0, 1, 1, 1, 0, \n    0, 1, 0, 1, 0, \n    0, 1, 1, 1, 0, \n    0, 0, 0, 0, 0,\n  ]),\nbitsPerPixel: 1,\ncomponents: 1,\nchannels: 1,\ncolorMasks: [0x00ff0000, 0x0000ff00, 0x000000ff],\ncompression: 0,\nxPixelsPerMeter: 2835,\nyPixelsPerMeter: 2835,\n}\n*/\n```\n\n[npm-image]: https://img.shields.io/npm/v/fast-bmp.svg?style=flat-square\n[npm-url]: https://www.npmjs.com/package/fast-bmp\n[codecov-image]: https://img.shields.io/codecov/c/github/image-js/fast-bmp.svg?style=flat-square\n[codecov-url]: https://codecov.io/gh/image-js/fast-bmp\n[download-image]: https://img.shields.io/npm/dm/fast-bmp.svg?style=flat-square\n[download-url]: https://www.npmjs.com/package/fast-bmp\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimage-js%2Ffast-bmp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimage-js%2Ffast-bmp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimage-js%2Ffast-bmp/lists"}