Jump to content

Recommended Posts

An Alfred 4 workflow for quickly compressing and resizing images using TinyPNG. Simply select a collection of images or a folder in Finder and activate the workflow.

compressing.gif?raw=true

Installation and Getting Started

  1. Install alfred-tinypng workflow.
  2. All further updates are handled automatically.

You will need to configure the workflow with an API key from TinyPNG. Type tinypng_api to get a link to the pagewhere you can get your API key and to actually set the key when you have gotten it.

tinypng_api.png?raw=true

Usage

Select either a folder, image file or a number of image files in Finder. Afterward, open Alfred and type tinypng. You are presented with the following choices:

tinypng.png?raw=true

Choose an item based on what you want. When selected, the workflow will start compressing/resizing the image(s). After it is done, they will be saved to the same directory and with the same filename as the original image. The original image will be preserved with .bak prepended before the file extension. I.e. if compressing img.jpg, this will now become img.bak.jpg and the compressed image will be saved as img.jpg.

Refer to the TinyPNG documentation for a full explanation of the different resizing options.

Why? Another TinyPNG workflow already exists

  • It doesn't support choosing the files based on what is selected in Finder (which I personally prefer).
  • Only simple compression is supported whereas all TinyPNG compressions and resizing options are supported in this workflow.
  • It seems to be abandoned by the creator (has not been updated since 2015).

Credits

The workflow makes use of the following:

 

Code and more can be viewed on the associated GitHub-repo. If you find this workflow useful, stars are appreciated.

Edited by shmulvad
Add GitHub link
Link to post

I've used the old workflow for years and as you mentioned it hasn't been updated so thought I'd give yours a try. Unfortunately I can't enter my API key. Once I click on Enter/Change API Key it switches to the default search. Can you suggest what could be causing the issue?

Screenshot 2020-08-12 at 11.02.12 am.png

Edited by mixterdee
Adding an image
Link to post
1 minute ago, mixterdee said:

I've used the old workflow for years and as you mentioned it hasn't been updated so thought I'd give yours a try. Unfortunately I can't enter my API key. Once I click on Enter/Change API Key it switches to the default search. Can you suggest what could be causing the issue?

 

Sorry about that. This workflow uses Python 3. Does it work if you do "which python3" in your Terminal and set that as the path for the variable "pythonPath" in the workflow?

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...