A utility to resample images.
vips
This is a soft requirement. Instead of linkinglibvips
,
this app usesvips
CLI app to resize images. If it's not available in$PATH
, it will default toimaging
— a pure image processing library written in golang. It uses unfortunately a lot more RAM and CPU than vips.
Usage: imgz <command>
Flags:
-h, --help Show context-sensitive help.
--debug Enable debug logging
--version Show version and exit
Commands:
resize <image-path>
Resize an image
resize-dir --output-dir=STRING <source-dirs> ...
Resize a folder of images
Usage: imgz resize <image-path>
Resize an image
Arguments:
<image-path> Path to image. Use "-" for stdin
Flags:
-h, --help Show context-sensitive help.
--debug Enable debug logging
--version Show version and exit
-o, --output=STRING Path to output file. Use "-" for stdout. Defaults to $sourceDir/resized/$source.jpg or stdout if input is stdin
--max-size=5000
--quality=75
Example:
imgz resize --max-length 5000 --quality 80 img.jpg -o out.jpg
Usage: imgz resize-dir --output-dir=STRING <source-dirs> ...
Resize a folder of images
Arguments:
<source-dirs> ... List of paths to image folders
Flags:
-h, --help Show context-sensitive help.
--debug Enable debug logging
--version Show version and exit
-o, --output-dir=STRING Dir to save zip files
--max-size=5000 Max side length of resized images
--quality=75 JPEG quality
--clean Delete source dirs after resizing
imgz resize-dir --max-length 5000 --quality 80 --output-dir /output --clean ./sourcefolder1 ./sourcefolder2 ./sourcefolder3