Jump to content

Summer Triangle Challenge

GeneralisedHyperbolicStretch v2.2.0 - improved image stretching for PixInsight users

Recommended Posts

I am pleased to announce the release of Generalised Hyperbolic Stretch (GHS) V2.2.0.

GHS is a Pixinsight script that provides an integrated environment to facilitate the design, appraisal and application of stretches to your images.  The script helps avoid star-bloat and allows highly targeted addition of contrast throughout your images.

The principal new feature in this version is the addition of a comprehensive pixel enquiry facility on the preview image.  By clicking anywhere on the preview, you will see a readout for pixel values in the area you have clicked.  This can be used directly to set relevant parameter values for your stretch.  In this way you can design your stretches in a far more intuitive and precise way to achieve the exact results you want.

More detail on the new features is available on the GHS website (https://www.ghsastro.co.uk/v2-2-0-notes/) and via the tooltips from within the script.  A tutorial video is also in the process of production and will be available shortly.

If you have the GHS repository (https://www.ghsastro.co.uk/updates/) set up in your list of managed repositories, then you will pick up the new version next time you start up Pixinsight.  If you prefer to install manually, the files are available at the GHS Github repository (https://github.com/mikec1485/GHS/releases/tag/v2.2.0/).

As ever, feedback is always welcome.

Also, David Payne and I have been invited on to The Astro Imaging Channel on YouTube for a live show presenting GHS on 29 May 2022.  Building on a brief explanation of the fundamentals of image stretching, we will be exposing the “secret weapons” of GHS and demonstrating how these have been implemented in the new GHS V2.2.0 to allow creation of “designer stretches”.  The live show starts at 9:30pm EDT, or if that time doesn’t suit, it will be available afterwards for view at the TAIC YouTube channel (https://www.youtube.com/c/TheAstroImagingChannel/).

Happy stretching and clear skies.

Mike Cranfield


  • Like 4
Link to comment
Share on other sites

  • 2 weeks later...

Looks really good in the videos but although my images stretch really well using the Screen Transfer  and Histogram functions in PI every time I've tried GHS 2.2.0 it just blows them out to white as I use the stretch slider. Very puzzling.


Link to comment
Share on other sites

Hi Mark

Thanks for giving GHS a go and posting this  question, I'm sure you are not alone in this sort of question so let me have a go at some pointers - watching the videos should give some more and better help.

Are you only moving the D slider?  If so this will give the blow out you describe.  For your first stretch you will likely need to set the second "b" slider to something large - eg 8 - 10.  You should also set the SP slider to where the pixel values move from background to subject (usually somewhere just left or right of the histogram peak depending upon the subject) - check out the videos for how to use the preview readout to determine this value.  Your first stretch will protect the stars well but will likely leave a low contrast image.  

Your second stretch needs to set SP at a value where you want to add contrast (eg interesting part of the nebulosity or spiral arms of the galaxy etc) then set a mid value for b (3-5 may work).  Then use the D slider to apply the stretch.  This should start making the image look good but you can carry on adding contrast/tweaking at will.  Check out the videos for more help on this.  I hope you can get this working OK for you - blown out centres is absolutely not a feature of GHS when used in this way!

My collaborator, Dave Payne, and I did a video for TAIC last weekend which you can access here.  There is a practical run through of using the GHS script to stretch an image of M51 which starts at 53 minutes in, that might help illustrate the above.

Let us know how you get on.



Edited by mike1485
  • Like 2
  • Thanks 1
Link to comment
Share on other sites

  • 2 weeks later...

Hi Mike and Dave,

Thanks for your great work on GHS! I've been working with your scripts on and off over a couple of months, and am very impressed with the concepts, and since v2.2.0 especially, the implementation and UI. I watched your TAIC presentation and am keen to continue building my knowledge and experience of the use of the script. Is there an obvious place where 'beginners' can ask embarrassingly simple/stupid questions please? I thought you might have a GHS forum over on GHSAstro.co.uk but I see you refer there to the PI and SGL forums.

In the couple of years since I began my astrophotography journey using various software, it was your TAIC lecture which first drew my attention in detail to what stretching an image does to the data. Your explanation of how we can control and develop the contrast in an image, whilst protecting against crushing bright areas or clipping image data at the dark end of the histogram, caused a real 'eureka' moment for me! You've set me reworking a number of my images, albeit slowly and step by step.....

My first 'dumb' question is about the dark end of the histogram. When I look in detail at one of my typical image stacks, there is a flat line for a good distance along the horizontal axis where there are, apparently, no image pixels. I presume that this is due to the offset I have set in my capture program. I use ZWO ASI533MC and ASI2600MC cameras at the recommended offset value of 50. So should it not be possible to detach the hyperbolic curve from the graph origin and shift the attachment point axis along to the right to the point just before the first image samples? in this way you would not be wasting useful output image values for image brightnesses where there are no pixel samples...    

Thanks in anticipation for putting me straight on this or for pointing me in the right direction....


PS Also posted on the PI forum

Edited by Avocette
  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. By using this site, you agree to our Terms of Use.