Here’s a workflow which uses the online TinyPNG service to batch-compress a selection of PNG or JPG image files.
Usage
This workflow works as either a File Action or a regular Alfred keyword.
Either:
- Select the PNG or JPG files you want processed (in Finder or Alfred), then select the “Compress with TinyPNG” File Action in Alfred.
- Select the PNG or JPG files you want processed in Finder, launch Alfred, then use the tinypng keyword.
The processed files will be downloaded to a TinyPNG folder on your Desktop, along with a Report showing the success/failure of each file, and how much it has been compressed by.
The process may take some time, especially if you have selected several large image files, but you will notified on completion. However, if you have Growl (& growlnotify) installed, you will get a per-file notification as it progresses.
A Note on Heavy Usage
The TinyPNG API has a limit of 500 files per month. As you can imagine, once a few people are using the workflow substantially, this doesn’t take long to reach. I have provided a default API key built-in so you can use the workflow immediately. However, if you intend to continue using it in any substantial capacity I strongly suggest you visit https://tinypng.com/developers and register for your own API key. You can jump there with the keyword “tinypng_getkey” in Alfred. Once you’ve got your key, save it into the workflow configuration with the keyword “tinypng_config”
Feedback, bug reports, feature suggestions welcome in the Comments below or on the Alfred forum.
Workflow website: Carl’s Geekzone