0.0.3 • Published 10 years ago

reduce-image v0.0.3

Weekly downloads
4
License
Apache-2.0
Repository
github
Last release
10 years ago

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