Convert PNG to ICO in memory
$ npm install --save to-ico
const fs = ;const toIco = ;const files =fsfs;;
Array of PNG image buffers.
The images must have a size of
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 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 library. If you have a colormap PNG you can convert it to an RGB/RGBA PNG with commonly used image editing tools.
Use the largest image and resize to sizes defined using the sizes option.
[16, 24, 32, 48, 64, 128, 256]
Array of sizes to use when resizing.
- to-ico-cli - CLI for this module
MIT © Kevin Martensson