🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

reduce-image

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reduce-image

Lossy recompression and resizing tool for images when file size is more important than quality

0.0.3
latest
Source
npm
Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

Reduce Image Tool

Purpose

Reduce Image Tool optimizes image files at the expense of resolution and quality. The goal is to produce images barely tolerable for mobile web browsing.

Usage

reduce-image --source-path PATH --dest-path PATH [--max-width WIDTH] [--max-height HEIGHT] \
    [--min-size-reduction 0-100] [--quality 0-100] [--flexible-format] \
    [--force-direct-color-output-format gif|jpg|png|webp] \
    [--force-indexed-color-output-format gif|jpg|png|webp] \
    [--direct-color-bit-depth 1|2|4|8|15|16|18|24] [--indexed-color-bit-depth 1-8] \
    [--jpeg-blur 0.1-100] [--force-png-to-indexed] [--force-png-to-jpg] \
    [--recursive] [--verbose]

Options

OptionDescription
--dest-path PATHSave processed images to PATH
--direct-color-bit-depth DEPTHReduce/quantize colors of direct color images to DEPTH bits (1, 2, 4, 8, 15, 16, 18, 24)
--flexibleFormatIf specified, allow output file to be saved in different format if it produces a smaller file
--force-direct-color-output-format FORMATSave all direct color images in FORMAT format (gif, jpg, png, webp)
--force-indexed-color-output-format FORMATSave all indexed color images in FORMAT format (gif, jpg, png, webp)
--force-png-to-indexedIf specified, convert all PNG files into indexed color depth
--force-png-to-jpgIf specified, convert all direct color PNG files to JPGs
--indexed-color-bit-depth DEPTHReduce/quantize indexed color images to DEPTH bits (1-8)
--jpeg-blur BLURBlur jpeg images before compression for better compression ratio (0.1-100)
--max-height HEIGHTLimit image height to HEIGHT pixels; resize implied
--max-width WIDTHLimit image width to WIDTH pixels; resize implied
--min-size-reduction PERCENTAlways reduce image size at least PERCENT percent (0-100), even for images which size is within maxWidth and maxHeight boundaries
--quality QUALITYSet default compression quality to QUALITY (0-100; 0 - worst, 100 - best)
--source-path PATHRead images from PATH
--recursiveScan source-path recursively
--verboseOutput more

How It Works

Reduce Image Tool iterates recursively through the files and subdirectories in sourcePath, resizing and recompressing any image it can find, and saving the resulting images to destPath.

Supported Formats

  • PNG
  • GIF
  • JPG
  • WEBP
  • SVG

Exit Codes

On successful run, exit code 0 is returned. Otherwise, exit code 1 is used.

License

BSD 3-clause License

Keywords

image

FAQs

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