{"id":13548208,"url":"https://github.com/kevva/to-ico","last_synced_at":"2025-04-05T05:09:21.995Z","repository":{"id":57377363,"uuid":"56486549","full_name":"kevva/to-ico","owner":"kevva","description":"Convert PNG to ICO in memory","archived":false,"fork":false,"pushed_at":"2020-05-03T07:12:55.000Z","size":50,"stargazers_count":136,"open_issues_count":4,"forks_count":19,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-12-17T04:03:04.986Z","etag":null,"topics":["buffer","converter","ico","nodejs","png"],"latest_commit_sha":null,"homepage":null,"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/kevva.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":"2016-04-18T07:30:12.000Z","updated_at":"2024-10-25T00:44:44.000Z","dependencies_parsed_at":"2022-09-26T16:41:47.616Z","dependency_job_id":null,"html_url":"https://github.com/kevva/to-ico","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevva%2Fto-ico","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevva%2Fto-ico/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevva%2Fto-ico/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevva%2Fto-ico/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kevva","download_url":"https://codeload.github.com/kevva/to-ico/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247289429,"owners_count":20914464,"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":["buffer","converter","ico","nodejs","png"],"created_at":"2024-08-01T12:01:07.172Z","updated_at":"2025-04-05T05:09:21.980Z","avatar_url":"https://github.com/kevva.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# to-ico [![Build Status](https://travis-ci.org/kevva/to-ico.svg?branch=master)](https://travis-ci.org/kevva/to-ico)\n\n\u003e Convert PNG to ICO in memory\n\n\n## Install\n\n```\n$ npm install --save to-ico\n```\n\n\n## Usage\n\n```js\nconst fs = require('fs');\nconst toIco = require('to-ico');\n\nconst files = [\n\tfs.readFileSync('unicorn-16x16.png'),\n\tfs.readFileSync('unicorn-32x32.png')\n];\n\ntoIco(files).then(buf =\u003e {\n\tfs.writeFileSync('favicon.ico', buf);\n});\n```\n\n\n## API\n\n### toIco(input, [options])\n\n#### input\n\nType: `Array` `string`\n\nArray of PNG image buffers.\n\nThe images must have a size of `16x16`, `24x24`, `32x32`, `48x48`, `64x64`, `128x128` or `256x256` and they must have an 8 bit per sample (channel) bit-depth (on Unix you can check this with the `file` command: RGB(A) is supported, while [colormap](https://en.wikipedia.org/wiki/Indexed_color) is not, because it's 8 bits per pixel instead of 8 bits per channel, which is 24 or 32 bits per pixel depending on the presence of the alpha channel). These are limitations in the underlying [`pngjs`](https://github.com/lukeapage/pngjs#pngjs) library. If you have a colormap PNG you can convert it to an RGB/RGBA PNG with commonly used image editing tools.\n\n#### options\n\n##### resize\n\nType: `boolean`\u003cbr\u003e\nDefault: `false`\n\nUse the largest image and resize to sizes defined using the [sizes](#sizes) option.\n\n##### sizes\n\nType: `Array`\u003cbr\u003e\nDefault: `[16, 24, 32, 48, 64, 128, 256]`\n\nArray of sizes to use when resizing.\n\n\n## Related\n\n* [to-ico-cli](https://github.com/kevva/to-ico-cli) - CLI for this module\n\n\n## License\n\nMIT © [Kevin Martensson](http://github.com/kevva)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkevva%2Fto-ico","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkevva%2Fto-ico","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkevva%2Fto-ico/lists"}