Skip to content

Instantly share code, notes, and snippets.

@mattrefghi
Created December 8, 2023 20:47
Show Gist options
  • Select an option

  • Save mattrefghi/6577a056ea4ce2f7bd2986117d09e8b9 to your computer and use it in GitHub Desktop.

Select an option

Save mattrefghi/6577a056ea4ce2f7bd2986117d09e8b9 to your computer and use it in GitHub Desktop.
This is a fairly dumb batch file that, when placed in a folder, will run Google's cwebp.exe (https://developers.google.com/speed/webp/docs/precompiled) against all .jpg files in the same folder as the script. Could be a lot smarter, but it did the trick, figured it could be a good starting point for someone else.
@echo off
set /a counter=0
for %%f in (*.jpg) do (
C:\libwebp\bin\cwebp.exe -q 80 %%f -o %%~nf.webp
set /A counter=counter+1
)
echo ************************************
echo %counter% files have been processed.
echo ************************************
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment