Git Product home page Git Product logo

imagemin-mozjpeg's Introduction

imagemin-mozjpeg Build Status Build status

mozjpeg imagemin plugin

Install

$ npm install --save imagemin-mozjpeg

Usage

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

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

API

imageminMozjpeg([options])(buffer)

Returns a promise for a buffer.

options

quality

Type: number

Compression quality. Min and max are numbers 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
notrellis

Type: boolean
Default: false

Disable trellis optimization.

notrellisDC

Type: boolean
Default: false

Disable trellis optimization of DC coefficients.

tune

Type: string
Default: hvs-psnr

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

noovershoot

Type: boolean
Default: false

Disable black-on-white deringing via overshoot.

arithmetic

Type: boolean
Default: false

Use arithmetic coding.

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 kbytes.

buffer

Type: buffer

Buffer to optimize.

License

MIT © imagemin

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.