Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Batch convert images in current folder to webp format using Google's cwebp tool.
# cwebp Docs:
find ./ -type f -name '*.png' -exec sh -c 'cwebp -q 75 $1 -o "${1%.png}.webp"' _ {} \; &&
find ./ -type f -name '*.jpg' -exec sh -c 'cwebp -q 75 $1 -o "${1%.jpg}.webp"' _ {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment