Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fisker/imagemin-upng
upng imagemin plugin
https://github.com/fisker/imagemin-upng
imagemin
Last synced: 5 days ago
JSON representation
upng imagemin plugin
- Host: GitHub
- URL: https://github.com/fisker/imagemin-upng
- Owner: fisker
- License: mit
- Created: 2017-08-15T05:32:50.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2024-10-28T16:00:19.000Z (18 days ago)
- Last Synced: 2024-10-28T18:06:39.498Z (18 days ago)
- Topics: imagemin
- Language: JavaScript
- Size: 3.84 MB
- Stars: 3
- Watchers: 4
- Forks: 2
- Open Issues: 16
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# imagemin-upng
> upng imagemin plugin
## Install
```bash
npm install --save imagemin-upng
```## Usage
CLI
```bash
imagemin foo.png --plugin=upng > foo-optimized.png
```API
```js
import imagemin from 'imagemin'
import imageminUpng from 'imagemin-upng'const files = await imagemin(['images/*.png'], {
destination: 'build/images',
plugins: [imageminUpng()],
})console.log(files)
//=> [{data: , destinationPath: 'build/images/foo.jpg'}, …]
```## API
### imageminUpng([options])(buffer)
Returns a promise for a buffer.
#### options
##### cnum
Type: `number`
Default: `256`number of colors in the result (0 = lossless, 256 = lossy).
#### buffer
Type: `Buffer`
Buffer to optimize.