Generalised Hyperbolic Stretching - revisited

Mike1485

Well-known member
Further to Dave Payne's post on this forum on 3rd October 2021, he and I have been working over recent weeks to incorporate his Generalised Hyperbolic stretching equations into a script. The result is a script that we hope will be helpful to Pixinsight users by providing a significant extension to the existing armory of stretching utilities already available.

The script provides an integrated environment to facilitate the design, appraisal and application of stretches to your images. All of this can be done from within the script. Of course, the script provides access to Dave's Generalised Hyperbolic stretching equations. It also provides access to the familiar Histogram Transformation and acrsinh type stretches, while also adding some additional functionality to these traditional stretches.

In this release package we have included detailed documentation. This provides both functional descriptions of the use of the script and also a detailed walk-through. The walk through includes practical insights that we hope will help you improve the quality of your final stretched images - even if you are not using the script!

We would welcome feedback on either the script or the documentation. Please let us know: if you find the script useful; if you would find additional functionality useful; or if you find any bugs; or any other feedback. All feedback is welcome!

https://github.com/mikec1485/GHS/releases/tag/v1.0
 
maybe i have installed it wrong but i couldn't get the documentation to open from within the script... and when i pointed the PI documentation browser at it the browser was not parsing some of the tags as html but printing them as text.
 
maybe i have installed it wrong but i couldn't get the documentation to open from within the script... and when i pointed the PI documentation browser at it the browser was not parsing some of the tags as html but printing them as text.
Peculiar!

I am on a Mac and have placed the documentation in the Pixinsight/doc/scripts folder. Into that folder I copied the folder named "GeneralisedHyperbolicStretch" (as a subfolder of the Pixinsight/doc/scripts folder) which contains the GeneralisedHyperbolicStretch.html file and the subfolder called "Images" containing all the images.

This works fine on my MacBook Pro and I have not noticed any "unparsed" html tags.

What platform are you on?
 
osx mojave and 1.8.8-9 i think that's the problem, i just left the documentation inside the src/scripts/GeneralisedHyperbolicStretch/ folder that it came in. i rarely install complex scripts by hand and must have missed that in the instructions.

rob
 
I would have thought osx Mojave and 1.8.9-9 should be fine. Try moving the GeneralisedHyperbolicStretch folder to Pixinsight/doc/scripts. Let me know how you get on!
 
I'm not able to install the javascript. The javascript file is greyed out.

I tried copying the script to the ../src/scripts folder. It didn't show up anywhere in Scripts.
I put the documentation in ../doc/scripts, but when I execute the script and then try to access the document, nothing.
I then modified the script so that the "feature-id" just pointed to 'Utilities'. That didn't help.
I ran "Check script file syntax" and it is okay.

But, I can run the script manually, and it seems to work okay. Just with no access to the doc.

Core version 1.8.8-11 Ripley (x64) Build 1526 (no updates available. I might take a chance on 1.8.9)
macOS Monterey version 12.1
2020 M1 Mac Mini

Same story with a 2012 Mac Mini running macOS Catalina.

However, I can install the script in Windows 10. Working fine there.
 
I'm not able to install the javascript. The javascript file is greyed out.

I tried copying the script to the ../src/scripts folder. It didn't show up anywhere in Scripts.
I put the documentation in ../doc/scripts, but when I execute the script and then try to access the document, nothing.
I then modified the script so that the "feature-id" just pointed to 'Utilities'. That didn't help.
I ran "Check script file syntax" and it is okay.

But, I can run the script manually, and it seems to work okay. Just with no access to the doc.

Core version 1.8.8-11 Ripley (x64) Build 1526 (no updates available. I might take a chance on 1.8.9)
macOS Monterey version 12.1
2020 M1 Mac Mini

Same story with a 2012 Mac Mini running macOS Catalina.

However, I can install the script in Windows 10. Working fine there.

Hi John

A strange one!

When you say the javascript file is "greyed out", where are you looking to see it greyed out please?

Also, can I just check you have used the Scripts>Feature scripts... menu choice to install the script?

Thanks

Mike
 
Hi John

A strange one!

When you say the javascript file is "greyed out", where are you looking to see it greyed out please?

Also, can I just check you have used the Scripts>Feature scripts... menu choice to install the script?

Thanks

Mike

