pacmax beta

Alfred Pac by BenjaminOddou on GitHub

smart webp compression

🧙‍♂ïļ Transform your images into WebP format with ease

From their README

logo-dark logo-light

made with heart by Benjamin Oddou saythanks

Welcome to the Alfred Smart WebP repository: An Alfred Workflow âœĻ

✅ Prerequisites

🏎ïļ cwebp

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.

⮇ïļ Installation

  1. Download the workflow
  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):

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 :

.
├── 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 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.

alfred_buffer

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".

universal_action

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

types

If you want to know more on how to use Alfred Universal Actions, follow this link.

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.

log_detail

⚖ïļ License

MIT License ÂĐ Benjamin Oddou

Latest release

  • 3.0.23 years ago, 70 KBDownload

    Alfred Smart WebP workflow

    • Add alternative texts if the user doesn't input a preset title/subtitle instead of undefined
    • Improve description of 🔍 Depth of the search parameter
8 earlier releases
  • 3.0.13 years ago, 70 KBDownload

    Alfred Smart WebP workflow

    • Update presets.json template 📜
  • 3.03 years ago, 70 KBDownload

    Alfred Smart WebP workflow

    • Redesigned workflow with JXA âœĻ
    • Dependency free (only cwebp is required) ðŸĶū
    • New navigation with return button 🧭
    • New icons 🖞ïļ
    • Output actions ðŸ”Ŧ
    • Notification module 🎷
  • 2.43 years ago, 935 KBDownload
    • Modification of subtexts ✍ïļ
    • Minor documentation update 📖
  • 2.33 years ago, 1.0 MBDownload

    âœĻ New parameter to compress images within sub folders 🐛 Fix bug that was causing workflow to break when files/folders paths contained space(s)

  • 2.23 years ago, 7.0 MBDownload

    🐞 fix broken workflow caused by the v1.3.0 of cwebp 👁ïļâ€ðŸ—Ļïļ (cwebp -version command now display libsharpyuv version). This is due to the addition of libsharpyuv, which exposes -sharp_yuv/config.use_sharp_yuv -> libwebp 1.3.0

  • 2.13 years ago, 7.0 MBDownload
    • 🆕 New logo
    • 📖 Documentation correction
  • 2.03 years ago, 5.5 MBDownload

    🏎ïļ v2.0

    • âœĻ Reinvented logic with a two steps compression workflow
    • ðŸĨģ Alfred Universal Actions
    • 😎 Possibility to select Folders and Images at the same time
    • ðŸĶū Typed search to avoid erros in compression
    • 🖋ïļ Possibility to use manual cwebp options on the fly
    • ðŸŠķ Lighter workflow => Removal of perl dependencies and env variables
    • 📖 Updated documentation

    ‾ïļ Don't hesitate to share your feedback ‾ïļ

  • 1.03 years ago, 2.8 MBDownload

    🚀 Launch of the app

    • Compatible with Alfred 5 âœĻ
    • Preset system ⚒ïļ
    • Offline documentation 📖
    • Output logs 📃

    ‾ïļ Don't hesitate to share your feedback ‾ïļ