Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/steambap/png-to-ico
convert png to ico format
https://github.com/steambap/png-to-ico
cli converter ico image image-processing png png-converter png-icon
Last synced: 16 days ago
JSON representation
convert png to ico format
- Host: GitHub
- URL: https://github.com/steambap/png-to-ico
- Owner: steambap
- License: mit
- Created: 2016-09-13T01:48:25.000Z (about 8 years ago)
- Default Branch: main
- Last Pushed: 2024-04-22T11:50:44.000Z (7 months ago)
- Last Synced: 2024-10-01T09:39:28.906Z (about 1 month ago)
- Topics: cli, converter, ico, image, image-processing, png, png-converter, png-icon
- Language: JavaScript
- Homepage:
- Size: 549 KB
- Stars: 162
- Watchers: 4
- Forks: 22
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# png-to-ico
[![Build Status](https://github.com/steambap/png-to-ico/workflows/CI/badge.svg)](https://github.com/steambap/png-to-ico/actions?workflow=CI)
> convert png to windows ico format
## Translations
[中文](README_CN.md)## intro
![image](assets/png-to-ico.gif)## install
> npm install --save-dev png-to-ico## usage
npm script:
```
png-to-ico electron.png > app.ico
```npx script:
```
npx png-to-ico -- electron.png > app.ico
```
This way you can run the script without installing the package into your projectprogramming usage:
```JavaScript
const fs = require('fs');
const pngToIco = require('png-to-ico');pngToIco('electron.png')
.then(buf => {
fs.writeFileSync('app.ico', buf);
})
.catch(console.error);
```If you want to control what sizes should be in the icon file, pass an array of files:
```JavaScript
pngToIco(['electron16x16.png', 'electron32x32.png'])
.then(buf => {
fs.writeFileSync('app.ico', buf);
});
```## Why use png-to-ico?
When I work on an electron project, it's always a nightmare to create ico for windows.
There're so many options out there like apps that make icon for you, photoshop plugin. But none of them satisfy me.
I want a JavaScript module that works like the .NET ico tool, which automatically generate different sizes for ico file.Based on [pngjs](https://github.com/lukeapage/pngjs):
Simple PNG encoder/decoder library written entirely in JavaScript for Node, with zero external or native dependencies.
In other words, png-to-ico is written purely in JavaScript, which is great for windows user.## license
[MIT](LICENSE)