New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

image-compressor-cli

Package Overview
Dependencies
Maintainers
0
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

image-compressor-cli

A batch image compressor cli based on [tinify](https://www.npmjs.com/package/tinify) and [sharp](https://www.npmjs.com/package/sharp), it will compress images and **replace them** by default.

latest
Source
npmnpm
Version
1.0.9
Version published
Maintainers
0
Created
Source

image-compressor-cli

A batch image compressor cli based on tinify and sharp, it will compress images and replace them by default.

install

npm install -g image-compressor-cli

Usage

Set your tinify api key

go to tinify and get your api key

Execute with follow command to set your api key,

image-compressor-cli config -k <your-tinify-api-key>

and you can useimage-compressor-cli config --show to view your current api key.
Then you can use the following commands to compress images

Currently, the images compressed by Tinify (jpg, jpeg, png, webp) are not supported custom quality, so you can only use the default quality.

To define static images(bmp, tiff, gif) quality

image-compressor-cli --quality 80

To define gif images quality (2 - 256)

image-compressor-cli --colors 128

To define a specific output directory rather than replacing images

image-compressor-cli --output-dir ./output

All set by default

image-compressor-cli

Options:

  -V, --version                 output the version number
  -q, --quality <number>        Set Sharp static image quality (default: 80)
  -c, --colors <number>         Set gif image maximum number of palette entries, including transparency, between 2 and
                                256 (default: 128)
  -o, --output-dir <directory>  Specify a custom output directory
  -h, --help                    display help for command

Commands:
  config [options]              API key configuration management
  help [command]                display help for command

supported extensions

supported extensionsnotes
jpglossy compression
jpeglossy compression
pnglossless compression
tifflossless compression
webplossy compression
giflossy compression

p.s.

  • Please TEST before large scale compression
  • WebP is generally smaller and higher quality than JPEG and PNG formats, so pay attention to the selection of compression parameters when compressing to prevent image distortion caused by over-compression.

Keywords

jpeg

FAQs

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