Jump to content

TinyPNG - shrink your PNG files


Recommended Posts

icon.png

 

This is a little utility workflow that allows you to shrink your PNG files. The workflow uses the service provided by http://tinypng.org, which also explains what exactly happens when PNG files are shrunk. You need an active internet connection for this to work.

 

tinypng.png

 

Included in this workflow are File Actions (action: Shrink with TinyPNG), File Filters (keyword: tinypng) and a configurable Shortcut. Once you select a PNG file / or files and invoke the workflow, it will create a backup of your original file with the prefix "original_" and then compress your file using the web service.

 

To get an idea of the savings, the image above was shrunk using the workflow to get a savings of 72%.

comparison.png

 

Download.

 

All images in this post were shrunk using the TinyPNG workflow.

 

EDIT: If you are looking for an alternate similar workflow, try this one by @CarlosNZ

Edited by Benzi
Link to post
  • 3 months later...

Nice one. I made one adjustment to the backup file. Instead of adding original_ to the front, I left the base the same then added .bak after the extention. I like the new image and the original to be next to each other in my folder list. When Original was added to the front, they all went into the O secion of the file list.

 

What I would really like is something like this:

logo.png > logo.20130725.bak.png

 

Do you know how I might modify this to do that?

Link to post
  • 3 months later...

As some users already know, the new tinypng api requires an API key.

 

Until the next Benzi's update comes, you can do the following steps:

 

- get your unique API key here (the free one allows you to convert up to 500 png files per month): https://tinypng.com/developers

 

- edit the great Benzi's workflow, and in the bin/bash script element, find that line:

download=$(curl -s --data-binary "@$input" http://tinypng.org/api/shrink | grep -o "http[^\"]*")

.. and replace for that:

download=$(curl -s --user api:YOUR_UNIQUE_API_KEY_HERE --data-binary "@$input" https://api.tinypng.com/shrink | grep -o "http[^\"]*")

just save and use!

Link to post

Nice one. I made one adjustment to the backup file. Instead of adding original_ to the front, I left the base the same then added .bak after the extention. I like the new image and the original to be next to each other in my folder list. When Original was added to the front, they all went into the O secion of the file list.

 

What I would really like is something like this:

logo.png > logo.20130725.bak.png

 

Do you know how I might modify this to do that?

 

juggopop, try this:

 

- find that lines in the bin/bash script element:

base=$(basename "$input")
new=$(echo -n $base)

- replace with that:

base=$(basename "$input")
currentdate=$(date +"%Y%m%d")
name=$(basename "$base" .png)
new=$(echo -n $name.$currentdate.bak.png)
Edited by Augusto
Link to post
  • 1 month later...
  • 10 months later...
  • 6 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...