New Script: iHDR -- Advanced Multiscale HDR Stretching!

Uri Darom

Member
For a more in depth use & installation guide for iHDR, use the following guide: https://uridarom.com/blog/using-ihdr

After many few weeks of refinement and testing, I am happy to present a script I have been working on for a while!

1709677888258.png


iHDR allows you to stretch the image in a way that preserves the bright areas while revealing its fainter regions.
An example use case for this script would be revealing the faint extensions of a galaxy, while not blowing out the bright center.
Below I have attached the image before iHDR, the image after two executions of iHDR, and the image stretched using HistogramTransformation instead (data courtesy of Prashant Ranganath):

Example 1: Galaxy

M101iHDR_Demonstration.png
M101iHDR_Demonstration.png


Note how the bright core of the galaxy is preserved while its outer arms are revealed, all while preserving the contrast of the image.
Galaxies are not the only use case; below is an example with the Orion Nebula:

Example 2: Nebula

OrioniHDR_Demonstration.png
OrioniHDR_Demonstration.png


Installation and Use:

To use the script, simply stretch the image (using HistogramTransformation) such that the bright areas (i.e., nebula / galaxy core) are at the brightness you want them to be in the final image. Then, select the appropriate preset and click Execute.
  • Often, you will find you need to run the script multiple times. In the above example, it was run three times.
  • If you want to increase how much the bright areas are preserved, increase the Mask Strength parameter.
  • If you want to decrease how much the image is stretched, reduce the Stretch Intensity parameter.
To install the script, use the following repository: https://uridarom.com/pixinsight/scripts/iHDR/
  • Note: since my developer certificate has not been approved yet, PixInsight will warn you about the script being unverified.


I would love to know people's thoughts or feedback!
 
Last edited:
Hello there! I tried to access the repository but I got the following message:

404​

File not found

The site configured at this address does not contain the requested file.

If this is your site, make sure that the filename case matches the URL as well as any file permissions.
For root URLs (like http://example.com/) you must provide an index.html file.

Read the full documentation for more information about using GitHub Pages.

GitHub Status@githubstatus
1710714026399.png

Was the repository changed to another link?
 
Hello there! I tried to access the repository but I got the following message:

404​

File not found

The site configured at this address does not contain the requested file.

If this is your site, make sure that the filename case matches the URL as well as any file permissions.
For root URLs (like http://example.com/) you must provide an index.html file.

Read the full documentation for more information about using GitHub Pages.

GitHub Status@githubstatus
View attachment 22429

Was the repository changed to another link?

Hey! The repository should be used in PixInsight; accessing it in a web browser will not work. Here are instructions for installing the script:

1. In PixInsight, go to Resources--> Updates --> Manage Repositories
2. Click the "Add" button on the bottom left of the popup
3. Enter the repository https://astrouri.com/pixinsight/scripts/iHDR/ and click "OK"
4. Close the window and click on Resources --> Updates --> Check For Updates
5. Click "Apply" on the bottom right of the popup and restart PixInsight
6. The script should appear under Scripts --> Sketchpad --> iHDR
 
On all first runs of iHDR, an error message appears in the Process Console reporting that line 543 has an undeclared variable
 
On all first runs of iHDR, an error message appears in the Process Console reporting that line 543 has an undeclared variable

Ah yeah; this is a harmless bug that I haven’t gotten around to fixing. Thanks for reminding me, I’ll take care of it tonight.
 
Hello, it does not work for me, I get the 404 even with the new repository link. Is there anything I could try off?
 
Hello, it does not work for me, I get the 404 even with the new repository link. Is there anything I could try off?
If you can open https://uridarom.com/ in a browser, the site is accessible to you. You will get a 404 error if you try opening the repository URL in a browser. In your repository entry, make sure you have the trailing backslash; when it's missing there are often problems.
 
I have the same issue - tried the link with the backslash at the end - rather than just bombing for iHDR it is killing the whole update process - has the author done something wrong to his repository and worse why odes one update location failing cause the whole update process to fail?
 
Hi all,

As I mentioned previously I am almost done migrating to a new domain. It seems like in the last push update to the website the pixinsight folder was not included along with the included scripts.
I will fix this issue in about 1-2 hours, after which the repository should work consistently.
Apologies for the trouble!
 
I really like the script. I would love to see a "preview" window instead of "Executing" to the image each time. If the preview looks good, then click "Execute" once.
 
I really like the script. I would love to see a "preview" window instead of "Executing" to the image each time. If the preview looks good, then click "Execute" once.
I’m glad to hear it! I have definitely considered adding a preview window; the only issue is that the process is heavily reliant on MMT, which is a very slow process (hence the script’s relatively long runtime). Even downsampling the image up to 8x for a preview still results in a 10s-30s delay between changing a setting and seeing the result.
That said, some may still find it useful even with a delay so I will explore that option further.
 
Back
Top