Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nimpacker/icon
Icon file generator for Windows, macOS, Web
https://github.com/nimpacker/icon
Last synced: 3 months ago
JSON representation
Icon file generator for Windows, macOS, Web
- Host: GitHub
- URL: https://github.com/nimpacker/icon
- Owner: nimpacker
- Created: 2020-04-30T16:24:15.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-02-23T06:50:52.000Z (11 months ago)
- Last Synced: 2024-05-16T03:39:55.100Z (9 months ago)
- Language: Nim
- Homepage:
- Size: 666 KB
- Stars: 16
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- Awesome - Icon - Icon file generator for Windows, macOS, Web. (Development / Icons)
README
# icon
Generate an icon files from **PNG** files.
port of typescript project [akabekobeko/npm-icon-gen](https://github.com/akabekobeko/npm-icon-gen)
## Support formats
Supported the output format of the icon are following.
| Platform | Icon |
| -------: | ----------------------------------- |
| Windows | `app.ico` or specified name. |
| macOS | `app.icns` or specified name. |
| Favicon | `favicon.ico` and `favicon-XX.png`. |## Installation
```
$ nimble install https://github.com/bung87/icon
```## Usage
``` Nim
import icon/icns
import asyncdispatch
import sequtilslet dir = getTempDir()
let images = icns.REQUIRED_IMAGE_SIZES.map(proc (size:int):ImageInfo{.closure.} =
let filePath = getCurrentDir() / "./examples/data" / $size & ".png"
result = ImageInfo( size:size, filePath:filePath )
)
let path = waitfor generateICNS(images,dir)
# or generateICNSAsync(images, dir)import asyncdispatch
import icon/ico
import sequtilslet images = ico.REQUIRED_IMAGE_SIZES.map(proc (size: int): ImageInfo{.closure.} =
let filePath = root / "./examples/data" / $size & ".png"
echo filePath
result = ImageInfo(size: size, filePath: filePath)
)
let path = generateICO(images, dir)
# or generateICOAsync(images, dir)
```