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

imagemin-jpegtran

Package Overview
Dependencies
Maintainers
1
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

  • 8.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
255K
increased by3.37%
Maintainers
1
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 25 Sep 2024

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