Pixinsight image stretching – GHS Version 2 Pleiades Astrophoto PixInsight · Mike Cranfield · ... · 373 · 34706 · 288

Mau_Bard 1.20
...
· 
·  1 like
Thank you all for this conversation here, it is very interesting.
After being using GHS for a while, I went back and viewed again today the three tutorials prepared by David Payne on the GHS site, and this second time I was appreciating a lot more detail that I missed when I watched them the first time, when I had no practical experience of the script. The tutorials are really well done and deserve to be studied carefully to get the maximum from the script.

@David Payne For the sake of curiosity, have you published the equations behind GHS? Many thanks!
Edited ...
Like
Gunshy61 10.10
...
· 
Paul MacAree:
Thanks Mike, 

I've found the processes of learning about the tool a real eye-opener in terms of understanding histograms and the point of the various transformation possibilities. Many thanks for this, you have contributed to the discipline/art of astrophotography.

Nice job, Paul

Thanks Paul, Wolfgang and Jeryyyy.   Mike is the good looking one who does most of the actual work. 
Dave
Like
Gunshy61 10.10
...
· 
·  1 like
Thank you all for this conversation here, it is very interesting.
After being using GHS for a while, I went back and viewed again today the three tutorials prepared by David Payne on the GHS site, and this second time I was appreciating a lot more detail that I missed when I watched them the first time, when I had no practical experience of the script. The tutorials are really well done and deserve to be studied carefully to get the maximum from the script.

@David Payne For the sake of curiosity, have you published the equations behind GHS? Many thanks!

Hi Mau Bard,

The best place to look is to edit the script, where Mike has coded them in - including the GHS, HT, and arsinh equations, and the inverse functions as well.  They are also in the documentation.

The base equations originated in decline curve (time series) forecasting and the best summary I have is here.  The equation are great, not only for Note that at HP, is uses the derivative or slope of the equation and holds it constant (linear) to the right, while LP uses the derivative and holds it constant to the left.   SP defines the point where the equation flips  around the natural origin of the equations.

The equations are first evaluated at x=0,1,LP,SP,and HP and the appropriate form used within each segment  to match values.  Then the whole curve is normalized from y=0 to y=1 to create the final transform.

Hope this helps.
Dave
Like
refoster61 1.20
...
· 
·  1 like
This is a fantastic script, and the ability to preview now makes it that much more useful. Thanks so much for this powerful tool! I am comfortable with Masked Stretch and ArcSign Stretch (plus the default HS) but this is an intuitive tool with graphic feedback to give me a much better idea of what is happening.  I am new to PI November 2021, but so glad to see this kind of add on script available.  Will keep using it and give more feedback later.
Best,
Rob
Like
jerryyyyy 9.03
...
· 
·  1 like
Well, I have been working away on more images using the script, now it is just routine.  I get what you say about exploring the data, probably before you hit it with heavy noise reduction.  In any case, here are three different use cases that are slightly different.

The Draco Dwarf Galaxy was very difficult to visualize in my light polluted sky and I think the script helped me get the dim stars out:


UGC 10822 (The Draco Dwarf)


Sh2 82 hard to get the nebulosity out next to the main object... SP set in the nebulosity:


Sh2 82 Little Cocoon or Locket Nebula


NGC 40 SP set inside the nebula:


NGC 40 BowTie Nebula


Anyway, will need to get some more experience and look at some dim materials... I am working on the right amount of stretch for M5 (A globular cluster) and hard to separate the stars.... have used various techniques, but I think there is hope here, maybe with several iterations.
Like
jerryyyyy 9.03
...
· 
·  1 like
Rob Foster:
This is a fantastic script, and the ability to preview now makes it that much more useful. Thanks so much for this powerful tool! I am comfortable with Masked Stretch and ArcSign Stretch (plus the default HS) but this is an intuitive tool with graphic feedback to give me a much better idea of what is happening.  I am new to PI November 2021, but so glad to see this kind of add on script available.  Will keep using it and give more feedback later.
Best,
Rob

Yeah, I have been using PI for 10 years and I still do not know how to stretch, especially trying to get the right star colors.  Frankly, I am cloning my RGB images and stretching a couple different ways to see what looks best.  There are a lot of factors that make it hard to predict what will happen starting with the quality of the initial images.... their depth of color and the photometric correction in PI seems to desaturate... maybe correct but it looks dull... 

This script seems to have most options included.  Worst problem I have is blowing out the centers, so have to move gingerly.  Then whne you add luminiosity, you will have wanted as deep colors as possible... complex stuff... long way from becoming expert at this.

PS  If you are just starting out, I suggest keep a small note book... so you can reproduce something that did work... like a lab notebook...
Like
jerryyyyy 9.03
...
· 
·  1 like
Rob Foster:
This is a fantastic script, and the ability to preview now makes it that much more useful. Thanks so much for this powerful tool! I am comfortable with Masked Stretch and ArcSign Stretch (plus the default HS) but this is an intuitive tool with graphic feedback to give me a much better idea of what is happening.  I am new to PI November 2021, but so glad to see this kind of add on script available.  Will keep using it and give more feedback later.
Best,
Rob

Yeah, I have been using PI for 10 years and I still do not know how to stretch, especially trying to get the right star colors.  Frankly, I am cloning my RGB images and stretching a couple different ways to see what looks best.  There are a lot of factors that make it hard to predict what will happen starting with the quality of the initial images.... their depth of color and the photometric correction in PI seems to desaturate... maybe correct but it looks dull... 

This script seems to have most options included.  Worst problem I have is blowing out the centers, so have to move gingerly.  Then whne you add luminiosity, you will have wanted as deep colors as possible... complex stuff... long way from becoming expert at this.

PS  If you are just starting out, I suggest keep a small note book... so you can reproduce something that did work... like a lab notebook...
Like
Gunshy61 10.10
...
· 
Hi Jerry,
Thanks for your series of posts.  You sure are going for difficult targets!  Judging from your images, I don't feel I am qualified to suggest how you should stretch your images. 

All I can say is that ultimately, all the stretching techniques available boil down to a mapping transform.  Going after dim nebulosity or IFN is quite delicate and my own technique (which  is always being refined) is to understand that the brightness of nebulosity you want to show must be increased relative to the background, so contrast must be placed between them.  That contrast has to come from somewhere too, which may be important.   I also use the identity line on the histogram so see what/where will actually be brightned and what will be dimmed.

As for the GHS script, it is always a trade off between degrees of freedom to control it versus the complexity to use it.   Most other transforms didn't allow for the degrees of freedom we wanted, so we tried to come up with a meaningful set of parameters.    We were also mindful that degrees of freedom and control of the stretch also come from conducting multiple stretches.       Perhaps AI is the answer, but then how would you let the AI know how you want to interpret the data?

I'm glad you are enjoying it though.
Thanks,
Dave
Like
Gunshy61 10.10
...
· 
THanks Rob, for your encouraging words also.
Dave
Like
jerryyyyy 9.03
...
· 
·  2 likes
David Payne:
Hi Jerry,
Thanks for your series of posts.  You sure are going for difficult targets!  Judging from your images, I don't feel I am qualified to suggest how you should stretch your images. 

All I can say is that ultimately, all the stretching techniques available boil down to a mapping transform.  Going after dim nebulosity or IFN is quite delicate and my own technique (which  is always being refined) is to understand that the brightness of nebulosity you want to show must be increased relative to the background, so contrast must be placed between them.  That contrast has to come from somewhere too, which may be important.   I also use the identity line on the histogram so see what/where will actually be brightned and what will be dimmed.

As for the GHS script, it is always a trade off between degrees of freedom to control it versus the complexity to use it.   Most other transforms didn't allow for the degrees of freedom we wanted, so we tried to come up with a meaningful set of parameters.    We were also mindful that degrees of freedom and control of the stretch also come from conducting multiple stretches.       Perhaps AI is the answer, but then how would you let the AI know how you want to interpret the data?

I'm glad you are enjoying it though.

Thanks,

Thanks, is the "Identity" line the one that shows up when you set the SP in the histogram.
Like
Gunshy61 10.10
...
· 
·  1 like
The identity line is the "45 degree" line that run from 0,0 to 1,1, and is overlain by the red "curve" when D, the amount of stretch, is set to 0.   It is called the identity line or transform because it returns the same image as  the target.  When using a stretch, GHS will dim where the transfrom is below the identity line, and brighten where the transform is above it.   The distance away from the identity line is the amount of dimming or brightening will occur for that input pixel value.

Cheers,
Dave
Like
jerryyyyy 9.03
...
· 
·  1 like
Regrading setting the dark point, here is an image where I spent a lot of time assessing where to put the symmetry point exploring the dark areas of the three NB channels.  If you look at the three revisions, I blew the dark point initially but fixed it in the final revision.  Detail comes out well, I think. 


Sh2 108 (Gamma Cygni Nebula)
Like
jerryyyyy 9.03
...
· 
·  1 like
One more efforts here... the last data I got before the fog rolled in...  this time using the "Col" or Color stretch. 

I applied it partially but twice and that seems to have prevented blowing out the color in the star cores.  Was denoised with NoiseXterminator before and after stretch.  I seemed to get some milage by using a false L from all the registered RGB files.

I also used a couple small applications of LHE. 


M5


This was the first non"Col" version. 


M 5 Using Generalized Hyperbolic Stretch
Edited ...
Like
umasscrew39 12.64
...
· 
·  1 like
David and Mike

I just started trying GHS and was curious to compare it to 2 other stretching approaches.  I had M13 as an easy target and I must say GHS is very impressive, despite me still learning how to use it to its full capability.  



Thanks so much for your contribution to this wonderful hobby. 

Bruce
Edited ...
Like
jerryyyyy 9.03
...
· 
·  2 likes
Hi Bruce,

I made some detailed comments on your image.  These GCs are really great test platforms for the use of GHS. 

See what I said about use of the "Col" stretching option and multiple applications and black point.....

Cheers,

JY
Like
jerryyyyy 9.03
...
· 
Well, in redoing my Sh2 images I shot Sh2 94 last night, which is notoriously dim. 

Well it came out, but I got squat if I did the noise reduction before the GHS.  You are right you can throw out the signal that way.

I then did the stretch without noise reduction setting SP at the center of the histogram.  Got a bimodal distro:

image.png

It is very noisy but the filaments come out. The image on the bottom is the original and the red top one is processed with noise reduction later.

I will do more, looks like I can do O-iii, but as you said you have to be careful you do not clobber the signal with the noise reduction. 

This is with 20h of CCD:

Sh2 94 H-alpha O-III RGB



image.png
Like
Gunshy61 10.10
...
· 
·  1 like
Awesome Jerry,

Whenever I bifurcate the image, I check the image preview to see how it looks.  Sometimes, if it is too severe I will back off D and/or b somewhat - but if it looks Ok then fine.
I also often test my selection of SP to see if it is bringing out more or less dark signal.  If I want the dim stuff I go for it, even if it make the brighter suff not so good looking.  I can alway repair the brighter stuff is subsequent stretches...

Again, very nice images.

Dave
Like
jerryyyyy 9.03
...
· 
·  1 like
David Payne:
Awesome Jerry,

Whenever I bifurcate the image, I check the image preview to see how it looks.  Sometimes, if it is too severe I will back off D and/or b somewhat - but if it looks Ok then fine.
I also often test my selection of SP to see if it is bringing out more or less dark signal.  If I want the dim stuff I go for it, even if it make the brighter suff not so good looking.  I can alway repair the brighter stuff is subsequent stretches...

Again, very nice images.

Dave

