Version that downloads dependencies. Save as .bat drag and drop an image onto it.
@echo off
if "%~1"=="" exit
set "safe_f0=%~f0" & set "safe_1=%~1"
set "safe_f0=%safe_f0:'=''%" & set "safe_1=%safe_1:'=''%"
net session >nul 2>&1
if %errorlevel% neq 0 (
powershell -Command "Start-Process cmd -ArgumentList ('/c ' + [char]34 + [char]34 + '%safe_f0%' + [char]34 + ' ' + [char]34 + '%safe_1%' + [char]34 + [char]34) -Verb RunAs"
exit /b
)
cd /d "%~dp0"
call :find_tool "FFmpeg" "%~dp0bin\FFmpeg\ffmpeg-master-latest-win64-gpl\bin\ffmpeg.exe" "%~dp0ffmpeg.exe" "https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-win64-gpl.zip"
call :find_tool "ultrahdr_app" "%~dp0bin\ultrahdr_app\ultrahdr_app.exe" "%~dp0ultrahdr_app.exe" "https://files.catbox.moe/knnvou.zip"
set "cfg_path=%temp%\metadata.cfg"
if not exist "%cfg_path%" (
(
echo --maxContentBoost 4.0& echo --minContentBoost 1.0& echo --gamma 1.0
echo --offsetSdr 0.015625& echo --offsetHdr 0.015625
echo --hdrCapacityMin 1.0& echo --hdrCapacityMax 4.0& echo --useBaseColorSpace 1
) > "%cfg_path%"
)
"%FFmpeg%" -y -i "%~1" -vf "[0:v]split=2[bg][fg];[bg]drawbox=c=black:t=fill[bg];[bg][fg]overlay=format=auto,format=yuv420p" -loglevel panic -update 1 -q:v 1 -qmin 1 "%temp%\sdr.jpg"
"%FFmpeg%" -y -i "%temp%\sdr.jpg" -vf "gradfun=strength=5:radius=8, curves=master='0/0 0.96/0.96 0.97/0.985 0.99/0.995 1/1',eq=saturation=0.2" -loglevel panic -update 1 -q:v 1 -qmin 1 "%temp%\hdr.jpg"
"%ultrahdr_app%" -m 0 -i "%temp%\sdr.jpg" -g "%temp%\hdr.jpg" -f "%cfg_path%" -M 1 -s 1 -q 100 -Q 100 -D 1 -z "%~dp0%~n1_hdr.jpg"
exit
:find_tool
for /f "delims=" %%i in ('where %~1 2^>nul') do set "%~1=%%i" & goto :eof
if exist "%~2" set "%~1=%~2" & goto :eof
if exist "%~3" set "%~1=%~3" & goto :eof
echo %~1 missing. Downloading . . .
mkdir "bin\%~1" >nul 2>&1
curl --progress-bar -L -o "bin\%~1.zip" %~4
tar -xf "bin\%~1.zip" -C "bin\%~1"
set "%~1=%~2"
cls & goto :eof