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

imagemin-mozjpeg

Package Overview
Dependencies
Maintainers
2
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

imagemin-mozjpeg

mozjpeg imagemin plugin

  • 3.1.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created

What is imagemin-mozjpeg?

The imagemin-mozjpeg npm package is a plugin for Imagemin that compresses JPEG images using the MozJPEG encoder. It is designed to reduce the file size of JPEG images while maintaining high visual quality, making it ideal for web optimization and other scenarios where image size is a concern.

What are imagemin-mozjpeg's main functionalities?

Basic JPEG Compression

This feature allows you to compress JPEG images using the default settings of the MozJPEG encoder. The code sample demonstrates how to use imagemin-mozjpeg to compress all JPEG images in the 'images' directory and save the optimized images to the 'output' directory.

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

(async () => {
    await imagemin(['images/*.jpg'], {
        destination: 'output',
        plugins: [
            imageminMozjpeg()
        ]
    });
    console.log('Images optimized');
})();

Custom Quality Compression

This feature allows you to specify the quality of the JPEG compression. The code sample demonstrates how to use imagemin-mozjpeg with a custom quality setting of 75, which balances file size and image quality.

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

(async () => {
    await imagemin(['images/*.jpg'], {
        destination: 'output',
        plugins: [
            imageminMozjpeg({ quality: 75 })
        ]
    });
    console.log('Images optimized with custom quality');
})();

Progressive JPEG Compression

This feature enables progressive JPEG compression, which allows images to be displayed incrementally as they are downloaded. The code sample demonstrates how to use imagemin-mozjpeg to compress images with the progressive option enabled.

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

(async () => {
    await imagemin(['images/*.jpg'], {
        destination: 'output',
        plugins: [
            imageminMozjpeg({ progressive: true })
        ]
    });
    console.log('Images optimized with progressive compression');
})();

Other packages similar to imagemin-mozjpeg

Keywords

FAQs

Package last updated on 21 Oct 2014

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