TIL: Optimizing WebP files with cwebp

WebP is a newer image format intended to provide smaller images for the web. Tools like Sketch provide the ability to export assets as WebP, but I've noticed the exports still seemed larger and almost equivalent to JPEG exports. For JPEG and PNG exports, you can use tools like ImageOptim to reduce the file sizes even further, but I haven't found a similar tool for WebP files.

I did find the cwebp CLI however, which in my testing so far can reduce the exported WebP file size in half. Here's the command I use:

cwebp input-file.webp -o lossy-output.webp -m 6 -af

Download cwebp here.