Imagemin plugin for `pngquant`
npm install imagemin-pngquant-chnThis is a branch created for developers who can't access raw.githubusercontent.com properly. If you have a good internet connection, we do not recommend using this package.
> Imagemin plugin for pngquant
```
$ npm install imagemin-pngquant-chn
`js
const imagemin = require('imagemin');
const imageminPngquant = require('imagemin-pngquant-chn');
(async () => {
await imagemin(['images/*.png'], {
destination: 'build/images',
plugins: [
imageminPngquant()
]
});
console.log('Images optimized');
})();
`
Returns Promise.
#### options
Type: object
##### speed
Type: number4
Default: 1
Values: (brute-force) to 11 (fastest)
Speed 10 has 5% lower quality, but is about 8 times faster than the default. Speed 11 disables dithering and lowers compression level.
##### strip
Type: booleanfalse
Default:
Remove optional metadata.
##### quality
Type: ArrayArray<0...1, 0...1>
Values: [0.3, 0.5]
Example:
Instructs pngquant to use the least amount of colors required to meet or exceed
the max quality. If conversion results in quality below the min quality the
image won't be saved.
Min and max are numbers in range 0 (worst) to 1 (perfect), similar to JPEG.
##### dithering
Type: number | boolean1
Default: (full)0...1
Values:
Set the dithering level using a fractional number between 0 (none) and 1 (full).
Pass in false to disable dithering.
##### posterize
Type: number
Truncate number of least significant bits of color (per channel). Use this when image will be output on low-depth displays (e.g. 16-bit RGB). pngquant will make almost-opaque pixels fully opaque and will reduce amount of semi-transparent colors.
##### verbose
Type: booleanfalse
Default:
Print verbose status messages.
#### input
Type: Buffer | Stream`
Buffer or stream to optimize.