Skip to content

Instantly share code, notes, and snippets.

@JayHoltslander
Last active June 9, 2020 19:13
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Batch convert images in current folder to webp format using Google's cwebp tool.
# cwebp Docs: https://developers.google.com/speed/webp/docs/using
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