Generalised Hyperbolic Stretching Version 2.1.0

Mike1485

Well-known member
Following the release of version 1 of the Generalised Hyperbolic Stretch script last December, I am now really pleased to make version 2 of GHS available. The key improvements from version 1 include the following:
  • Real-time preview
  • Luminance, saturation and colour stretches
  • Full masking support
  • Additional stretch types
  • Secure repository updates (much easier to install!)
  • Dedicated website (https://ghsastro.co.uk) with tutorial videos and more – available directly from within the script
If you are a Pixinsight user and haven’t yet tried GHS, I would really encourage you to give it a go – it’s free! If you are already a GHS user, thank you for your support and to many of you, thanks also for your feedback and suggestions. Many of your suggestions have helped inform the content of this release – please do keep them coming!

To install GHS into Pixinsight, add the repository information as follows:
  • If you have GHS version 1 installed then remove this first, then ...
  • From within Pixinsight go to: Resources>Updates>Manage Repositories
  • In the Manage Update Repositories dialog, click the Add button
  • In the URL box type the GHS repository information as follows: https://www.ghsastro.co.uk/updates/
  • In the Add Pixinsight Repository dialog, click the OK button
  • In the Manage Update Repositories dialog, click the OK button
When you next sign back into Pixinsight you will receive a message to say there are updates available which will include GHS. Proceed in the same way as you would for any Pixinsight update (including restarting Pixinsight) to complete the installation.

Your comments, feedback and suggestions are very welcome.

Happy stretching and clear skies!

Mike Cranfield
 
Last edited:
I'd just like to thank you both for your efforts in bringing this script to the PI community. I've installed v2 via the repository and that went flawlessly. Previously I'd had a brief look at v1 of the script, I liked the small stars it created. Looking forward to dabbling with v2.

cheers
John
 
Hello, I tested but I never managed to achieve a rise in histogram with my linear images in .fit (Image from an ASI2400MC color CMOS camera). I continue for the moment with ArcSinhStretch.
 
I've used the V1 and I am really glad that the V2 has a real time preview :cool:

I've faced an issue:

- Imported the repository
- Added and run the script successfully
- Remembered that I had still the V1 installed, so I've deleted it

After that, the GHS v2 disappeared from Pixinight's script catalog but it was still into the script folder.
Tried restart, delete the script folder, add again the repository, no change. It always says "no updates etc".

Finally I've added the script folder manually and works again.
 
I've used the V1 and I am really glad that the V2 has a real time preview :cool:

I've faced an issue:

- Imported the repository
- Added and run the script successfully
- Remembered that I had still the V1 installed, so I've deleted it

After that, the GHS v2 disappeared from Pixinight's script catalog but it was still into the script folder.
Tried restart, delete the script folder, add again the repository, no change. It always says "no updates etc".

Finally I've added the script folder manually and works again.
Hi - I'm sorry you had that inconvenience.

The Pixinsight update system records the last version it updated on your computer. When you start Pixinsight it compares this information with the version in the repository and if they are the same it assumes there is nothing to be done. It does not check that the last files it installed are still where it put them! This explains the behaviour you saw.

I am glad you have managed to get everything working now. For anyone else reading this post, it may be helpful to know (if you have installed things in the standard Pixinsight directory structure):

The file: Pixinsight/src/scripts/GeneralisedHyperbolicStretch.js is the version 1 file - this can be removed.

The folder: Pixinsight/src/scripts/GeneralisedHyperbolicStretch/ contains all the version 2 files - keep this!
The file Pixinsight/src/scripts/GeneralisedHyperbolicStretch/GeneralisedHyperbolicStretch.js - is the main version 2 file with supporting files in the /lib subdirectory.

I will edit the installation instructions to suggest people remove version 1 before installing version 2.

Thanks for taking the time to share your experience on this.
 
Last edited:
Hello, I'm trying again but impossible to mount the histogram as in the tutorial videos. I can't find why I can't. No problem with ArcSinhStretch for example.
 

Attachments

  • Sans titre 1.jpg
    Sans titre 1.jpg
    550.9 KB · Views: 396
Hello, I tested but I never managed to achieve a rise in histogram with my linear images in .fit (Image from an ASI2400MC color CMOS camera). I continue for the moment with ArcSinhStretch.

Thanks for taking time to share your experience. GHS will work fine with a .fit file. If you feel inclined to give GHS another go this is how I would suggest you proceed:

  • Select your file as the target view.
  • Move the zoom slider below the histogram display all the way over to the right.
  • You should now be able to see the peak of the histogram which was buried in the far left hand side of the graph
  • Click on the histogram graph to find an x value that is within the hump of the histogram but just left of the peak
  • Enter this x value as your Symmetry Point (SP)
  • Now set Local Stretch Intensity (b) to a value between 8 and 10.
  • Next move the zoom slider below the histogram display all the way over to the left.
  • You will now be looking at the full histogram range [0, 1]
  • Now you are all set to move Stretch Factor (ln(D+1)) gradually to the right - as you do so you will see the histogram peak start to move out from the far left of the graph.
I am confident this will give you the rise in the histogram that you were looking for.

Arcsinh stretch

You are not alone in liking the arcsinh stretch - I have liked it too, in particular the colour preservation properties that it has. I will probably be telling you what you already know but many are not aware that this colour preservation property is not a feature of the arcsinh equations, it is a result of how they are applied. In the new Version 2 GHS there is a "Col" option (short for "colour stretch") immediately below the histogram graph. If you select this rather than the RGB/K option then GHS will apply the exact same methodology as the arcsinh stretch. So if you also select the arcsinh transformation type you can end up replicating the standard Pixinsight arcsinh stretch process.

However, with GHS you are not confined to just the arcsinh equation you have access to the full generalised hyperbolic equations and the flexibility they provide. In essence you can have the best of both worlds!

Blending

One thing I have found is that the arcsinh/"Col" process can slightly overdo the colour saturation for my taste. To cope with this it can be helpful to do one stretch with the "Col" option and run this generating a new image. Then return to the original image and do the same stretch with the "RGB/K" option. Finally choose the Blend Transformation type in GHS and select the first "Col" stretch image as your blend image - you can now use the slider to blend different proportions of each image using the preview to hone in on your desired result.
 
I'd just like to thank you both for your efforts in bringing this script to the PI community. I've installed v2 via the repository and that went flawlessly. Previously I'd had a brief look at v1 of the script, I liked the small stars it created. Looking forward to dabbling with v2.

cheers
John
Thanks John - it's my pleasure - I hope you will enjoy the new functionality of V2.
 
Hello, I'm trying again but impossible to mount the histogram as in the tutorial videos. I can't find why I can't. No problem with ArcSinhStretch for example.

Hi

See my longer response - but looking at your image you supplied you will need to set the second slider (b) to somewhere between 8 and 10. Also I explain in my other response how to select a starting point for the third slider.

Good luck - let me know how you get on - thanks for giving GHS another go!
 
Thanks for taking time to share your experience. GHS will work fine with a .fit file. If you feel inclined to give GHS another go this is how I would suggest you proceed:

  • Select your file as the target view.
  • Move the zoom slider below the histogram display all the way over to the right.
  • You should now be able to see the peak of the histogram which was buried in the far left hand side of the graph
  • Click on the histogram graph to find an x value that is within the hump of the histogram but just left of the peak
  • Enter this x value as your Symmetry Point (SP)
  • Now set Local Stretch Intensity (b) to a value between 8 and 10.
  • Next move the zoom slider below the histogram display all the way over to the left.
  • You will now be looking at the full histogram range [0, 1]
  • Now you are all set to move Stretch Factor (ln(D+1)) gradually to the right - as you do so you will see the histogram peak start to move out from the far left of the graph.
I am confident this will give you the rise in the histogram that you were looking for.

Arcsinh stretch

You are not alone in liking the arcsinh stretch - I have liked it too, in particular the colour preservation properties that it has. I will probably be telling you what you already know but many are not aware that this colour preservation property is not a feature of the arcsinh equations, it is a result of how they are applied. In the new Version 2 GHS there is a "Col" option (short for "colour stretch") immediately below the histogram graph. If you select this rather than the RGB/K option then GHS will apply the exact same methodology as the arcsinh stretch. So if you also select the arcsinh transformation type you can end up replicating the standard Pixinsight arcsinh stretch process.

However, with GHS you are not confined to just the arcsinh equation you have access to the full generalised hyperbolic equations and the flexibility they provide. In essence you can have the best of both worlds!

Blending

One thing I have found is that the arcsinh/"Col" process can slightly overdo the colour saturation for my taste. To cope with this it can be helpful to do one stretch with the "Col" option and run this generating a new image. Then return to the original image and do the same stretch with the "RGB/K" option. Finally choose the Blend Transformation type in GHS and select the first "Col" stretch image as your blend image - you can now use the slider to blend different proportions of each image using the preview to hone in on your desired result.

Really good info thank you ?
While I am testing it, I can see a lot of protential to the Col and blend approach.
 
Just downloaded it. Great to see a new script with full documentation.

Thanks Geoff - I hope you will find it useful in your image processing workflow. My collaborator Dave Payne is the man responsible for the documentation and he has done a really great job on it!
 
Hi,
Thank you very much for taking the time to explain to me. Even watching your video tutorial and explanation above, I still can't get this histogram rise with your script. For convenience, please find the file link below:

https://we.tl/t-UcDP3UvP6F
 
I have spent several hours working through the documentation and the videos and am now able to produce decent looking stretches, but still have a way to go. One thing that would help immensely would be a pdf file of the documentation so that I could have it open on my iPad while working through an image with the script. I know there is a “load as pdf“ button on the documentation but I can’t get it to work.
Geoff
 
I have spent several hours working through the documentation and the videos and am now able to produce decent looking stretches, but still have a way to go. One thing that would help immensely would be a pdf file of the documentation so that I could have it open on my iPad while working through an image with the script. I know there is a “load as pdf“ button on the documentation but I can’t get it to work.
Geoff

Just copy the link in the address bar and paste it into Chrome, then right click 'print' and option save as PDF.
or you can download it here. GHS pdf
 
Back
Top