Last active
August 30, 2016 07:51
-
-
Save StefMa/7a4e4ce396d7a9f10524c8567636fa21 to your computer and use it in GitHub Desktop.
Simple PNG/JPG to WebP converter
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
images=($(find . -iname '*.png' -o -iname '*.jpg')) | |
for image in "${images[@]}"; do | |
webp_file_path="${image::${#image}-4}.webp" | |
echo "Convert ${image} to ${webp_file_path}" | |
$(./cwebp-5.1 -quiet "${image}" -o "${webp_file_path}") | |
rm "${image}" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment