From a1a8ae3ac1a8346e51d6dcb4a2f435815fe7a7b3 Mon Sep 17 00:00:00 2001 From: 3DJ <71472458+ThreeDeeJay@users.noreply.github.com> Date: Sun, 5 Nov 2023 18:25:32 -0500 Subject: [PATCH] Update converters --- JPG-JXL.bat | 2 +- JPS-JXL.bat | 2 +- JXL-JPG.bat | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++ JXL-JPS.bat | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++++ PNG-WebP.bat | 2 +- PNS-WebP.bat | 2 +- WebP-PNG.bat | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++ WebP-PNS.bat | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++ 8 files changed, 311 insertions(+), 4 deletions(-) create mode 100644 JXL-JPG.bat create mode 100644 JXL-JPS.bat create mode 100644 WebP-PNG.bat create mode 100644 WebP-PNS.bat diff --git a/JPG-JXL.bat b/JPG-JXL.bat index fbb45dd..e1bf5cf 100644 --- a/JPG-JXL.bat +++ b/JPG-JXL.bat @@ -71,6 +71,6 @@ EXIT /B :Encode ECHO Encoding %2 -"%~dp0cjxl.exe" %1 %2 --verbose --quality=100 --effort=9 +"%~dp0Converters/cjxl.exe" %1 %2 --verbose --quality=100 --effort=9 ECHO. EXIT /B \ No newline at end of file diff --git a/JPS-JXL.bat b/JPS-JXL.bat index 9561e5c..1413deb 100644 --- a/JPS-JXL.bat +++ b/JPS-JXL.bat @@ -71,6 +71,6 @@ EXIT /B :Encode ECHO Encoding %2 -"%~dp0cjxl.exe" %1 %2 --verbose --quality=100 --effort=9 +"%~dp0Converters/cjxl.exe" %1 %2 --verbose --quality=100 --effort=9 ECHO. EXIT /B \ No newline at end of file diff --git a/JXL-JPG.bat b/JXL-JPG.bat new file mode 100644 index 0000000..81df141 --- /dev/null +++ b/JXL-JPG.bat @@ -0,0 +1,76 @@ +@echo off + +SETlocal EnableExtensions +SETlocal EnableDelayedExpansion + +TITLE JPG lossless batch converter - By 3DJ + +SET InputFormat=JXL + +pushd "%~dp0" +IF NOT "%~1"=="" ( + IF EXIST "%~1/*" ( + CD "%~1" + pushd "%~1" + SET "OutputPath=%~1\" + ) ELSE ( + For %%A in ("%~1") do ( + CALL :Convert %%A "%%~dpA%%~nA.jpg" + PAUSE + EXIT + ) + ) + ) + +ECHO. +ECHO Press any key to convert all the !InputFormat! files in this folder and subfolders +ECHO Output format: JPG lossless +IF DEFINED OutputPath ( + ECHO Output folder: !OutputPath! + ) ELSE ( + ECHO Output folder: JPG\ + ) +ECHO Folder structure: Same as input relative path +ECHO. +ECHO - To generate JPG files in the same folder as the input files, +ECHO close this window and drag the folder/file into the .bat file. +ECHO - Existing JPG files will be skipped, +ECHO so you can stop and resume batch conversion later if needed. +PAUSE >NUL +ECHO. + +FOR /R %%A in (*.*) do ( + IF /I "%%~xA"==".!InputFormat!" ( + SET "OutputPath=%%~dpA" + IF "%~1"=="" ( + SET "OutputPath=%~dp0JPG\!OutputPath:%~dp0=!" + IF NOT EXIST "!OutputPath!" ( + MKDIR "!OutputPath!" + ) + ) + CALL :Convert "%%A" "!OutputPath!%%~nA.jpg" + ) + ) +ECHO Press any key to open the output folder +PAUSE +"!OutputPath!" + +:Convert +IF NOT EXIST %2 ( + CALL :Encode %1 %2 + ) ELSE ( + For %%F in (%2) do (SET Filesize=%%~zF) + if !Filesize! EQU 0 ( + ECHO %2 already exists, but seems corrupted/empty. Re-converting... + CALL :Encode %1 %2 + ) ELSE ( + ECHO %2 already exists. Skipping... + ) + ) +EXIT /B + +:Encode +ECHO Encoding %2 +"%~dp0Converters/djxl.exe" %1 %2 +ECHO. +EXIT /B \ No newline at end of file diff --git a/JXL-JPS.bat b/JXL-JPS.bat new file mode 100644 index 0000000..75016e5 --- /dev/null +++ b/JXL-JPS.bat @@ -0,0 +1,79 @@ +@echo off + +SETlocal EnableExtensions +SETlocal EnableDelayedExpansion + +TITLE JPS lossless batch converter - By 3DJ + +SET InputFormat=JXL + +pushd "%~dp0" +IF NOT "%~1"=="" ( + IF EXIST "%~1/*" ( + CD "%~1" + pushd "%~1" + SET "OutputPath=%~1\" + ) ELSE ( + For %%A in ("%~1") do ( + CALL :Convert %%A "%%~dpA%%~nA.jpg" + PAUSE + EXIT + ) + ) + ) + +ECHO. +ECHO Press any key to convert all the !InputFormat! files in this folder and subfolders +ECHO Output format: JPS lossless +IF DEFINED OutputPath ( + ECHO Output folder: !OutputPath! + ) ELSE ( + ECHO Output folder: JPS\ + ) +ECHO Folder structure: Same as input relative path +ECHO. +ECHO - To generate JPS files in the same folder as the input files, +ECHO close this window and drag the folder/file into the .bat file. +ECHO - Existing JPS files will be skipped, +ECHO so you can stop and resume batch conversion later if needed. +PAUSE >NUL +ECHO. + +FOR /R %%A in (*.*) do ( + IF /I "%%~xA"==".!InputFormat!" ( + SET "OutputPath=%%~dpA" + IF "%~1"=="" ( + SET "OutputPath=%~dp0JPS\!OutputPath:%~dp0=!" + IF NOT EXIST "!OutputPath!" ( + MKDIR "!OutputPath!" + ) + ) + CALL :Convert "%%A" "!OutputPath!%%~nA.jps" + ) + ) +ECHO Press any key to open the output folder +PAUSE +"!OutputPath!" + +:Convert +IF NOT EXIST %2 ( + CALL :Encode %1 %2 + ) ELSE ( + For %%F in (%2) do (SET Filesize=%%~zF) + if !Filesize! EQU 0 ( + ECHO %2 already exists, but seems corrupted/empty. Re-converting... + CALL :Encode %1 %2 + ) ELSE ( + ECHO %2 already exists. Skipping... + ) + ) +EXIT /B + +:Encode +ECHO Encoding %2 +"%~dp0Converters/djxl.exe" %1 %2 +For %%O in ("%~2") do ( + Move %2 "%%~dpA%%~nA.jps" + ) +ECHO. +EXIT /B \ No newline at end of file diff --git a/PNG-WebP.bat b/PNG-WebP.bat index 9b27f4f..6d17ecf 100644 --- a/PNG-WebP.bat +++ b/PNG-WebP.bat @@ -71,6 +71,6 @@ EXIT /B :Encode ECHO Encoding %2 -"%~dp0cwebp.exe" -v -mt -noasm -metadata all -progress -lossless -z 8 -m 6 -q 99 %1 -o %2 +"%~dp0Converters/cwebp.exe" -v -mt -noasm -metadata all -progress -lossless -z 8 -m 6 -q 99 %1 -o %2 ECHO. EXIT /B \ No newline at end of file diff --git a/PNS-WebP.bat b/PNS-WebP.bat index 0bdc42c..ffd0aa8 100644 --- a/PNS-WebP.bat +++ b/PNS-WebP.bat @@ -71,6 +71,6 @@ EXIT /B :Encode ECHO Encoding %2 -"%~dp0cwebp.exe" -v -mt -noasm -metadata all -progress -lossless -z 8 -m 6 -q 99 %1 -o %2 +"%~dp0Converters/cwebp.exe" -v -mt -noasm -metadata all -progress -lossless -z 8 -m 6 -q 99 %1 -o %2 ECHO. EXIT /B \ No newline at end of file diff --git a/WebP-PNG.bat b/WebP-PNG.bat new file mode 100644 index 0000000..f46abf3 --- /dev/null +++ b/WebP-PNG.bat @@ -0,0 +1,76 @@ +@echo off + +SETlocal EnableExtensions +SETlocal EnableDelayedExpansion + +TITLE PNS lossless batch converter - By 3DJ + +SET InputFormat=WebP + +pushd "%~dp0" +IF NOT "%~1"=="" ( + IF EXIST "%~1/*" ( + CD "%~1" + pushd "%~1" + SET "OutputPath=%~1\" + ) ELSE ( + For %%A in ("%~1") do ( + CALL :Convert %%A "%%~dpA%%~nA.png" + PAUSE + EXIT + ) + ) + ) + +ECHO. +ECHO Press any key to convert all the !InputFormat! files in this folder and subfolders +ECHO Output format: PNS lossless +IF DEFINED OutputPath ( + ECHO Output folder: !OutputPath! + ) ELSE ( + ECHO Output folder: PNS\ + ) +ECHO Folder structure: Same as input relative path +ECHO. +ECHO - To generate PNS files in the same folder as the input files, +ECHO close this window and drag the folder/file into the .bat file. +ECHO - Existing PNS files will be skipped, +ECHO so you can stop and resume batch conversion later if needed. +PAUSE >NUL +ECHO. + +FOR /R %%A in (*.*) do ( + IF /I "%%~xA"==".!InputFormat!" ( + SET "OutputPath=%%~dpA" + IF "%~1"=="" ( + SET "OutputPath=%~dp0PNS\!OutputPath:%~dp0=!" + IF NOT EXIST "!OutputPath!" ( + MKDIR "!OutputPath!" + ) + ) + CALL :Convert "%%A" "!OutputPath!%%~nA.pns" + ) + ) +ECHO Press any key to open the output folder +PAUSE +"!OutputPath!" + +:Convert +IF NOT EXIST %2 ( + CALL :Encode %1 %2 + ) ELSE ( + For %%F in (%2) do (SET Filesize=%%~zF) + if !Filesize! EQU 0 ( + ECHO %2 already exists, but seems corrupted/empty. Re-converting... + CALL :Encode %1 %2 + ) ELSE ( + ECHO %2 already exists. Skipping... + ) + ) +EXIT /B + +:Encode +ECHO Encoding %2 +"%~dp0Converters/dwebp.exe" %1 -o %2 +ECHO. +EXIT /B \ No newline at end of file diff --git a/WebP-PNS.bat b/WebP-PNS.bat new file mode 100644 index 0000000..0be3ea3 --- /dev/null +++ b/WebP-PNS.bat @@ -0,0 +1,76 @@ +@echo off + +SETlocal EnableExtensions +SETlocal EnableDelayedExpansion + +TITLE PNS lossless batch converter - By 3DJ + +SET InputFormat=WebP + +pushd "%~dp0" +IF NOT "%~1"=="" ( + IF EXIST "%~1/*" ( + CD "%~1" + pushd "%~1" + SET "OutputPath=%~1\" + ) ELSE ( + For %%A in ("%~1") do ( + CALL :Convert %%A "%%~dpA%%~nA.pns" + PAUSE + EXIT + ) + ) + ) + +ECHO. +ECHO Press any key to convert all the !InputFormat! files in this folder and subfolders +ECHO Output format: PNS lossless +IF DEFINED OutputPath ( + ECHO Output folder: !OutputPath! + ) ELSE ( + ECHO Output folder: PNS\ + ) +ECHO Folder structure: Same as input relative path +ECHO. +ECHO - To generate PNS files in the same folder as the input files, +ECHO close this window and drag the folder/file into the .bat file. +ECHO - Existing PNS files will be skipped, +ECHO so you can stop and resume batch conversion later if needed. +PAUSE >NUL +ECHO. + +FOR /R %%A in (*.*) do ( + IF /I "%%~xA"==".!InputFormat!" ( + SET "OutputPath=%%~dpA" + IF "%~1"=="" ( + SET "OutputPath=%~dp0PNS\!OutputPath:%~dp0=!" + IF NOT EXIST "!OutputPath!" ( + MKDIR "!OutputPath!" + ) + ) + CALL :Convert "%%A" "!OutputPath!%%~nA.pns" + ) + ) +ECHO Press any key to open the output folder +PAUSE +"!OutputPath!" + +:Convert +IF NOT EXIST %2 ( + CALL :Encode %1 %2 + ) ELSE ( + For %%F in (%2) do (SET Filesize=%%~zF) + if !Filesize! EQU 0 ( + ECHO %2 already exists, but seems corrupted/empty. Re-converting... + CALL :Encode %1 %2 + ) ELSE ( + ECHO %2 already exists. Skipping... + ) + ) +EXIT /B + +:Encode +ECHO Encoding %2 +"%~dp0Converters/dwebp.exe" %1 -o %2 +ECHO. +EXIT /B \ No newline at end of file