@fiahfy/icns-convert
v0.0.12
Published
Convert Image to Apple Icon Image format
Downloads
284
Readme
icns-convert
Convert Image to Apple Icon Image format.
Installation
npm install @fiahfy/icns-convert
Usage
import fs from 'fs'
import { convert } from '@fiahfy/icns-convert'
const buf = fs.readFileSync('input.png') // image must be squre, 1024x1024 pixels or larger
convert(buf).then((data) => {
fs.writeFileSync('output.icns', data)
})
Specify image for each size
const bufs = [
fs.readFileSync('16x16.png'),
fs.readFileSync('32x32.png'),
fs.readFileSync('64x64.png'),
fs.readFileSync('128x128.png'),
fs.readFileSync('256x256.png'),
fs.readFileSync('512x512.png'),
fs.readFileSync('1024x1024.png'),
]
convert(bufs).then((data) => {
fs.writeFileSync('output.icns', data)
})
CLI
npm install -g @fiahfy/icns-convert
icns-convert icon.png
or use via npx
npx @fiahfy/icns-convert icon.png