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

imagemin-jpegtran

Package Overview
Dependencies
Maintainers
2
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

imagemin-jpegtran

jpegtran imagemin plugin

  • 3.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
253K
increased by3.43%
Maintainers
2
Weekly downloads
 
Created

What is imagemin-jpegtran?

The imagemin-jpegtran npm package is a plugin for the imagemin image optimization tool that specifically optimizes JPEG images using jpegtran. It is used to compress JPEG images without losing quality, making it ideal for web developers looking to reduce image file sizes for faster loading times.

What are imagemin-jpegtran's main functionalities?

Basic JPEG Optimization

This feature allows you to optimize JPEG images in a specified directory and output the optimized images to another directory. The code sample demonstrates how to use imagemin-jpegtran to compress JPEG images in the 'images' folder and save the optimized images in the 'output' folder.

const imagemin = require('imagemin');
const imageminJpegtran = require('imagemin-jpegtran');

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

Progressive JPEG Optimization

This feature allows you to create progressive JPEGs, which are images that load in successive waves of detail, improving the user experience on slow connections. The code sample shows how to enable the progressive option in imagemin-jpegtran.

const imagemin = require('imagemin');
const imageminJpegtran = require('imagemin-jpegtran');

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

JPEG Optimization with Arithmetic Coding

This feature allows you to use arithmetic coding for JPEG compression, which can result in smaller file sizes compared to Huffman coding. The code sample demonstrates how to enable arithmetic coding in imagemin-jpegtran.

const imagemin = require('imagemin');
const imageminJpegtran = require('imagemin-jpegtran');

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

Other packages similar to imagemin-jpegtran

Keywords

FAQs

Package last updated on 20 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