Socket
Socket
Sign inDemoInstall

imagemin-pngquant

Package Overview
Dependencies
343
Maintainers
2
Versions
29
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    imagemin-pngquant

pngquant imagemin plugin


Version published
Weekly downloads
398K
increased by5.5%
Maintainers
2
Created
Weekly downloads
 

Readme

Source

imagemin-pngquant Build Status Build status

pngquant imagemin plugin

Install

$ npm install --save imagemin-pngquant

Usage

var Imagemin = require('imagemin');
var pngquant = require('imagemin-pngquant');

var imagemin = new Imagemin()
	.src('images/*.png')
	.dest('build/images')
	.use(pngquant({ quality: '65-80', speed: 4 }));

imagemin.run(function (err, files) {
	if (err) {
		throw err;
	}

	console.log('Files optimized successfully!'); 
});

You can also use this plugin with gulp:

var gulp = require('gulp');
var pngquant = require('imagemin-pngquant');

gulp.task('default', function () {
	return gulp.src('images/*.png')
		.pipe(pngquant({ quality: '65-80', speed: 4 }))
		.pipe(gulp.dest('build/images'));
});

Options

floyd

Type: Number
Default: 0.5

Controls level of dithering (0 = none, 1 = full).

nofs

Type: Boolean
Default: false

Disable Floyd-Steinberg dithering.

posterize

Type: Number
Default: undefined

Reduce precision of the palette by number of bits. Use when the image will be displayed on low-depth screens (e.g. 16-bit displays or compressed textures).

quality

Type: String
Default: undefined

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 100 (perfect), similar to JPEG.

speed

Type: Number
Default: 3

Speed/quality trade-off from 1 (brute-force) to 10 (fastest). Speed 10 has 5% lower quality, but is 8 times faster than the default.

verbose

Type: Boolean
Default: false

Print verbose status messages.

License

MIT © imagemin

Keywords

FAQs

Last updated on 21 Oct 2014

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc