PNG is great for graphics and terrible for page weight. A folder of UI screenshots or exported logos can be tens of megabytes, and converting them to WebP usually cuts that hard while keeping the edges sharp. The problem is doing it in bulk: online converters cap how many files you can drop in, and every one of those files leaves your machine.
WSL solves both. Google’s cwebp converts PNG to WebP locally, for free, and a one-line loop handles an entire folder at once. Nothing gets uploaded, there’s no file count limit, and transparency is preserved.
If WSL isn’t set up yet, start with our WSL install guide. The same toolchain also does the reverse and the JPG case — see convert JPG to WebP if your sources are photos.
Install the WebP tools
The encoder lives in the webp package. In your WSL terminal:
sudo apt update && sudo apt install -y webp
That gives you cwebp (encode to WebP), dwebp (decode from WebP), and img2webp (build animated WebP). Check it’s installed:
cwebp -version
Lossless or lossy? Decide first
This is the one choice that matters for PNGs, because most PNGs aren’t photos.
- Graphics, logos, icons, screenshots, flat color, sharp text → use lossless. Lossy compression blurs hard edges and introduces fuzz around text.
- PNG that’s really a photograph → use lossy
-q, which produces a much smaller file with no visible difference.
Lossless single file:
cwebp -lossless input.png -o output.webp
Lossy (photo-like PNG):
cwebp -q 80 input.png -o output.webp
Bulk convert a folder
To convert every PNG in the current folder to lossless WebP, writing each result next to the original:
for f in *.png; do cwebp -lossless "$f" -o "${f%.png}.webp"; done
"${f%.png}.webp" swaps the extension, so logo.png becomes logo.webp. Your PNGs are left in place — you get both files.
For photo-like PNGs, swap in lossy quality:
for f in *.png; do cwebp -q 80 "$f" -o "${f%.png}.webp"; done
Include subfolders (recursive)
If your PNGs are spread across nested folders, find walks the whole tree and runs cwebp on each match:
find . -type f -iname "*.png" -exec sh -c 'cwebp -lossless "$1" -o "${1%.png}.webp"' _ {} \;
-iname "*.png"matches.pngand.PNG.-type fskips directories.- The
sh -c '... "$1" ...'wrapper lets each file’s name be reused safely for the output.
Every WebP is written beside its source PNG, mirroring the folder structure exactly.
Which command for which job
| cwebp -lossless f.png -o f.webp | Single graphic/screenshot, crisp output |
|---|---|
| cwebp -q 80 f.png -o f.webp | Single photo-like PNG, smaller file |
| for f in *.png; do ... done | Every PNG in one folder |
| find . -iname '*.png' -exec ... | Every PNG including subfolders |
| img2webp -d 100 *.png -o anim.webp | Animated WebP from PNG frames |
Animated WebP from PNG frames
Different job, same package: if you have a numbered sequence of PNG frames and want one animated WebP, use img2webp:
img2webp -loop 0 -d 100 frame-*.png -o animation.webp
-d 100 sets 100 ms per frame and -loop 0 loops forever. This isn’t bulk conversion — it merges frames into a single animated file — but it’s the right tool when that’s what you actually need.
Wrapping up
Bulk converting PNG to WebP on Windows comes down to one decision and one loop. Use -lossless for graphics and screenshots, -q 80 for photo-like PNGs, and a for loop (or find for subfolders) to process the whole batch in one line. It’s free, it preserves transparency, and because cwebp runs in WSL, none of your files are uploaded anywhere.
Set it up once and folder-sized PNG conversions become a single repeatable command.