I am using Scripts>Feature scripts.. menu to install the script. It works for Windows, not the Mac.
In Windows, when I select to Add a new script and then navigate to the folder that contains the script, File Explorer then shows me an option to "Select Folder". I do NOT see that option using Finder on the Mac. What I see on the Mac is the option to "Open". So I select that, and then a window pops up saying it found one script, and then another window pops up saying it is searching - and NEVER finishes. The script does not get added.
 
I got it to add the script on the Mac by creating a folder "GeneralizedHyperbolicStretch" in "Parallels/src/script" with the javascript in it, and then navigating to that new folder. Selecting "Open" then successfully added the script.
 
I got it to add the script on the Mac by creating a folder "GeneralizedHyperbolicStretch" in "Parallels/src/script" with the javascript in it, and then navigating to that new folder. Selecting "Open" then successfully added the script.

Thanks for letting us know - it's good to know you have got things working.
 
An alternative to open the documentation, is to just open the HTML in your browser. The documentation provides a walkthrough on performing the "initial stretch" (i.e. from linear) with quite some detail. (some like the detail, some do not and just want to get on with it!). So here is a "quick and dirty" workflow....

For most deep sky, you just need fix three parameters using the histogram as a guide. Put the focus point (SP) between where the histogram just leaves the bottom axis, but to the left of the histogram peak, set the local stress intensity (degree of focus, b) value between 5 and 10 (you need a high degree of focus for the initial stretch, because most of the data is tight in the histogram peak - try 10!), then adjust D (the stretch amount) to put the stretched histogram peak somewhere about 1/5 to 1/4 of the way across to the right (you will have to zoom out of the histogram again) and then preview or execute!

Now, the HT process only requires you to adjust one slider (the middle one) to control the amount of stretch, while the GHS script asks you to adjust three, but this is done to "tailor, or design" the stretch for your image, yet not be too onerous to get the "knack" of. If you look at your stars in the stretched image, I would bet that they are less impacted by the stretch (more Gaussian in shape, less bloated) and dimmer nebulosity has been made visible. Do you like it?

To adjust the stretch, I suggest trying a different SP (only fine edits of approx. 0.0001 are likely needed), you will see how this transforms the histogram - you likely want the resultant to be as wide as possible, without creating two histogram peaks. Adjust b and D too, while checking the histogram and previewing the image, and then execute again. In a couple of tries you would have mastered this important initial stretch.

You may then want to adjust the black point - this is deliberately put as a separate step in the GHS - using the linear stretch selection, which will end up shifting the histogram somewhat to the left again, dimming the background.

Finally you can manipulate the stretch using smaller b and D factors to make the stretch degree less, and less focused on one part of the histogram.

Hope this helps.
 
The method is very interesting, but given the number of variables involved it's not not easy to use... a quick visual feedback on the impact of the different parameters on the output image would definitely be of great help while trying to apply it to an image. I find the "preview" window limited since you have to go back and forth each time and for fine adjustments it's not easy to evaluate the changes.
 
The method is very interesting, but given the number of variables involved it's not not easy to use... a quick visual feedback on the impact of the different parameters on the output image would definitely be of great help while trying to apply it to an image. I find the "preview" window limited since you have to go back and forth each time and for fine adjustments it's not easy to evaluate the changes.
If you are looking at fine adjustments you probably don't need the zoom/pixel readout/etc facilities provided by the preview window, so I suggest you just apply the stretch by clicking the "tick" icon on the main window. If you don't like it simply hit the undo button. You can compare before and after using "undo" and "redo". If you don't want to do this on your main image just clone it first by applying an identity stretch (Stretch Factor (D) = 0) with the create new image checkbox checked.

I hope this helps.
 
OMG... I must be 'slow' ... I've followed the directions for installing GHS... the URL is part of my repositories list, I've regenerated the list, but the script never shows up as an update and never appears in the script menu... not under utilities, render, or elsewhere that I can find. I'm on Win 10, so it should be identical w/ many users... before 1.8.9, I had it installed and did some tests, but since upgrading... no can find...
 
OMG... I must be 'slow' ... I've followed the directions for installing GHS... the URL is part of my repositories list, I've regenerated the list, but the script never shows up as an update and never appears in the script menu... not under utilities, render, or elsewhere that I can find. I'm on Win 10, so it should be identical w/ many users... before 1.8.9, I had it installed and did some tests, but since upgrading... no can find...
Let's make the easy checks first! Are you sure you have the right repository address: https://www.ghsastro.co.uk/updates/ (note .co.uk not .com!)
 
Back
Top