imagemin-mozjpeg
mozjpeg image-min plugin
Last updated 11 years ago by kevva .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install imagemin-mozjpeg 
SYNC missed versions from official npm registry.

imagemin-mozjpeg Build Status

Imagemin plugin for mozjpeg

Install

$ npm install imagemin-mozjpeg

Usage

const imagemin = require('imagemin');
const imageminMozjpeg = require('imagemin-mozjpeg');

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

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

API

imageminMozjpeg([options])(buffer)

Returns a Promise<Buffer>.

options

quality

Type: number

Compression quality, in range 0 (worst) to 100 (perfect).

progressive

Type: boolean
Default: true

false creates baseline JPEG file.

targa

Type: boolean
Default: false

Input file is Targa format (usually not needed).

revert

Type: boolean
Default: false

Revert to standard defaults instead of mozjpeg defaults.

fastCrush

Type: boolean
Default: false

Disable progressive scan optimization.

dcScanOpt

Type: number
Default: 1

Set DC scan optimization mode.

  • 0 One scan for all components
  • 1 One scan per component
  • 2 Optimize between one scan for all components and one scan for 1st component plus one scan for remaining components
trellis

Type: boolean
Default: true

Trellis optimization.

trellisDC

Type: boolean
Default: true

Trellis optimization of DC coefficients.

tune

Type: string
Default: hvs-psnr

Set Trellis optimization method. Available methods: psnr, hvs-psnr, ssim, ms-ssim

overshoot

Type: boolean
Default: true

Black-on-white deringing via overshoot.

arithmetic

Type: boolean
Default: false

Use arithmetic coding.

dct

Type: string
Default: int

Set DCT method:

  • int Use integer DCT
  • fast Use fast integer DCT (less accurate)
  • float Use floating-point DCT
quantBaseline

Type: boolean
Default: false

Use 8-bit quantization table entries for baseline JPEG compatibility.

quantTable

Type: number

Use predefined quantization table.

  • 0 JPEG Annex K
  • 1 Flat
  • 2 Custom, tuned for MS-SSIM
  • 3 ImageMagick table by N. Robidoux
  • 4 Custom, tuned for PSNR-HVS
  • 5 Table from paper by Klein, Silverstein and Carney
smooth

Type: number

Set the strength of smooth dithered input. (1...100)

maxMemory

Type: number

Set the maximum memory to use in kilobytes.

sample

Type: string[]

Set component sampling factors. Each item should be in the format HxV, for example 2x1.

buffer

Type: buffer

Buffer to optimize.

License

MIT © Imagemin

Current Tags

  • 10.0.0                                ...           latest (3 years ago)

15 Versions

  • 10.0.0                                ...           3 years ago
  • 9.0.0                                ...           5 years ago
  • 8.0.0                                ...           6 years ago
  • 7.0.0                                ...           7 years ago
  • 6.0.0                                ...           9 years ago
  • 5.1.0                                ...           10 years ago
  • 5.0.0                                ...           10 years ago
  • 4.0.0                                ...           10 years ago
  • 3.1.0                                ...           10 years ago
  • 3.0.0                                ...           10 years ago
  • 2.0.0                                ...           10 years ago
  • 1.0.0                                ...           10 years ago
  • 0.1.2                                ...           11 years ago
  • 0.1.1                                ...           11 years ago
  • 0.1.0                                ...           11 years ago
Downloads
Today 0
This Week 0
This Month 3
Last Day 0
Last Week 3
Last Month 0
Dependencies (3)
Dev Dependencies (2)
Dependents (2)

Copyright 2013 - present © cnpmjs.org | Home |