Virtual Dennis

How to Add a MacOS Finder Quick Action to Convert Images to WebP Easily

Manuals & How-To's Mac OS X
How to Add a MacOS Finder Quick Action to Convert Images to WebP Easily

Step 1: Install cwebp

If you have Homebrew:

brew install webp

Step 2: Create the Quick Action

  1. Open Automator (⌘+Space, type “Automator”)

  2. Choose New DocumentQuick Action (or choose “Quick Action” if the getting started wizard opens)

  3. At the top of the workflow, set:

    • “Workflow receives current” → image files
    • “in” → Finder.app
  4. From the actions library on the left, search for Run Shell Script and drag it into the workflow

  5. Set:

    • Shell: /bin/zsh
    • Pass input: as arguments
  6. Paste this script:

export PATH="/opt/homebrew/bin:/usr/local/bin:$PATH"
for f in "$@"; do
    dir=$(dirname "$f")
    base=$(basename "$f")
    name="${base%.*}"
    cwebp -q 85 "$f" -o "$dir/$name.webp"
done
  1. Save it as something like Convert to WebP

Step 3: Use it

Right-click any image in Finder → Quick Actions (or the Services submenu on older macOS) → Convert to WebP. The .webp file lands next to the original.

A couple of notes worth knowing:

  • -q 85 is the quality setting. Drop to 75 for smaller files, bump to 95 for near-lossless. Add -lossless if you want true lossless.
  • The export PATH line matters because Automator doesn’t inherit your shell’s PATH, so it can’t find cwebp without it. /opt/homebrew/bin is for Apple Silicon, /usr/local/bin is for Intel — leaving both covers either machine.
  • If you want to replace the original instead of adding alongside it, append && rm "$f" inside the loop.