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

imagemin-pngquant

Package Overview
Dependencies
Maintainers
6
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

imagemin-pngquant

Imagemin plugin for `pngquant`

  • 10.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
372K
decreased by-4.53%
Maintainers
6
Weekly downloads
 
Created

What is imagemin-pngquant?

The imagemin-pngquant package is a plugin for Imagemin that uses pngquant to compress PNG images. It is designed to reduce the file size of PNG images while maintaining quality, making it useful for web developers and designers who need to optimize images for faster loading times.

What are imagemin-pngquant's main functionalities?

Basic PNG Compression

This feature allows you to compress PNG images using the pngquant algorithm. The quality option specifies the range of quality to maintain during compression.

const imagemin = require('imagemin');
const imageminPngquant = require('imagemin-pngquant');

(async () => {
    await imagemin(['images/*.png'], {
        destination: 'build/images',
        plugins: [
            imageminPngquant({
                quality: [0.6, 0.8]
            })
        ]
    });
    console.log('Images optimized');
})();

Custom Quality Settings

This feature allows you to set custom quality settings for the PNG compression. The quality range can be adjusted to balance between file size and image quality.

const imagemin = require('imagemin');
const imageminPngquant = require('imagemin-pngquant');

(async () => {
    await imagemin(['images/*.png'], {
        destination: 'build/images',
        plugins: [
            imageminPngquant({
                quality: [0.3, 0.5]
            })
        ]
    });
    console.log('Images optimized with custom quality settings');
})();

Speed Optimization

This feature allows you to optimize the speed of the compression process. The speed option can be set from 1 (slowest, best quality) to 11 (fastest, worst quality).

const imagemin = require('imagemin');
const imageminPngquant = require('imagemin-pngquant');

(async () => {
    await imagemin(['images/*.png'], {
        destination: 'build/images',
        plugins: [
            imageminPngquant({
                speed: 1
            })
        ]
    });
    console.log('Images optimized with speed setting');
})();

Other packages similar to imagemin-pngquant

Keywords

FAQs

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