To compress and optimize JPEG and PNG images with Tinify API in Python.
-
Clone the project:
git clone https://github.com/Waterstrong/tiny-png.git
-
Execute the
install.sh
script and follow the instructions to complete the whole process -
Pay attention to the Tinify Key in
tinify.key
The TinyPNG script can compress all case insensitive *.jpg|*.jpeg|*.png
target image or images in target directory recursively.
Usage:
tinypng help
tinypng <target_image>
tinypng <target_directory>
Checkout the cache file .tinify.cache
in each target directory. It can prevent duplicated compression.
Checkout the log file <your_dir>/tiny-png/tinify.log
for compression details log.
IMPORTANT: The script will compress all case insensitive *.jpg|*.jpeg|*.png
target image or images in target directory recursively.