{"id":26949613,"url":"https://github.com/catdad-experiments/to-bmp","last_synced_at":"2025-10-05T00:47:45.723Z","repository":{"id":57100875,"uuid":"300073090","full_name":"catdad-experiments/to-bmp","owner":"catdad-experiments","description":"🍦 encode jpg and png images to bmp","archived":false,"fork":false,"pushed_at":"2021-01-29T05:08:36.000Z","size":38,"stargazers_count":3,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-17T20:59:01.892Z","etag":null,"topics":["bmp","encoder","jpg","nsis","png"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/catdad-experiments.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}},"created_at":"2020-09-30T21:57:43.000Z","updated_at":"2023-06-30T07:27:39.000Z","dependencies_parsed_at":"2022-08-20T21:10:45.153Z","dependency_job_id":null,"html_url":"https://github.com/catdad-experiments/to-bmp","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catdad-experiments%2Fto-bmp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catdad-experiments%2Fto-bmp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catdad-experiments%2Fto-bmp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catdad-experiments%2Fto-bmp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/catdad-experiments","download_url":"https://codeload.github.com/catdad-experiments/to-bmp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246899656,"owners_count":20851899,"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","encoder","jpg","nsis","png"],"created_at":"2025-04-02T22:16:46.327Z","updated_at":"2025-10-05T00:47:40.680Z","avatar_url":"https://github.com/catdad-experiments.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @catdad/to-bmp\n\n[![Build Status][travis.svg]][travis.link] [![NPM Downloads][npm-downloads.svg]][npm.link] [![NPM Version][npm-version.svg]][npm.link]\n\n[travis.svg]: https://travis-ci.com/catdad-experiments/to-bmp.svg?branch=master\n[travis.link]: https://travis-ci.com/catdad-experiments/to-bmp\n[npm-downloads.svg]: https://img.shields.io/npm/dm/@catdad/to-bmp.svg\n[npm.link]: https://www.npmjs.com/package/@catdad/to-bmp\n[npm-version.svg]: https://img.shields.io/npm/v/@catdad/to-bmp.svg\n\n\u003e Convert JPG or PNG images to BMP\n\nThis module was specifically created to generate BMP images that are compatible with NSIS in order to create [splash images for Electron portable applications](https://github.com/electron-userland/electron-builder/issues/2548), when I discovered that various popular encoders did not produce images that could be used within NSIS. The encoder in this module is based on [`@wokwi/bmp-ts`](https://github.com/wokwi/bmp-ts).\n\n## Install\n\n```bash\nnpm install @catdad/to-bmp\n```\n\n## API\n\n```javascript\nconst { promises: fs } = require('fs');\nconst toBmp = require('@catdad/to-bmp');\n\n(async () =\u003e {\n  const jpeg = await fs.readFile('./path/to/my.jpg');\n  const output = await toBmp(jpeg);\n\n  await fs.writeFile('./path/to/my.bmp', output);\n})();\n```\n\n## CLI\n\nConvert a local image (JPG or PNG) to BMP:\n\n```bash\nnpx @catdad/to-bmp \u003c input.jpg \u003e output.bmp\n```\n\nConvert an image (JPG or PNG) from a url to BMP:\n\n```bash\nnpx @catdad/to-bmp https://example.com/input.png \u003e output.bmp\n```\n\nYou can use these to generate the splash image for your Electorn app directly in a `postinstall` or `prepackage` script.\n\n## Related\n\n* [`@wokwi/bmp-ts`](https://github.com/wokwi/bmp-ts) - the original code that the encoder here is based on\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcatdad-experiments%2Fto-bmp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcatdad-experiments%2Fto-bmp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcatdad-experiments%2Fto-bmp/lists"}