upng imagemin plugin
npm install --save imagemin-upng
CLI
imagemin foo.png --plugin=upng > foo-optimized.png
API
import imagemin from 'imagemin'
import imageminUpng from 'imagemin-upng'
const files = await imagemin(['images/*.png'], {
destination: 'build/images',
plugins: [imageminUpng()],
})
console.log(files)
//=> [{data: <Buffer 89 50 4e …>, destinationPath: 'build/images/foo.jpg'}, …]
Returns a promise for a buffer.
Type: number
Default: 256
number of colors in the result (0 = lossless, 256 = lossy).
Type: Buffer
Buffer to optimize.