English | 中文
This is a cli tool to compress image quickly and effectively by using tinypng.
- compress ratio is 50% - 70%
- support to compress all images in directory recursively
- support to replace or dump compressed images
- support to avoid repeat compress
- support to display compress result
- support '.png', '.jpg', 'jpeg', '.webp'
tinypng-go images # compress images in directory and replace all of it.
tinypng-go logo.png -o logo-new.png # compress a single image
tinypng-go images -o imagesDir # compress images in directory and output to images in new directory
You can globally install this tool or use npx.
npx tinypng-go <filename or dirname> [OPTIONS]
npm install -g tinypng-go
yarn global add tinypng-go
check if you have installed
tinypng-go -v
tinypng-go <filename or directory> [OPTIONS]
-v, --version show current version
-o, --output <output> set output path
-m, --max [max] max async compress tasks(The higher the number, the faster the speed)
-a, --all force compress all images(include compressed images)
-h, --help show help for command
if you set max a big number,tasks will run faster, but the memory will cost more.
tinypng-go images # compress images in directory and replace all of it.
tinypng-go logo.png -o logo-new.png # compress a single image
tinypng-go images -o imagesDir # compress images in directory and output to images in new
tinypng-go images -m 30 # compress images in directory with max tasks 30