HDR v2.0 or improved HDR – part 2 – the script

The Script, the Profiles and the How To ( Linux ) :

  1. Make or open a ( preferebly ) empty folder to develop the HDR
  2. Create document in this folder ( right click in folder, create document ) -> empty file
  3. Choose apropriate filename for it ( in my case : RT-HDR-Fusion.sh )
  4. Copy/paste the script below in this file
  5. Create also the two bracketing Profile’s and finishing Profile ( below ) in the same folder
  6. Open terminal in the same folder ( right click in folder and open terminal )
  7. Type : chmod +x filename ( only for the “.sh” file – in this case : chmod +x RT-HDR-Fusion.sh )
  8. For testing this script, copy/paste one ( preferable) RAW picture in this folder
  9. Again run terminal in folder
  10. Run script by typing : ./filename ( in this case : ./RT-HDR-Fusion.sh )

The script, depending of computer and RAW file size, runs for about 3-5 minutes,
it creates 7 tif output files, of which 5 to make the final two output tif’s :
RT-HDR-Fusion.tif -> fused neutral/HDR + original exif data
RT-HDR-Fusion-TM.tif -> same as above, but extra Tone Mapping, exposure levels and sharpening.
The identical script is in full use by me, and fully tested – works like a charm.

Linux Script RT-HDR-Fusion.sh :

#!/bin/sh

echo “Hello “$USER”.”
echo “type input/output path, no end slash :”
read filepath
echo “type file extention or filename if more then one file present, example: *.DNG or filename.DNG :”
read ext1

echo “make bracketed pictures”

rawtherapee -o $filepath/neutral.tif -b8 -t -c $filepath/$ext1
rawtherapee -o $filepath/negative-1.5.tif -p $filepath/negative-1.5.pp3 -b8 -t -c $filepath/$ext1
rawtherapee -o $filepath/positive-1.5.tif -p $filepath/positive-1.5.pp3 -b8 -t -c $filepath/$ext1

echo “make HDR with LuminanceHDR and preset parameters”

luminance-hdr-cli -t mantiuk06 -p contrast=0.90:equalization=false:saturation=1.5:detail=20 -g 0.75 neutral.tif negative-1.5.tif positive-1.5.tif -e 0,-1.5,+1.5 -o hdr-from-3.tif

echo “fuse neutral and hdr-from-3 together”

enfuse –levels=auto –exposure-weight=1 –saturation-weight=1 –contrast-weight=1 –output=$filepath/RT-HDR-Fusion.tif $filepath/neutral.tif $filepath/hdr-from-3.tif

echo “add original exif data from neutral to fusion”

exiftool -TagsFromFile neutral.tif RT-HDR-Fusion.tif

echo “tonemap fusion and make new file”

rawtherapee -o $filepath/RT-HDR-Fusion-TM.tif -p RT-Tone-Mapping.pp3 -b8 -t -c $filepath/RT-HDR-Fusion.tif

echo “RT-HDR-Fusion is ready”

echo “open rawtherapee in folder”

rawtherapee $filepath

Profiles in the script :

Bracketing Profile – 1.5 ( name in the script : negative-1.5.pp3 ) :

[Version]
AppVersion=
Version=326

[Exposure]
Auto=false
Clip=0.02
Compensation=-1.5
Brightness=0
Contrast=0
Saturation=0
Black=0
HighlightCompr=0
HighlightComprThreshold=0
ShadowCompr=50
CurveMode=Standard
CurveMode2=Standard
Curve=0;
Curve2=0;

[HLRecovery]
Enabled=false
Method=Blend

[RAW]
CAAutoStrength=2

Bracketing Profile + 1.5 ( name in the script : positive-1.5.pp3 ) :

[Version]
AppVersion=
Version=326

[Exposure]
Auto=false
Clip=0.02
Compensation=1.5
Brightness=0
Contrast=0
Saturation=0
Black=0
HighlightCompr=0
HighlightComprThreshold=0
ShadowCompr=50
CurveMode=Standard
CurveMode2=Standard
Curve=0;
Curve2=0;

[HLRecovery]
Enabled=false
Method=Blend

[RAW]
CAAutoStrength=2

RawTherapee Exposure, Sharpening and Tone Mapping Profile ( name in the script : RT-Tone-Mapping.pp3 ) :

[Version]
AppVersion=
Version=326

[Exposure]
Auto=true
Clip=0.02
Compensation=0
Brightness=0
Contrast=0
Saturation=25
Black=0
HighlightCompr=0
HighlightComprThreshold=33
ShadowCompr=50
CurveMode=Standard
CurveMode2=Standard
Curve=0;
Curve2=0;

[HLRecovery]
Enabled=false
Method=Blend

[Sharpening]
Enabled=true
Method=usm
Radius=1.0
Amount=135
Threshold=20;80;2000;1200;
OnlyEdges=true
EdgedetectionRadius=1.8999999999999999
EdgeTolerance=1800
HalocontrolEnabled=true
HalocontrolAmount=85
DeconvRadius=0.75
DeconvAmount=75
DeconvDamping=20
DeconvIterations=30

[EPD]
Enabled=true
Strength=0.50
Gamma=1
EdgeStopping=1.3999999999999999
Scale=0.29999999999999999
ReweightingIterates=0

[RAW]
CAAutoStrength=2

[Version]
AppVersion=
Version=326

[Exposure]
Auto=true
Clip=0.02
Compensation=0
Brightness=0
Contrast=0
Saturation=25
Black=0
HighlightCompr=0
HighlightComprThreshold=33
ShadowCompr=50
CurveMode=Standard
CurveMode2=Standard
Curve=0;
Curve2=0;

[HLRecovery]
Enabled=false
Method=Blend

[Sharpening]
Enabled=true
Method=usm
Radius=1.0
Amount=135
Threshold=20;80;2000;1200;
OnlyEdges=true
EdgedetectionRadius=1.8999999999999999
EdgeTolerance=1800
HalocontrolEnabled=true
HalocontrolAmount=85
DeconvRadius=0.75
DeconvAmount=75
DeconvDamping=20
DeconvIterations=30

[EPD]
Enabled=true
Strength=0.50
Gamma=1
EdgeStopping=1.3999999999999999
Scale=0.29999999999999999
ReweightingIterates=0

[RAW]
CAAutoStrength=2

In Part 3, I will write about how to adjust,
how to make the script interactive,
script differences between Windows and Linux,
and why I used the above parameters and the logic behind the script.

Leave a Reply

Your email address will not be published. Required fields are marked *