Created
October 22, 2020 12:14
-
-
Save inlikealion/14a8c224e4c889879581e822661c0742 to your computer and use it in GitHub Desktop.
sh one-liners for batch-conversion of images to webp via cwebp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# One-liners: | |
# See: https://www.smashingmagazine.com/2018/07/converting-images-to-webp/ | |
## JPG | |
find ./ -type f -name '*.jpg' -exec sh -c 'cwebp -q 80 $1 -o "${1%.jpg}.webp"' _ {} \; | |
## PNG | |
find ./ -type f -name '*.png' -exec sh -c 'cwebp -q 80 $1 -o "${1%.png}.webp"' _ {} \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment