Skip to content

Latest commit

 

History

History
38 lines (21 loc) · 971 Bytes

README.md

File metadata and controls

38 lines (21 loc) · 971 Bytes

TinyPNG Batch Script

Image batch compression script written using TinyPNG API.

How to use

  1. Go to tinypng.com to apply for API-Key

  2. Fill in the API-Key into /index.js

    // index.js Line 30
    tinify.key = "Your TinyPNG API-KEY";
  3. Use yarn install to install dependency packages

  4. Place the images that need to be compressed and built in the /entry directory, which supports folders

  5. Run the command yarn build or node index.js

  6. Wait for the execution to complete and the output results will be in the /output folder.

Support image formats: ["png", "jpeg", "webp"]

More usage

Example preview

  • Before image(868 KB) ./entry/example.webp

  • After image(90 KB, Optimization rate 964%) ./entry/example.webp