Compressing Images and PDFs with bash

As I’m looking to save us some money with our Google Cloud Storage bill I did some research and built out some scripts to optimize png, jpg, and pdf files.

You can find the repository here. I cut a 5.5GB folder down to 4.1GB.

The big disclaimer is that I ran this on my dozen test folders from client sites all weekend just for the images. Starting at 0900 Friday morning it was finally done at some point around noon on Sunday. Then I figured out the pdf script and ran that on my single client folder of 5.5GB. We’re currently running it on the other folders which I expect to take a long time based on the current progress.

I run a Framework 13 with AMD 7840U so extrapolate your own timeframes.