-
-
Save matijagrcic/c28319b22e2ffffad366c3e00ae7b5aa to your computer and use it in GitHub Desktop.
#Download dwebp (WebP decoder tool) https://developers.google.com/speed/webp/download | |
#Run | |
for %f in (*.webp) do dwebp.exe "%f" -o "%~nf.png" |
A true life saver. I just had to convert 300 images.
is there a way to remove the original files automatically?
How to run this code? Do you have to save the image files in the same directory?
Thank you, using ZSH with for f in *.webp; do dwebp $f -o $f:r.png; done
where $f:r
strips the filetype
@mheland thank you!!!
Thank you, using ZSH with
for f in *.webp; do dwebp $f -o $f:r.png; done
where$f:r
strips the filetype
This worked for me! Thank you!
best program ive encountered in the last years thank you very much
is there a way to remove the original files automatically?
for %%f in (*.webp) do (
dwebp.exe -o "%%~nf.png" "%%f"
del "%%f"
)
Powershell
Get-ChildItem -Filter *.webp | ForEach-Object { & '.\dwebp.exe' $_.FullName -o "$($_.BaseName).png" }
little batch file I made for the community here:
https://gist.github.com/spenceryonce/e849800e7d7fcbb8645431f7f8abaa81
![image](https://private-user-images.githubusercontent.com/9080157/326353972-40c023f3-e401-4cbe-ae79-bfbe016b88d9.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAyOTc4ODIsIm5iZiI6MTcyMDI5NzU4MiwicGF0aCI6Ii85MDgwMTU3LzMyNjM1Mzk3Mi00MGMwMjNmMy1lNDAxLTRjYmUtYWU3OS1iZmJlMDE2Yjg4ZDkucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcwNiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MDZUMjAyNjIyWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9OGJjMTc2NDI0YmJjOTBmNGY3MGVjZjMyNDgwOWE1MTJkZGFmYjk1OGVmMjdkZDc1ZWI1ZjllMzEwODY0MWU0MyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.jzUaX2NRXqAlrvwy8ha-flSPYoBCoRa24HzZKSH1Bs4)
is there a way to remove the original files automatically?
for %%f in (*.webp) do ( dwebp.exe -o "%%~nf.png" "%%f" del "%%f" )
@echo off
setlocal
REM Convert all WEBP files to PNG and then delete the WEBP files
for %%f in (*.webp) do (
echo Converting %%f...
dwebp.exe "%%f" -o "%%~nf.png"
if errorlevel 1 (
echo Failed to convert %%f
) else (
del "%%f"
echo Deleted %%f
)
)
echo Conversion complete.
pause
This is what works for me in a Windows batch file:
for %%f in (*.webp) do dwebp.exe -o "%%~nf.png" "%%f"
EnJoY ;-P