LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

tinifier

CLI tool for compressing images via TinyPNG API

TLDR

Compress all images in a directory
$ tinifier --api-key [KEY] [./images/]
copy
Compress recursively with 4 threads
$ tinifier -t 4 -r --api-key [KEY] [./images/]
copy
Compress preserving file modification time and EXIF data
$ tinifier --preserve-time --api-key [KEY] [photo.png]
copy
Compress only specific file extensions
$ tinifier --api-key [KEY] --ext [png,webp] [./images/]
copy
Skip files with less than 5% size reduction
$ tinifier --api-key [KEY] --skip-if-diff-less [5] [./images/]
copy
Keep original files alongside compressed versions
$ tinifier --api-key [KEY] --keep-original-file [./images/]
copy

SYNOPSIS

tinifier [options] path...

DESCRIPTION

tinifier compresses images using the TinyPNG API with parallel processing. It supports PNG, JPEG, WebP, and AVIF files. Multiple API keys can be provided for automatic switching when quotas are exceeded. The tool can recursively scan directories and preserves original file metadata on request.

PARAMETERS

-k, --api-key KEY

TinyPNG API key. Multiple keys separated by commas for automatic switching when quotas are exceeded.
-t, --threads N
Number of parallel threads (default: 16).
-r, --recursive
Search for files in listed directories recursively.
-e, --ext EXTENSIONS
File extensions to compress (default: png,jpeg,jpg,webp,avif).
-p, --preserve-time
Preserve the original file modification date/time including EXIF data.
--keep-original-file
Leave the original uncompressed file alongside the compressed one.
--skip-if-diff-less N
Skip files if compression saves less than N percent (default: 1).
--max-errors N
Maximum number of errors before stopping (default: 10, 0 to disable).
--retry-attempts N
Number of retry attempts for operations (default: 3).
--delay-between-retries DURATION
Delay between retry attempts (default: 1s).
-c, --config-file PATH
Path to a configuration file.

INSTALL

yay -S tinifier
copy

CAVEATS

Requires a TinyPNG API key (free tier: 500 compressions/month). Files are uploaded to TinyPNG servers for compression. Network connectivity is required.

HISTORY

tinifier was created by tarampampam and is written in Go.

SEE ALSO

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid