Page 1 of 1

HDR Module Use (v1.8)

Posted: Thu Dec 09, 2021 6:22 pm
by Guy
Here are some notes relating to using this module. It is not the only way to use the module - please experiment and provide feedback.
They relate to StarTools version 1.8.515 and later
Please let me know if anyone sees any errors or has any additional advice they think helpful so this post can be improved.
I will update this post as needed.
For an index of similar notes on the other StarTools modules see StarTools Main Window Use.

HDR Module - Automated Local Dynamic Range Optimization

Purpose:
  • To optimise an images medium-to-small local contrast.
Description:
The HDR module digs out small detail hidden in the image. It provides an automated curve manipulation. HDR can operate on either the image detail brightness, colour, or both.

Useful Sources
For a general overview see HDR: Automated Local Dynamic Range Optimization

When to use:
  • After the final global stretch (Develop or AutoDev) and after the Contrast module (if used).
Example Workflow (v1.8):
AutoDev-{Lens}-Bin-Crop-Wipe-AutoDev (or FilmDev)-{Contrast/HDR/Sharp/SVDecon}-Color-{Shrink/Filter/Entropy/SuperStr/NBAccent/}-Track/NR(Unified-Denoise)-{Flux/Repair/Heal/Layer/Synth}
Key: {...} optional modules

Method:
This is a way of using the module which should give good results in most cases:
  1. Select the appropriate preset: Optimize, Equalize, Tame, Reveal - see options below.
  2. Optionally, select a sample area to speed up processing - this is particularly helpful when trying to find the right Context Size.
  3. Adjust the 'Context Size' to target the size of detail you want. Changing 'Context Size' starts a lot of processing and can be slow so get this set first. Changing any other setting after this is quicker. If the default setting takes too long - try reducing it. Even reducing it to 30 and see if you get acceptable results.
  4. Adjust the 'Highlights Detail Boost' and 'Shadows Detail Boost' as needed to accentuate smaller detail.
  5. Adjust the 'Gamma Highlights' and 'Gamma Shadows' to accentuate detail in larger areas.
  6. Adjust the 'Gamma Smoothen' parameter to smooth the transition between locally stretched areas.
  7. Toggle top "Before/After" button to see effect of module if needed.
  8. If a sample area was selected press 'All' to process the complete image.
  9. Press 'Keep' when done.
What result to look for:
  • Enhanced detail in the area you targeted.
After Use:
  • Re-use the module to target other areas as needed.
  • Use the Decon module to resolve the finest detail - if needed.
  • Use the other optional modules as shown in the workflow. Then use the Color module.
Special Techniques:

Masking out the effect of HDR on stars
This is a technique for selectively removing the effect of the last module. See this forum topic. It can be used to remove the effect of the HDR Module on stars.
  1. Launch the Layer Module
  2. Open the Mask editor
  3. Create Mask - Auto Stars - Do - Keep
  4. In Layer Module - Copy the Undo buffer to the foreground layer - Undo > Fg
  5. You can mask the effect of the HDR module as required - The mask active (green) area is the area where the effect of the HDR module is undone.
  6. Adjust Mask Fuzz to get a smooth transition
  7. Adjust the mask to include as many of the pixels surrounding the stars as you want - use Grow or Shrink as needed.
  8. Keep the result when done.
To mimic the old HDR module (v1.7-) (including its processing times)
This is based on the discussion here
Thanks to Jochen for contributing this.
  • Reduce the Context Size parameter to much smaller than default - say to a old equivalent default of 30 up to a old maximum of 45.
  • Leave Quality set to Medium
  • This is a little more small-detail oriented, but you can back off the appearance of that effect by adjusting the controls.
  • One difference though compared to 1.7, is that even at max settings, the detail recovered in 1.8 is much more carefully placed in its surroundings, and does not look artificial, while also perfectly conforming to the noise levels of its surroundings (the latter extends also covers the interaction with the Gamma Highlight/Shadow parameter - consistency is maintained).
To mimic the 'Reveal DSO Core' preset of the old HDR module (v1.7-):
This is based on the discussion here
Thanks to Jochen for contributing this.
  • Reduce the Context Size parameter to much smaller than the default (50) - the equivalent old default is about 30 up to an old maximum is about 45.
  • Set Shadow Detail Boost as required
  • Leave Quality set to Medium
  • Leave all other parameters (e.g. Gamma Highlight, Gamma Shadow and Highlights Detail Boost) alone.
Description of Controls:

Presets:
Sets commonly used sets of parameter values.
  • Reveal - reveals details in almost-overexposed cores. Default Setting.
  • Tame - brings out detail in bright areas such as galaxy cores, like Equalize but doesn't brighten faint detail.
  • Optimize - accentuates detail it can find in both shadows and highlights.
  • Equalize - brings out detail in both shadows and highlights of larger areas.
