-
Notifications
You must be signed in to change notification settings - Fork 0
/
DenoiseHDR_Alpha.cmd
34 lines (28 loc) · 954 Bytes
/
DenoiseHDR_Alpha.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
@echo off
set mconvert="%~dp0lib\ImageMagick\convert.exe"
set denoise="%~dp0lib\OIDN\bin\denoise.exe"
%mconvert% %1 -endian LSB tmp_converted.pfm
echo =================
echo Starting Denoiser
echo =================
%denoise% -hdr tmp_converted.pfm -o tmp_denoised.pfm
%mconvert% tmp_denoised.pfm "tmp_denoised_noalpha%~x1"
echo =====================
echo Copying Alpha Channel
echo =====================
%mconvert% "tmp_denoised_noalpha%~x1" %1 -compose CopyOpacity -composite -compress zip "%~n1_denoised%~x1"
echo =================
echo Creating Previews
echo =================
%mconvert% %1 -colorspace RGB -colorspace sRGB -alpha on tmp_before.png
%mconvert% "%~n1_denoised%~x1" -colorspace RGB -colorspace sRGB -alpha on tmp_after.png
echo =====================
echo Cleaning up directory
echo =====================
del tmp_converted.pfm
del tmp_denoised.pfm
del "tmp_denoised_noalpha%~x1"
echo ==========
echo Job done!
echo ==========
pause