Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shmulvad/alfred-tinypng
Compress png and jpg images using TinyPNG in Alfred
https://github.com/shmulvad/alfred-tinypng
Last synced: about 2 hours ago
JSON representation
Compress png and jpg images using TinyPNG in Alfred
- Host: GitHub
- URL: https://github.com/shmulvad/alfred-tinypng
- Owner: shmulvad
- License: gpl-3.0
- Created: 2020-08-11T16:03:56.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-05-01T16:53:38.000Z (over 3 years ago)
- Last Synced: 2024-08-03T16:09:57.238Z (4 months ago)
- Language: Python
- Size: 2.73 MB
- Stars: 19
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- alfred-workflows - TinyPNG - Compress PNG and JPG images using TinyPNG in Alfred. (Productivity)
README
# Alfred TinyPNG
[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/shmulvad/alfred-tinypng?sort=semver&style=flat-square)][releases]
![Languages supported](https://img.shields.io/badge/python-3.6%20%7C%203.7%20%7C%203.8-blue?style=flat-square)
[![GitHub downloads](https://img.shields.io/github/downloads/shmulvad/alfred-tinypng/total?style=flat-square)][releaseLatest]
[![GitHub issues](https://img.shields.io/github/issues/shmulvad/alfred-tinypng?style=flat-square)][issues]
[![GitHub license](https://img.shields.io/github/license/shmulvad/alfred-tinypng?style=flat-square)][license]An [Alfred][alfred] workflow for quickly compressing and resizing images using [TinyPNG][tinypng]. Simply select a collection of images or a folder in Finder and activate the workflow.
⭐ If you find this repo useful, please consider starring it to let me know.
## Installation and Getting Started
1. Install [alfred-tinypng][releaseLatest] 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 page][tinyApi] where you can get your API key and to actually set the key when you have gotten it.
The workflow only supports Python 3.6+. If you have any errors running the code, try changing the `pythonDir` workflow variable to the the path at which you have Python 3 installed.
## 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:
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. By default, 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`. You can choose to always override the image(s) by changing the workflow variable `KEEP_BACKUPS` to `False`.
Refer to the TinyPNG documentation for a full explanation of the different resizing options.
## Why? [Another TinyPNG workflow][tinypngOtherAlfred] 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:* [OneUpdater][oneUpdater] by vitorgalvao for handling automatic updates.
* [TinyPNG Python API][tinypngApi][alfred]: https://www.alfredapp.com/
[license]: https://github.com/shmulvad/alfred-tinypng/blob/master/LICENSE
[issues]: https://github.com/shmulvad/alfred-tinypng/issues
[tinyApi]: https://tinypng.com/developers
[tinypng]: https://tinypng.com
[releases]: https://github.com/shmulvad/alfred-tinypng/releases
[releaseLatest]: https://github.com/shmulvad/alfred-tinypng/releases/latest/download/TinyPNG.alfredworkflow
[oneUpdater]: https://github.com/vitorgalvao/alfred-workflows/tree/master/OneUpdater
[tinypngApi]: https://tinypng.com/developers/reference/python
[tinypngOtherAlfred]: https://www.alfredforum.com/topic/1520-tiny-png-workflow-updated-to-v12/