How To Convert JPEG / JPG / PNG to WebP in Terminal on MacOS

Open Terminal, set the directory of your image folder and run a line listed below.

Oscar de la Hera Gomez
Written by Oscar de la Hera Gomez
First published on 05/17/2022 at 20:25
Last Updated on 05/18/2022 at 11:48
How To Convert JPEG / JPG / PNG to WebP in Terminal

Open Terminal, set the directory of your image folder and run a line listed below.

Step One: Open Terminal

Open Terminal

Press command + space and search for Terminal. Press Enter.

Step Two: Set your image directory

Set your image directory

This can be achieved by dragging a folder into a terminal. Press Enter when ready.

Step Three: Update this line of Code

Paste Directory into line below

Paste your image directory address in place of YOUR_DIRECTORY the line below. Copy when done.

`for file in YOUR_DIRECTORY*; do cwebp -q 100 "$file" -o "${file%.*}.webp"; done`

Step Four: Run the line in Terminal

Sample Terminal on Complete

Terminal should look similar to the image above when complete.

Any Questions ?

We are actively looking for feedback on how to improve this resource. Please send us a note to inquiries@delasign.com with any thoughts or feedback you may have.

SubscribeInquireView All PostsView All ServicesView All Work

Partner with us

We would love to get to know you and see how we can help your organization with its goals and needs.
Let's Talk

Stay Informed

Get occasional updates about our company, research, and product launches.
Subscribe