0.2.0 • Published 3 years ago

imagemin-mozjpeg-jpegtran v0.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

imagemin-mozjpeg-jpegtran GitHub Actions Status

Imagemin plugin for jpegtran (mozjpeg version) command

Install

$ npm install imagemin-mozjpeg-jpegtran

Usage

const imagemin = require('imagemin');
const imageminMozjpegJpegtran = require('imagemin-mozjpeg-jpegtran');

(async () => {
	await imagemin(['images/*.jpg'], {
		destination: 'build/images',
		plugins: [
			imageminMozjpegJpegtran()
		]
	});

	console.log('Images optimized');
})();

API

imageminMozjpegJpegtran(options)(buffer)

Returns a Promise<Buffer>.

options

copy

Type: string Default: none

Set copy mode.

  • none Copy no extra markers from source file
  • comments Copy only comment markers
  • all Copy all extra markers
optimize

Type: boolean Default: true

Optimize Huffman table (smaller file, but slow compression)

progressive

Type: boolean Default: true

false creates baseline JPEG file.

revert

Type: boolean Default: false

Revert to standard defaults instead of mozjpeg defaults.

fastCrush

Type: boolean Default: false

Disable progressive scan optimization.

maxMemory

Type: number

Set the maximum memory to use in kilobytes.

buffer

Type: buffer

Buffer to optimize.

License

MIT © Imagemin, Hideo Matsumoto