Image conversion to WebP on Mac is easier than ever. WebP, introduced by Google in 2010, is a modern image format celebrated for its efficient compression and superior image quality. This dynamic format incorporates both lossless and lossy compression methods, making it a preferred choice for web developers and designers striving to optimize website performance while maintaining visual integrity. In comparison to traditional formats like JPEG and PNG, WebP stands out by significantly reducing file sizes, a crucial attribute that translates into faster loading times for web pages and an overall improved user experience.
A notable feature of WebP lies in its support for advanced functionalities such as transparency and animation. This versatility makes it a comprehensive solution for a diverse array of graphic content on the internet. As the adoption of WebP continues to grow among browsers and platforms, it plays a pivotal role in shaping the landscape of web-based media by offering a compelling combination of efficient compression, faster loading times, and support for rich visual elements.
What’s Next?
Discover a streamlined approach to image conversion on your Mac by integrating a conversion script into your services, accessible through the right-click menu. While automating image processing in your build is essential for efficiency, there are instances where you may want to quickly convert a single image for visual inspection or assess compressed file size and quality without running an entire build. Explore a hassle-free solution to on-the-fly WebP conversions with this user-friendly Mac services enhancement.
How to Setup
1. Install libwebp
The easiest installation is through a package manager:
If you have homebrew: brew install webp
2. Add the lib to your PATH
You may need to add the directory for these new packages to your shell configuration file, such as: .bashrc.
To determine the path to add, you can run the following command in Terminal or the shell:
which cwebp

This command will confirm that you have successfully installed cwebp and will also provide information about its installation location.
Open the file using Vim, Emacs, or any text editor. You need to create the file if it doesn’t exist.
/* Skip this if the file already exists */
touch ~/.bash_profile
touch ~/.bashrc
/* edit the file */vim ~/.bashrc
and append the path that resulted from the command which cwebp to the
$PATHPATH=$PATH:"/opt/homebrew/bin"
export PATH
3. Make an Automator service
Open your Automator and then choose “Quick Actions”

Navigate to the leftmost panel and select “Utilities.”
Within the Utilities section, drag and drop “Run Shell Script” into the main window.
Modify the workflow settings to “receives image files in Finder.”

In the “Run Shell Script” section, specify the shell you are using (usually /bin/bash or the shell to which you added the path above). You can identify your shell by typing echo $SHELL into Terminal.
Adjust the option to “pass input as arguments.”
And then paste this into the Run Shell Script box
source ~/.bashrcfor FILE in "$@"
do
echo "converting file: $FILE"
EXT=${FILE##*.}
QUALITY=80
cwebp -q $QUALITY "$FILE" -o "${FILE/%.$EXT/.webp}"
done
3. Save and Add to Your Services Menu
Click “Save…” and enter the desired name for it to appear in your secondary menu. This Automator service will automatically save itself in the appropriate location within your file system.
Give it a try! Right-click on an image and initiate the conversion. You should observe a new image generated within a second.

Experience the benefits of saving those precious kilobytes! Optimize your workflow with this quick and efficient image conversion service.
Tips for Better Image Conversion to WebP
Once your Quick Action is ready, a few habits help you get the best balance between file size and image quality.
- Choose a sensible quality level. A quality value around 75 to 85 usually gives a large reduction in file size with little visible difference. You can test a command such as
cwebp -q 80 input.jpg -o output.webpon one image first. - Keep your originals. Store the source files in a separate folder so that you can reconvert them later if your needs change.
- Check the result. Open the converted image and compare it with the original, especially for photos with gradients or small text.
- Use descriptive file names and alt text. This helps search engines and screen readers understand your images.
WebP is supported by all modern browsers, and WordPress has allowed WebP uploads for several years, so you can use these files on most websites without a fallback.
Troubleshooting Image Conversion to WebP on Mac
- “cwebp: command not found.” The tool is not in your PATH. On Apple Silicon Macs, Homebrew usually installs programs in
/opt/homebrew/bin, so make sure that folder is included in the path used by your script. - The Quick Action does not appear. Check that it is saved in the Services folder and enabled in System Settings under the keyboard shortcuts for services.
- Nothing happens after you run it. Open the workflow in Automator and confirm that it is set to receive image files in Finder.
When Should You Keep JPEG or PNG Instead of WebP?
WebP is excellent for websites, but it is not the best choice for every situation. Keep the original JPEG or PNG when you send images by email to people who may use older software, when you prepare files for print, or when you still need to edit the image in an application that does not support WebP. As a simple rule, use WebP for the final version that appears on your website and keep the original as your master copy.
