Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

imagemin-jpeg-recompress

Package Overview
Dependencies
Maintainers
6
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

imagemin-jpeg-recompress

jpeg-recompress imagemin plugin

  • 7.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4.5K
increased by0.49%
Maintainers
6
Weekly downloads
 
Created
Source

imagemin-jpeg-recompress

jpeg-recompress imagemin plugin

Install

$ npm install --save imagemin-jpeg-recompress

Usage

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

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

	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.

Keywords

FAQs

Package last updated on 26 Jan 2023

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc