https://github.com/fiahfy/ico-convert
Convert Image to ICO file format.
https://github.com/fiahfy/ico-convert
converter ico
Last synced: about 1 month ago
JSON representation
Convert Image to ICO file format.
- Host: GitHub
- URL: https://github.com/fiahfy/ico-convert
- Owner: fiahfy
- License: mit
- Created: 2018-09-21T01:36:15.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T01:59:01.000Z (over 2 years ago)
- Last Synced: 2025-08-27T10:18:59.037Z (about 1 month ago)
- Topics: converter, ico
- Language: TypeScript
- Homepage:
- Size: 1.56 MB
- Stars: 10
- Watchers: 2
- Forks: 5
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ico-convert

> Convert Image to [ICO file format]().
## Installation
```bash
npm install @fiahfy/ico-convert
```## Usage
```js
import fs from 'fs'
import { convert } from '@fiahfy/ico-convert'const buf = fs.readFileSync('input.png') // image must be squre, 256x256 pixels or larger
convert(buf).then((data) => {
fs.writeFileSync('output.ico', data)
})
```### Specify image for each size
```js
const bufs = [
fs.readFileSync('16x16.png'),
fs.readFileSync('24x24.png'),
fs.readFileSync('32x32.png'),
fs.readFileSync('48x48.png'),
fs.readFileSync('64x64.png'),
fs.readFileSync('128x128.png'),
fs.readFileSync('256x256.png'),
]
convert(bufs).then((data) => {
fs.writeFileSync('output.ico', data)
})
```## CLI
```bash
npm install -g @fiahfy/ico-convert
ico-convert icon.png
```or use via npx
```bash
npx @fiahfy/ico-convert icon.png
```