Ich benutze Windows 10. Wie kann ich ein Batch-Script erstellen, was mit ImageMagick…
- User
Ich benutze Windows 10. Wie kann ich ein Batch-Script erstellen, was mit ImageMagick alle Bilder in einem Ordner zu JpegXL und einer Qualitaet von 93 encoded? Danach moechte ich einen VMAF score von allen Bildern erstellen und diese scores in eine Text-Datei namens "vmaf-scores.txt" speichern. Alle Bilder die einen Score unter 90% haben sollen noch einmal mit einer Qualitaet von 97 encoded werden und dessen VMAF scores sollen in einer Text-Datei namens "vmaf-scores-new.txt" gespeichert werden. Wenn bei einem Bild die Qualitaet immer noch unter 90% liegt, soll der Computer runtergefahren werden.
- Assistant
Sie können ein Batch-Skript mit dem folgenden Code erstellen:
@echo off
REM Set the path to ImageMagick and the VMAF tool set IM_PATH=C:\ImageMagick set VMAF_PATH=C:\vmaf
REM Set the input folder and output folder for images set INPUT_FOLDER=C:\input set OUTPUT_FOLDER=C:\output
REM Loop through all the images in the input folder for /r %INPUT_FOLDER% %%f in (*.jpg) do ( REM Encode the image to JpegXL with a quality of 93 %IM_PATH%\convert.exe "%%f" -quality 93 "%OUTPUT_FOLDER%%%~nf.jpegxl"
REM Calculate the VMAF score for the image %VMAF_PATH%\vmafossexec.exe yuv420p 1920 1080 %OUTPUT_FOLDER%%%~nf.jpegxl %OUTPUT_FOLDER%%%~nf.jpegxl > "%OUTPUT_FOLDER%\vmaf-scores.txt"
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.