Bash script for automatically uploading JPG/PNG files to https://tinypng.com/ for image compression.

Kevin 59cce8b31e Update 'README.md' 7 år sedan
LICENSE b4dc08e1f5 Initial commit 7 år sedan
README.md 59cce8b31e Update 'README.md' 7 år sedan
tinypng.sh 80dac1f465 Initial upload of working script 7 år sedan

README.md

tinypng

Bash script for automatically uploading JPG/PNG files to TinyPNG for image compression. Free for <500 images per month.

Pretty good service if you want minimally sized photos: my 100% quality JPEGs compressed to ~60% of their original size with only a slight decrease in overall sharpness. File size from Google's image compression from Google's pagespeed tool was smaller by ~10%, but the quality was noticeably lower in comparison. For my use case, I only compressed the resized photos and thumbnails used on the front page of my site to improve page load speed.

Uploaded files (from the running directory) are logged to avoid compressing the same file multiple times.

Usage:

Compress all PNG files in a given subdirectory (and all subfolders):

./tinypng.sh subdirectory/ '*.png' 

Compress all JPG thumbnails in the current directory (and all subfolders):

./tinypng.sh . '*thumb*.jpg'