jpeg-recompress imagemin plugin
Clone or download
Latest commit 5a39f6e Jun 9, 2016
Permalink
Failed to load latest commit information.
.editorconfig Tweaks May 11, 2016
.gitattributes Tweaks May 11, 2016
.gitignore Remove unneeded rule Aug 20, 2014
.travis.yml Tweaks May 11, 2016
appveyor.yml Tweaks May 11, 2016
fixture-corrupt.jpg Bump AVA version and improve tests Apr 29, 2016
fixture.jpg Add `strip` option Jun 9, 2016
index.js Add `strip` option Jun 9, 2016
license Tweaks Feb 9, 2015
package.json 5.1.0 Jun 9, 2016
readme.md Add `strip` option Jun 9, 2016
test.js Add `strip` option Jun 9, 2016

readme.md

imagemin-jpeg-recompress Build Status Build status

jpeg-recompress imagemin plugin

Install

$ npm install --save imagemin-jpeg-recompress

Usage

const imagemin = require('imagemin');
const imageminJpegRecompress = require('imagemin-jpeg-recompress');

imagemin(['images/*.jpg'], 'build/images', {
	plugins: [
		imageminJpegRecompress()
	]
}).then(() => {
	console.log('Images optimized');
});

API

imageminJpegRecompress([options])(buffer)

options

accurate

Type: boolean
Default: false

Favor accuracy over speed.

quality

Type: string
Default: medium

Set a quality preset. Available presets: low, medium, high and veryhigh.

method

Type: string
Default: ssim

Set comparison method. Available methods: mpe, ssim, ms-ssim and smallfry.

target

Type: number
Default: 0.9999

Set target quality.

min

Type: number
Default: 40

Minimum JPEG quality.

max

Type: number
Default: 95

Maximum JPEG quality.

loops

Type: number
Default: 6

Set the number of attempts.

defish

Type: number
Default: 0

Set defish strength.

progressive

Type: boolean
Default: true

Enable progressive encoding.

subsample

Type: string
Default: default

Set subsampling method. Available values: default, disable.

strip

Type: boolean
Default: true

Strips metadata, such as EXIF data.

buffer

Type: buffer

Buffer to optimize.

License

MIT © imagemin