WebP : cwebp | Download the binaries

Google released a suite of WebP utilities.

Convert to WebP

# @ PNG w/ alpha channel
cwebp ${fname}.png -lossless -exact -o ${fname}.webp
# @ PNG or JPG (sans alpha)
cwebp ${fname}.jpg -o ${fname}.webp
# +Explicit quality 
cwebp -q 85 ...
# +Resize; proportionally if either is 0
cwebp -resize $width $height ...
# +Crop; start @ top-left corner position (x_start, y_start)
cwebp -crop $x_start $y_start $width $height ...

Decode from WebP to …

dwebp ${fname}.webp -o ${fname}.png