Welcome to the Alfred Smart WebP repository: An Alfred Workflow β¨
- MacOS
- Alfred 5. Note that the Alfred Powerpack is required to use workflows.
Under the hood, the compression is made with 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.
- Download the workflow
- Double click the
.alfredworkflowfile to install
Install cwebp (using Homebrew):
brew install webpYou 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.
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 /.
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 β.
Under the presets section, click on Remove a preset.
Select the preset you want to remove and press β.
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 searchis 1. If you want images in subdirectories, increase this value. Only images withpng|jpg|jpeg|tif|tiff|webpfile extensions are selected. In addition, they aren't case sensitive, meaning that the image extension can bePNG|JpG|tifF...
Here is an example where the user selected a folder and put Level 2 in π Depth of the search :
.
βββ 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.
Note that
Alfred Bufferis 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.
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.
Check the logs of your compression under the Data folder. The log file contains the 2 parts.
- In the orange box there is :
- Date of the compression with a
YYYY/MM/ddpattern. - Exact time of the compression with a
HH:mm:sspattern. - Folder(s) + image(s) path(s) selected with a tab β₯ separator.
- Preset or manual input. Preset will be displayed as
preset_name,preset_detailwhereas manual input will be displayed raw. - The selected level of variable
π Depth of the search
- Date of the compression with a
- In the green box there is the cwebp output.
Note that each compression is separated by a line.
MIT License Β© Benjamin Oddou



