You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[](https://github.com/BenjaminOddou)
4
+
[](https://github.com/BenjaminOddou)
* Alfred 5. Note that the [Alfred Powerpack](https://www.alfredapp.com/powerpack/) is required to use workflows.
13
13
14
-
## βΉοΈ information
14
+
## ποΈ cwebp
15
15
16
-
* ποΈ 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.
16
+
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.
17
17
18
18
## β¬οΈ Installation
19
19
20
20
1.[Download the workflow](https://github.com/BenjaminOddou/alfred-smart-webp-compression/releases/latest)
21
21
2. Double click the `.alfredworkflow` file to install
22
22
23
-

24
-
25
-
## π§ββοΈ Invoke the Workflow
26
-
27
-
You can invoke the workflow by writing `webp` onto the Alfred search box. You can change this value by changing the `πΉοΈ Trigger` variable in workflow configuration panel [optionnal].
28
-
29
23
## π§° Setup the workflow
30
24
31
-
### π¨βπ» Install dependencies
32
-
33
-
#### Open the Terminal of you Mac and run the following commands
34
-
35
-
1. βοΈ Install Homebrew.
25
+
#### Open the Terminal of you Mac and run the following command:
β¨ The workflow is also checking the cwebp version each time you run it.
60
-
61
-

62
-
63
-
### π Data (Presets and Logs) folder
64
-
65
-
β This variable cannot be empty. You can change it at your convenience in the workflow configuration panel.
66
-
67
-
It contains the presets created within the workflow + output logs of the cwebp compression.
68
-
69
-
> π‘ Note that if you change the `Data folder` location after creating presets and logs, you should probably move the files created along in the new folder.
35
+
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.
70
36
71
37
## π€ Usage of the workflow
72
38
73
-
### βοΈ Handling presets
74
-
75
-
Go under the home menu and open the `presets section`.
Go under the `presets section` and click on "Add a preset".
43
+
Go under the `presets section` and click on `Add a new preset`.
82
44
83
-

84
-
85
-
Add your preset by putting `preset_name,preset_detail`. Note that the comma (`,`) is separating the name of the preset from its content. The content correspond to the cwebp [options] which can be found under the documentation section.
86
-
87
-

88
-
89
-
The created preset can be seen under the preset section. New presets are put on top of older ones.
90
-
91
-

45
+
Add your preset by putting a `value`, press β and input a `title` and a `subtitle` separated by a `/`.
92
46
93
47
#### Modify a preset
94
48
95
-
Under the `presets section`, click on "Modify a preset".
Go to the online documentation or click on one of the options to copy it !
124
-
125
-

126
-
127
-
### π Start the compression
59
+
### Start the compression
128
60
129
61
#### Using Workflow File Filter
130
62
131
-
Under the home menu, click on "Start the compression".
132
-
133
-

63
+
Under the home menu, click on `Start the compression`.
134
64
135
65
Select the folder with images or directly the image you want to compress and press enter β.
136
66
137
-
> π‘ Note that when selecting a folder, images within subdirectories aren't selected if `π Depth of the search` is `Level 0οΈβ£`. 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...`
67
+
> 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...`
138
68
139
-
Here is an example where the user selected a folder and put `Level 1οΈβ£` in `π Depth of the search` :
69
+
Here is an example where the user selected a folder and put `Level 2` in `π Depth of the search` :
140
70
```shell
141
71
.
142
-
βββ selected folder # Level 0οΈβ£
143
-
β βββ subdirectory # Level 1οΈβ£
72
+
βββ selected folder # Level 1
73
+
β βββ subdirectory # Level 2
144
74
β β βββ image.PnG # selected β
145
-
β β βββ a nested folder # Level 2οΈβ£
75
+
β β βββ a nested folder # Level 3
146
76
β β β βββ one image.webp # not selected β
147
77
β β β βββ a second image.tiff # not selected β
Alternatively, use the `Alfred Buffer` to select folder(s) and image(s) at the same time !! Basic commands are :
155
83
156
84
* β₯β to add a file to the buffer from Alfred's results.
@@ -161,25 +89,21 @@ Alternatively, use the `Alfred Buffer` to select folder(s) and image(s) at the s
161
89
162
90
To know more on how to use `Alfred Buffer`, follow this [link](https://www.alfredapp.com/help/features/file-search/#file-buffer).
163
91
164
-
> π‘ 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**.
165
-
166
-

167
-
168
-
Choose the cwebp options by selecting a preset or input it manually by pressing "Manual options".
92
+
> 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**.
169
93
170
-

94
+

171
95
172
-
Check the logs of the compression. To know more on how to read logs, see the `Logs output` section below.
96
+
Choose the cwebp options by selecting a preset or input it manually by pressing `Manual options`.
173
97
174
98
#### Using Alfred Universal Actions
175
99
176
100
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
104
+
> 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
181
105
182
-

106
+

183
107
184
108
If you want to know more on how to use Alfred Universal Actions, follow this [link](https://www.alfredapp.com/help/features/universal-actions/).
185
109
@@ -195,9 +119,9 @@ Check the logs of your compression under the `Data folder`. The log file contain
195
119
* The selected level of variable `π Depth of the search`
196
120
2. In the green box there is the cwebp output.
197
121
198
-
> π‘ Note that each compression is separated by a line.
122
+
> Note that each compression is separated by a line.
0 commit comments