Jump to content


Photo

TinyPNG - shrink your PNG files

tinypng png shrink compress

  • Please log in to reply
6 replies to this topic

#1 Benzi

Benzi

    Member

  • Member
  • PipPip
  • 122 posts
  • LocationCalicut, Kerala, India

Posted 23 April 2013 - 03:15 PM

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, 23 April 2013 - 03:54 PM.

  • Augusto likes this

              Fun Comics | Lingo | Facts | Rotten Tomatoes | AlfredWorkflow.com Search

Productivity Todo | BulkRename | Wikipedia ML 

          Utility Battery | Battery2 |  TinyPNGScreen Capture | Rome2Rio Search | F.lux | Radium | Monkey Patch


#2 JuggoPop

JuggoPop

    Newbie

  • Member
  • Pip
  • 2 posts

Posted 25 July 2013 - 07:15 PM

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?



#3 Augusto

Augusto

    Newbie

  • Member
  • Pip
  • 4 posts

Posted 25 November 2013 - 12:28 PM

Hello @Benzi!

 

Your workflow is so great!

 

Unfortunately, in the last weeks it stopped to work.. think thats a problem with the API (it may be changed - https://tinypng.com/developers)

 

Thanks!



#4 Augusto

Augusto

    Newbie

  • Member
  • Pip
  • 4 posts

Posted 25 November 2013 - 02:28 PM

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!


  • JuggoPop likes this

#5 Augusto

Augusto

    Newbie

  • Member
  • Pip
  • 4 posts

Posted 25 November 2013 - 02:38 PM

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, 25 November 2013 - 07:27 PM.

  • JuggoPop likes this

#6 JuggoPop

JuggoPop

    Newbie

  • Member
  • Pip
  • 2 posts

Posted 09 January 2014 - 06:28 PM

@Augusto -- Thanks for your help!



#7 Ginfuru

Ginfuru

    Member

  • Member
  • PipPip
  • 37 posts
  • LocationOhio

Posted Today, 03:03 PM

@Benzi

 

Any chance of getting this updated to do both TinyPNG and TinyJPG?


thanks




Also tagged with one or more of these keywords: tinypng, png, shrink, compress

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users