Skip to content
A Bash script for shrinking PNG files, using tinypng.com
Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md
tinypng

README.md

A Bash script for shrinking PNG/JPEG files, using tinypng.com

sha1sum: 6a4c4d06cec19b44c8b5512a1136468a7b7dce71

Buy Me a Coffee at ko-fi.com

Dependencies

Bash 4 ( and above ), and curl.

NAME
tinypng - Shrink PNG/JPEGs using tinypng.com service.

SYNOPSIS
tinypng [-dkph] -f FILE

DESCRIPTION
Shrink PNG/JPEGs using tinypng.com service.

On first execution, or if ~/.tinypng.apikey is not present, tinypng will ask for an API key.
Obtain your API key from https://tinypng.com/developers, copy and paste it when prompted.

OPTIONS
-f,--file FILE              Select a FILE to be shrinked.
-d,--download DIRECTORY     Download all shrinked images to DIRECTORY.
-o,--overwrite              When -d is being used, overwrite the source images with the downloaded ones.
-k,--key API_KEY            Use API_KEY, instead of the one stored in ~/.tinypng.apikey.
-p,--print                  When -d is being used, the URLs of the shrinked images are not being printed to stdout.
Use this option to force printing even when using -d.
Otherwise, this option is set implicitly.
-- FILES                    Ignore any options to come.
Everything after this option is considered a file.
-h,--help                   Show this message and exit successfully.

EXAMPLES
Shrink foo.jpg, bar.png, baz.png and print the result URLs to stdout.
$ tinypng -f foo.jpg -f bar.png -f baz.png
or
$ tinypng -- foo.jpg bar.png baz.png
Shrink foo.jpg, bar.png, baz.png and download the result images to tiny_pngs/ directory
$ tinypng -d tiny_pngs/ -- foo.jpg bar.png baz.png

AUTHOR

Rany Albeg Wein

LICENSE

Use it as if you wrote it yourself.

You can’t perform that action at this time.