How to convert PNG → WebP on Mac for Free?

Convert any PGN to WebP with 1 click on your Mac. Free & Unlimited.

During Landing Pages development, I need to convert lots of PNGs to WebP format and using tools like Convert Cloud is easy but its paid now. I didn’t want to pay for converting my PNGs to WebP when there are free tools available. So I created a Quick Action on my mac using 1 such utility to convert PNG to WebP which works even better than using an online tool.

Here is how I do it in 1 click (For Free)

  1. Install webp tool on your mac, use command brew install webp
  2. Use automator to create a Quick Action.
    • Open Automator (Cmd + Space, search Automator). And create a new document.
    • Choose “Quick Action”
    • Configure the top options:
      • Workflow receives currentimage files
      • inFinder
    • In the left panel, search for “Run Shell Script”, then drag it to the workflow.
    • Use below script (it auto-converts PNGs to WebP in the same directory). Replace /opt/homebrew/bin/cwebp with the actual path to cwebp if installed differently (use which cwebp to check).
    • Select as argument in Pass input dropdown.
    • Save it as something like: Convert to WebP.
  3. Done
    • Right-click any .png file → go to Quick ActionsConvert to WebP.

Code for Converting PNG to WebP

for f in "$@"
do
  ext="${f##*.}"
  filename="${f%.*}"

  /opt/homebrew/bin/cwebp "$f" -o "${filename}.webp" >/dev/null 2>&1

  if [ ! -f "${filename}.webp" ]; then
    osascript -e 'display notification "Failed to create WebP file." with title "Convert to WebP" sound name "Basso"'
  fi
done

This code takes the image file you select as input, take out its name, create a new webp using command cwebp input_file.png -o output_file.webp to generate a new file.

You can also download this below file → UnZip it → Double Click to install in your Automator.

Download “Convert to WebP”

Note: You can use the webp utility on linux and windows as well, the shortcut configuration might differ based on the OS you use.

Share this post