Have looked at this area a lot and not many are seeing this dim stuff so I think I will continue to go for it.  This is only 1h, so I can improve it.  I was always taught to take the noise out early, in the linear, before you stretch the noise and make it worse, but here it looks like the signal is so close to the noise you have to be careful.  You also pick up all the artifacts you do not see from the destarring.  Maybe I should try it with the stars still in.... here it is... took the stars out and denoised... still some artifacts...
image.png
Edited ...
Like
mike1485 23.42
...
· 
·  3 likes
David Payne:
Awesome Jerry,

Whenever I bifurcate the image, I check the image preview to see how it looks.  Sometimes, if it is too severe I will back off D and/or b somewhat - but if it looks Ok then fine.
I also often test my selection of SP to see if it is bringing out more or less dark signal.  If I want the dim stuff I go for it, even if it make the brighter suff not so good looking.  I can alway repair the brighter stuff is subsequent stretches...

Again, very nice images.

Dave

Have looked at this area a lot and not many are seeing this dim stuff so I think I will continue to go for it.  This is only 1h, so I can improve it.  I was always taught to take the noise out early, in the linear, before you stretch the noise and make it worse, but here it looks like the signal is so close to the noise you have to be careful.  You also pick up all the artifacts you do not see from the destarring.  Maybe I should try it with the stars still in.... here it is... took the stars out and denoised... still some artifacts...
image.png

Hi Jerry 

This image is coming on nicely.  I think the sad truth is, if your signal is close to your noise the only way forward is more time on the target.  Stretching will necessarily enhance both the signal and the noise and any "de-noising" approach will need to make some assumption about what is noise and what is signal which inevitably risks either creating stuff that isn't really there or destroying stuff that is.  I look forward to seeing how this image develops with more time!

CS
Mike
Like
jerryyyyy 9.03
...
· 
·  2 likes
Mike Cranfield:
Hi Jerry

This image is coming on nicely. I think the sad truth is, if your signal is close to your noise the only way forward is more time on the target. Stretching will necessarily enhance both the signal and the noise and any "de-noising" approach will need to make some assumption about what is noise and what is signal which inevitably risks either creating stuff that isn't really there or destroying stuff that is. I look forward to seeing how this image develops with more time!

CS
Mike


Indeed, I am trying to substitute the image processing for the "Clear Skies", which are at a premium here... could not get an image for 3 days.  This is one hour, so I just need a couple more, should be easy but not near "Fog City".
Like
jerryyyyy 9.03
...
· 
·  3 likes
Here is the final version with double the Ha subs and the O-III added.  I'll write up what I did on Astrobin.  Link is below.

image.png




Sh2 94 GHS Stretching
Edited ...
Like
jerryyyyy 9.03
...
· 
·  1 like
Well, I am still a bit out of control here and did Barnard's 147 using GHS.  There is no question to me at least you can bring out the faint areas.  This final version is backed off as it was "too bright"....



Barnard 147
Like
TonyWaters 1.43
...
· 
·  3 likes
Mike Cranfield:
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!


I started using the GHS script a couple of months ago and became an addict! The ability to preserve light and/or dark areas in a series of stretches leads to such an improvement in detail over simple stretching that I had to reprocess all my images, incorporating GHS in the workflow....

At least it gave me something to do in the absence of astronomical darkness in Scotland!
Like
mike1485 23.42
...
· 
·  1 like
Tony Waters:
Mike Cranfield:
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!


I started using the GHS script a couple of months ago and became an addict! The ability to preserve light and/or dark areas in a series of stretches leads to such an improvement in detail over simple stretching that I had to reprocess all my images, incorporating GHS in the workflow....

At least it gave me something to do in the absence of astronomical darkness in Scotland!

Thanks for the feedback Tony - I’m glad you have found GHS useful but sorry to have caused you so much work ;)
Like
TonyWaters 1.43
...
· 
·  3 likes
Mike Cranfield:
Thanks for the feedback Tony - I’m glad you have found GHS useful but sorry to have caused you so much work ;)


I forgive you for all the work you caused me! I've posted three of my images on Astrobin so far - all using the GHS workflow. More to follow!
Like
 
Register or login to create to post a reply.