Context Size
Adjust the Context Size to target the size of detail you want to bring out.
  • Changing context size starts a lot of processing so may take time. The larger the size the more processing.
  • If you set this first to get it out of the way - adjusting the other values after this is quicker.
  • Slider displays the percentage of the image size width and height.
  • Controls the upper limit to the size of the detail being accentuated.
  • A context size greater than 30 will likely take longer than the previous version of the HDR module - but will be more accurate.
  • A context size less that 30 will produce results similar in quality to the previous HDR module.
  • Selecting a sample area speeds up processing while you are finding the right 'Context Size' and 'Quality' settings. Then press 'All'.
  • Avoid extreme values.
  • Default is 50x50 pixels. Range is from 1 to 101.
Quality
Adjusts the quality of the result. This has a significant effect on processing time.
  • The Quality setting will affect the results in certain cases:
    • You will see greatest effect where there are many small areas of dynamic range changes where there is violent, turbulent, detail.
    • You will see little effect where there are a few large-scale areas where enhancement is required.
  • Choose a lower quality to increase processing speed.
  • Choose a higher quality to improve the accuracy of the result. Changing to 'High' will reduce processing speed.
  • Approximate Relative Processing Time (Medium =100%): Low 98%, Medium 100%, High 220%. This may vary with environment/settings.
  • This only affects the Gamma Correction part of the processing.
  • Default is Medium. Range is: Low, Medium, High.
Highlights Detail Boost
Accentuates detail in the highlights without affecting the brightness of larger contiguous areas.
  • Controls the strength of detail recovery in the highlights.
  • Increasing the value will bring out the detail.
  • Default is 30% (Reveal), 0% (Tame, Equalize), 50% (Optimize). Range is from 0% to 100%.
Shadows Detail Boost
Accentuates detail in the shadows without affecting the brightness of larger contiguous areas.
  • Controls the strength of detail recovery in the shadows.
  • Increasing the value will bring out the detail.
  • To mimic the 'Reveal Core' preset of the previous version of HDR - Just increase Shadows Detail Boost, optionally reduce Context Size, and keep all other values default.
  • Default is 30% (Reveal), 0% (Tame, Equalize), 50% (Optimize). Range is from 0% to 100%.
Signal Flow
Specifies the signal source the algorithm works on.
  • Tracked - Uses the Tracked signal which takes into account the noise evolution. Avoiding recovering 'detail' in low SNR areas. Recommended for most situations. This is only available if Tracking is on.
  • Visual As-Is - Uses the stretched image without making allowances for SNR.
  • Default is 'Tracked' (if Tracking is on). Range is: 'Visual As-Is', 'Tracked'.
Gamma Smoothen
This parameter controls the smoothness of the transition between different locally-stretched areas.
  • The default value is right for most situations.
  • Increase this value if boundaries can be seen.
  • Reduce this value (temporarily) to get an idea of the different areas HDR worked on.
  • Default is 20.0. Range is from 1.0 to 40.0.
Gamma Highlight (Tame)
Work on the larger contiguous bright areas to bring out the smaller scale detail within them.
  • Redistributes dynamic range (by using local gamma correction) to move detail out of the bright areas into the mid-tones - which allows better scope for accentuating it.
  • Default is 1.25 (Reveal, Equalize), 1.00 (Optimize), 3.00 (Tame). Range is from 1.00 to 5.00.
Gamma Shadow (Lift)
Work on the larger contiguous areas of shadow to bring out the smaller scale detail within them.
  • Redistributes dynamic range (by using local gamma correction) to move detail out of the shadows into the mid-tones - which allows better scope for accentuating it.
  • Default is 1.00 (Reveal, Optimize, Tame), 1.25 (Equalize). Range is from 1.00 to 5.00.
Background Notes:

Old vs New HDR
  • Old 'Detail Size' is related to new 'Context Size' but 'Detail Size' increased processing linearly not exponentially.
  • There is a square root relationship. The old 'Detail Size' default of 1000 is roughly equivalent to a new 'Context Size' of 32. The old 'Detail Size' maximum of 2000 is roughly equivalent to a new 'Context Size' of 45.
  • In the old module the highest 'Detail size' was equivalent to a very low 'Context Size' in the new module.
  • The old module offered a Gamma Correction algorithm or a Detail Boost algorithm
  • The new module combines both Gamma Correction and Detail Boost
  • To mimic the 'Reveal Core' preset of the previous version of HDR - Just increase Shadows Detail Boost, optionally reduce Context Size, and keep all other values default.
Performance

For a discussion of performance issues see this forum post.

Comparative tests done with STReplay show that changes to Context Size greatly affect the processing time for this module.
In a simple test the time taken for the processing to stop (wheel disappears) relative to a Context Size of 50 were as follows:

Code: Select all

Context Size      50  40  30  25  20  10
%Processing time 100  50  15   6   4   2
Effect of Quality Setting
  • Approximate Relative Processing Time (Medium =100%): Low 98%, Medium 100%, High 220%.
  • This may vary with environment/settings.
Improving Performance
  • If image oversampled consider binning
  • Reduce Context Size to about 30. Increase from there as needed.
  • Reduce Quality to 'Medium' or 'Low' and see if you still get acceptable results.