https://github.com/BenjaminOddou/alfred-smart-webp-compression
đ§ââī¸ Transform your images into WebP format with ease
https://github.com/BenjaminOddou/alfred-smart-webp-compression
alfred alfred-workflow cwebp image-compression image-processing macos shell webp-converter webp-images zsh
Last synced: 3 months ago
JSON representation
đ§ââī¸ Transform your images into WebP format with ease
- Host: GitHub
- URL: https://github.com/BenjaminOddou/alfred-smart-webp-compression
- Owner: BenjaminOddou
- License: mit
- Created: 2022-12-27T19:22:09.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-04-22T11:16:38.000Z (about 2 years ago)
- Last Synced: 2024-11-05T23:41:24.831Z (8 months ago)
- Topics: alfred, alfred-workflow, cwebp, image-compression, image-processing, macos, shell, webp-converter, webp-images, zsh
- Language: JavaScript
- Homepage: https://alfred.app/workflows/benjaminoddou/smart-webp/
- Size: 27.2 MB
- Stars: 19
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![]()
[](https://github.com/BenjaminOddou)
[](https://saythanks.io/to/BenjaminOddou)Welcome to the Alfred Smart WebP repository: **An Alfred Workflow** â¨
## â Prerequisites
* MacOS
* Alfred 5. Note that the [Alfred Powerpack](https://www.alfredapp.com/powerpack/) is required to use workflows.## đī¸ cwebp
Under the hood, the compression is made with [cwebp](https://developers.google.com/speed/webp/docs/cwebp) (made by Google), a tool that allows to compress images into the WebP format, which is generally lighter, and broadly used to share images on the web.
## âŦī¸ Installation
1. [Download the workflow](https://github.com/BenjaminOddou/alfred-smart-webp-compression/releases/latest)
2. Double click the `.alfredworkflow` file to install## đ§° Setup the workflow
#### Open the Terminal of you Mac and run the following command:
Install cwebp (using [Homebrew](https://brew.sh)):
```shell
brew install webp
```## đ§ââī¸ Invoke the workflow
You can invoke the workflow by writing `webp` into the Alfred search box. You can change this value by changing the `đšī¸ Trigger` variable in workflow configuration panel.
## đ¤ Usage of the workflow
### Handling presets
#### Create a preset
Go under the `presets section` and click on `Add a new preset`.
Add your preset by putting a `value`, press â and input a `title` and a `subtitle` separated by a `/`.
#### Modify a preset
Go under the `presets section` and click on the preset you want to modify.
Select wether you want to modify the `title/subtitle` or the `value` and press â. Input the new title/subtitle or value and press â.
#### Remove a preset
Under the `presets section`, click on `Remove a preset`.
Select the preset you want to remove and press â.
### Start the compression
#### Using Workflow File Filter
Under the home menu, click on `Start the compression`.
Select the folder with images or directly the image you want to compress and press enter â.
> Note that when selecting a folder, images within subdirectories aren't selected if `đ Depth of the search` is 1. If you want images in subdirectories, increase this value. Only images with `png|jpg|jpeg|tif|tiff|webp` file extensions are selected. In addition, they aren't case sensitive, meaning that the image extension can be `PNG|JpG|tifF...`
Here is an example where the user selected a folder and put `Level 2` in `đ Depth of the search` :
```shell
.
âââ selected folder # Level 1
â âââ subdirectory # Level 2
â â âââ image.PnG # selected â
â â âââ a nested folder # Level 3
â â â âââ one image.webp # not selected â
â â â âââ a second image.tiff # not selected â
â â âââ file.doc # not selected â
â âââ first-image.jpeg # selected â
```Alternatively, use the `Alfred Buffer` to select folder(s) and image(s) at the same time !! Basic commands are :
* âĨâ to add a file to the buffer from Alfred's results.
* âĨâ to add a file and move to the next item in your list of results.
* âĨâ to remove the last item from the buffer.
* âĨâ to action all items in the buffer.
* âĨâĢ to remove all items from the buffer.To know more on how to use `Alfred Buffer`, follow this [link](https://www.alfredapp.com/help/features/file-search/#file-buffer).
> Note that `Alfred Buffer` is preferred compare to the `{query}`, meaning that if you select a folder/image (by clicking on it or by pressing enter â) that is not included in the buffer, **it will not be compressed**.

Choose the cwebp options by selecting a preset or input it manually by pressing `Manual options`.
#### Using Alfred Universal Actions
Select the folder(s) / image(s) you want to compress within alfred using `Quick Search` and run `Universal Actions` with â or âĨâ if you used the `Alfred buffer`. Select "Compress images to WebP".

> Note that the workflow is type sensitive, meaning that if you select a file that is not part of the following types, the action "Compress images to WebP" will not be available

If you want to know more on how to use Alfred Universal Actions, follow this [link](https://www.alfredapp.com/help/features/universal-actions/).
#### Logs output
Check the logs of your compression under the `Data folder`. The log file contains the 2 parts.
1. In the orange box there is :
* Date of the compression with a `YYYY/MM/dd` pattern.
* Exact time of the compression with a `HH:mm:ss` pattern.
* Folder(s) + image(s) path(s) selected with a tab âĨ separator.
* Preset or manual input. Preset will be displayed as `preset_name,preset_detail` whereas manual input will be displayed raw.
* The selected level of variable `đ Depth of the search`
2. In the green box there is the cwebp output.> Note that each compression is separated by a line.

## âī¸ License
[MIT License](LICENSE) Š Benjamin Oddou