You do not need to upload your images to an online converter or install a dedicated image-converter app to create WebP files on a Mac. A small command-line tool can handle the conversion locally. Add it to a Finder Quick Action, and future conversions take a right-click.
There is one distinction: this is not a zero-install method. You will install cwebp through Homebrew and use the Automator app already included with macOS. Terminal is needed for setup; the Finder workflow handles everyday use afterward.
1. Install the WebP tools
If Homebrew is already available, open Terminal and run:
brew install webpThe Homebrew WebP package provides the conversion tools. If you get command not found: brew, follow the official Homebrew installation instructions, including their shell setup steps, before continuing.
Check that your shell can find the encoder:
cwebp -version2. Convert one image first
Change to the folder containing your image, or use full paths. For a JPEG named photo.jpg, run:
cwebp -q 80 "photo.jpg" -o "photo.webp"Choose a fresh output filename: this single-file command can overwrite an existing output. It keeps the source JPEG.
In the default lossy mode, -q accepts a value from 0 to 100. Lower values trade image quality for a smaller file. Start at 80, then compare the result at its intended display size. Try 60–70 only if the visible result is acceptable; “negligible loss” is not guaranteed.
Screenshots, fine text, and graphics deserve a closer look. For a lossless alternative, try:
cwebp -lossless "screenshot.png" -o "screenshot.webp"A quality setting of 100 does not turn lossy mode into lossless mode. Use the explicit -lossless option when that is your goal. These options are documented in Google’s cwebp reference.
3. Add “Convert to WebP” to Finder
Automator can run a shell script on files selected in Finder. Apple documents the Run Shell Script action; the steps below turn it into your conversion shortcut.
- Open Automator and choose New Document → Quick Action.
- Set Workflow receives current to image files in Finder.
- Find Run Shell Script and drag it into the workflow.
- Set Shell to
/bin/bashand Pass input to as arguments. - Replace the default script with the code below.
- Save the Quick Action as Convert to WebP.
export PATH="/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:$PATH"
cwebp_bin="$(command -v cwebp)" || {
echo "cwebp is missing. Install it with: brew install webp" >&2
exit 1
}
failed=0
for f in "$@"; do
case "${f##*.}" in
jpg|jpeg|png|JPG|JPEG|PNG) ;;
*) echo "Skipped unsupported format: $f" >&2; continue ;;
esac
out="$f.webp"
if [ -e "$out" ]; then
echo "Skipped existing output: $out" >&2
continue
fi
if ! "$cwebp_bin" -q 80 -o "$out" -- "$f"; then
failed=1
fi
done
exit "$failed"Select one or more JPEG or PNG images in Finder. Right-click and choose Quick Actions → Convert to WebP. You do not need to open Terminal for each batch.
What this script does differently
The script adds the standard Homebrew locations to its search path: /opt/homebrew/bin for Apple silicon and /usr/local/bin for Intel Macs. This avoids hard-coding a path that only works on one architecture. See Homebrew’s installation documentation.
It also keeps the original extension in the output name: photo.jpg becomes photo.jpg.webp. That is deliberate. If the same folder contains both photo.jpg and photo.png, each gets a separate output. An existing output is skipped, so running the action again will not replace it. To try a different quality setting, rename the old output first.
Every file path is quoted, so names containing spaces work. Originals stay untouched. If a conversion fails, the action returns an error; check the affected output before using it.
Limits worth knowing
This Quick Action is intentionally limited to JPEG and PNG. TIFF, HEIC, SVG, PDF, and animated files need a different conversion workflow. Do not expect an “image files” selection in Finder to mean every image format is supported by the encoder.
Compare the output with the original before uploading it. A new extension alone does not prove that the file is smaller or that its quality is good enough. Check small text, sharp edges, gradients, and the image’s orientation.
Once the setup is done, the routine is simple: select your images, run the Quick Action, inspect the WebP files, and upload the versions you want to use.
