Converting Images to WebP Shouldn’t Be a Pain
Disclaimer: I hope you find this article boring and that you already convert images to .webp
format without using online converters. Anyway, I’m leaving this blog post here :)
If you’ve ever tried converting images to .webp
using random online tools, you probably know how tedious — and honestly frustrating — it can be.
Open some sketchy website, drag your files in, wait for the conversion, dodge a bunch of ads, then manually download each converted image one by one. If you have more than a couple of images? Forget it. You’ll lose half your afternoon.
But here’s the thing we all already know: .webp
is absolutely worth it — smaller file sizes, great image quality, and better performance for your websites. So let’s talk about how to actually convert your images to .webp
without losing your sanity.
Why Even Bother With WebP?
Before I show you the better way to convert images, let’s quickly remind ourselves why .webp
is worth dealing with in the first place:
Smaller File Sizes: .webp
images can be around 25-35% smaller than .jpeg
or .png
, making your websites load faster.
Transparency Support: Like .png
files, .webp
supports transparent backgrounds.
Animation Support: You can even use .webp
for animated images instead of .gif
files.
Great Browser Support: Pretty much all modern browsers play nice with .webp
.
In short: Your images look good, your pages load faster, and your users (and Google Lighthouse) are happier.
The Annoying Part: Online Converters
Most of us, when first trying .webp
, head straight to Google and find some “Free WebP Converter” website. The process looks like this:
- Visit the site.
- Get bombarded with pop-ups.
- Upload your image.
- Wait.
- Download one file at a time.
- Repeat for every image.
- Realize your files went through some random server you don’t control.
For a quick test, maybe that’s fine. But if you’re dealing with dozens of images? It’s a nightmare…
The Better Way: Convert to WebP Locally with cwebp
Luckily, there’s a simple, reliable, offline way to convert images to .webp
— right from your terminal — using the cwebp
tool from Google.
Step 1: Install cwebp
with Homebrew
brew install cwebp
That gives you access to the official conversion tools, no sketchy websites required.
Step 2: Convert a Single Image
cwebp -q 75 image.png -o image.webp
- The
-q
flag controls quality (0 to 100). - The higher the number, the better the quality (and larger the file).
- Play with the number to find your ideal balance.
Step 3: Batch Convert a Whole Folder
`for file in ./*; do cwebp -q 75 "$file" -o "${file%.*}.webp"; done`
This loops through all files in the current directory, converts them with a quality setting of 75, and outputs them as .webp
files. You can even use this as an alias script.
Conclusion: WebP Without the Headache
WebP images are a no-brainer for modern websites — smaller, faster, more efficient. But converting them shouldn’t mean dealing with clunky online tools or wasting your time clicking through ads.
With cwebp
, you take full control of your image conversion process. It’s fast, offline, and works beautifully for both single images and full folders.
If you’ve been putting off using WebP because of the conversion hassle — now you have no excuse. Your images (and your website visitors) will thank you.