#image-compression #command-line-tool #image #api-key

bin+lib tinypng

Command line tool for compressing images using the TinyPNG API

2 releases

0.3.1 Dec 7, 2022
0.3.0 Nov 12, 2022
0.2.0 May 24, 2022
0.1.1 Mar 7, 2022
0.1.0 Mar 6, 2022

#615 in Compression

MIT license

13KB
219 lines

tinypng GitHub Workflow Status Crates.io

Command line tool for compressing images using the TinyPNG API

Install

Download the binary from the release page

Or use cargo to install

cargo install tinypng

Usage

  1. Register a KEY using your email at link

  2. Set TinyPNG API KEY

tinypng -k <KEY>
# Set API KEY successfully
# Your key is stored in ~/.config/tinypng/config.toml
  1. Compress images
tinypng ./test.png
# test.png: Origin: 1004.7 KB Compressed: 245.4 KB(75.6%)

# Glob
tinypng ./images/*.png
# images/test.png: Origin: 1.4 MB Compressed: 174.5 KB(87.8%)

Dependencies

~7–22MB
~291K SLoC