-
-
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" |
life saver
This is what works for me in a Windows batch file:
for %%f in (*.webp) do dwebp.exe -o "%%~nf.png" "%%f"
EnJoY ;-P
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
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
done and all the images disappeared...
always keep a backup of your images
just used a program i got instead. was easy to get all the images back due to the original way i got them using yt-dlp. still confused why it deleted them all though.
Under rated code. Thank you!