Skip to content

igor-arkhipov/ico-convert

 
 

Repository files navigation

ico-convert

badge

Convert Image to ICO file format.

Installation

npm install @igor-arkhipov/ico-convert

Usage

import fs from 'fs'
import { convert } from '@igor-arkhipov/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

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

npm install -g @igor-arkhipov/ico-convert
ico-convert icon.png

or use via npx

npx @igor-arkhipov/ico-convert icon.png

About

Convert Image to ICO file format

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 61.4%
  • JavaScript 38.6%