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

imagemin-optipng

Package Overview
Dependencies
Maintainers
7
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

imagemin-optipng

Imagemin plugin for OptiPNG

  • 8.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
529K
increased by1.13%
Maintainers
7
Weekly downloads
 
Created

What is imagemin-optipng?

The imagemin-optipng package is a plugin for Imagemin that uses the OptiPNG optimizer to compress PNG images. It helps in reducing the file size of PNG images without losing quality, making it ideal for web developers looking to optimize their images for faster loading times.

What are imagemin-optipng's main functionalities?

Basic PNG Optimization

This code demonstrates how to use imagemin-optipng to optimize PNG images in the 'images' directory and save the optimized images to the 'build/images' directory.

const imagemin = require('imagemin');
const imageminOptipng = require('imagemin-optipng');

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

Custom Optimization Level

This code shows how to set a custom optimization level for the PNG images. The optimizationLevel option can be set from 0 to 7, where higher values provide better compression but take more time.

const imagemin = require('imagemin');
const imageminOptipng = require('imagemin-optipng');

(async () => {
    await imagemin(['images/*.png'], {
        destination: 'build/images',
        plugins: [
            imageminOptipng({ optimizationLevel: 3 })
        ]
    });
    console.log('Images optimized with custom optimization level');
})();

Other packages similar to imagemin-optipng

Keywords

FAQs

Package last updated on 24 May 2020

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