Color-Corrected HDRMT

rcroman

Well-known member
Hi folks,

Maybe this has been covered elsewhere before, so please pardon a relative PI newbie, and let me know if there is an existing process that solves this problem...

I've struggled quite a bit with maintaining color when using the HDRMultiscaleTransform process. While it does a wonderful job of taming the luminance of high dynamic range objects, I couldn't quite get it maintain accurate color in the areas it did the most work on. You can try to boost the saturation up afterwards in the brighter areas, but this requires masking or other tricky approaches, and in any case the hues get altered.

Here is a modified workflow that maintains excellent color, with the original hue and saturation present prior to HDRMT.
  • Start from a nonlinear (stretched) image
  • Use ChannelExtraction to extract the hue and saturation channels (HSI model, not HSV)
    • Saturation is computed differently in the HSI and HSV models, and HSV will not work well for this approach
  • Perform HDRMT with your favorite parameters (number of layers, iterations, etc.)
  • Use ChannelExtraction again to extract the intensity channel (HSI model )
  • Use ChannelCombination to recombine the new intensity with the original hue and saturation
Here is a series of example images showing the results. No additional processing steps were applied other than those stated.

The original image (an HDRComposition of 600- and 60-second exposures, photometrically calibrated, stretched, and with ExponentialTransformation):
original.jpg


HDRMT, default options except 8 layers:
hdrmt 8 no options.jpg


The dynamic range is definitely under control, and there is color in the Trapezium region, but the hues are altered as can be seen by inspecting a "de-stretched" version of the original:

original destretch.jpg


Trying other options gives the following...

HDRMT, 8 layers, "to lightness" selected:
hdrmt 8 to lightness.jpg


"To lightness" and "preserve hue" selected:
hdrmt 8 to lightness preserve hue.jpg


"To lightness" and "lightness mask" selected:
hdrmt 8 to lightness with mask.jpg


As you can see, the color either gets its hue altered and/or becomes very desaturated in the bright areas.

Here is the result of following the color-corrected HDRMT workflow above:
cchdrmt.jpg


I'm working on a script that automates this flow, but it's pretty easy to do by hand.

Again, please let me know if there is already an existing process that accomplishes this. If not, perhaps the HDRMT process could be given an additional option to do this.

Best,

Russ
 
Last edited:
Hi Russel,

Interesting solution. Although HSI is not a colorimetrically defined color space, preserving its hue and saturation components is working remarkably well in this case. The HDRMT tool preserves the CIE h* component when the preserve hue option is selected, but your method seems to work better in extreme cases with huge dynamic ranges, like this M42 image.

This feature can be implemented in the HDRMT tool quite easily. I'll try to write the required changes as soon as possible, thank you for this excellent suggestion.
 
Sounds great, Juan. Let me know if you want the updated HDRMT tool tested... I have some photos of other targets that benefit from this approach.

Best,

Russ
 
Here is a script that implements this approach. It duplicates most of the parameters in HDRMT so they can be adjusted. It will also use any mask that is enabled on the original image... I find this is useful with a star mask to avoid the "holes" that HDRMT can create in the centers of saturated stars.

I sometimes find that HDRMT can be a little bit aggressive, particularly when using a small number of layers, so I also implemented an "opacity" slider that allows you to blend the HDR-compressed intensity with the original.

-Russ
 

Attachments

  • ColorCorrectedHDRMT.js.zip
    5.2 KB · Views: 1,185
Hi Russ,
I have tried numerous times to download and I just get my "downloads" page to open with an option to save. It will not let me download when I press "save". Any ideas how to get this to work? I am running Windows 11.
 
Hi Russ,
I have tried numerous times to download and I just get my "downloads" page to open with an option to save. It will not let me download when I press "save". Any ideas how to get this to work? I am running Windows 11.
This sounds like a browser issue. I just tested downloading the attachment in the above post and it worked fine.
 
Russ, Sorry for being a dummy but I finally got the script to download and unzipped. I tried adding it to scripts but I get a PI error. Then I tried dragging it into library and it isn't recognized. What am I doing wrong? Thanks, Dean
 
Here is a script that implements this approach. It duplicates most of the parameters in HDRMT so they can be adjusted. It will also use any mask that is enabled on the original image... I find this is useful with a star mask to avoid the "holes" that HDRMT can create in the centers of saturated stars.

I sometimes find that HDRMT can be a little bit aggressive, particularly when using a small number of layers, so I also implemented an "opacity" slider that allows you to blend the HDR-compressed intensity with the original.

-Russ
Is there a new version of this script? Where can I get it ?
 
Found this thread while searching for solution: have Orion Nebula HDR from 10 second and much longer oversaturated exposures combined. I use HDRMT to lightness with hue preserved, lightness mask, 6 layers, etc and I get good results in terms of contrast and detail, but the core of M42 totally gray and desaturated. I’ll try the custom script here and just wanted to add to the thread that as a user of Pixinsight for several years, it sounds like a great enhancement to incorporate. +1
 
Back
Top