Jump to content

Banner.jpg.5ed196c1e70861ebc79109e023c96067.jpg

Pixinsight improved image stretching


Recommended Posts

7 hours ago, Gunshy said:

The way that Mike has put the whole script together with the interaction of the histogram and the previews, really makes it feel like you are in control of what happens to the image.

The whole thing feels very polished, no doubt about it.  It seems the normal PI interface is locked when the script is running (like most in PI).  With that in mind, is it possible to include a zoom and pan ability @mike1485... or have I maybe missed something already?  It's easy to ask for things like this without realising the effort involved 😅

Link to comment
Share on other sites

2 hours ago, geeklee said:

The whole thing feels very polished, no doubt about it.  It seems the normal PI interface is locked when the script is running (like most in PI).  With that in mind, is it possible to include a zoom and pan ability @mike1485... or have I maybe missed something already?  It's easy to ask for things like this without realising the effort involved 😅

Not sure if this is what you mean, but in the image inspector / preview you can zoom & pan the preview using zoom slider at bottom & thumbnail at top right? A real time preview would be nice but I can imagine how much effort that is! One thing I've noticed so far is the preview does show a bit darker than the actual result when applied.. probably just difference in display scale & I've already subconsciously adapted for that when tweaking.

Link to comment
Share on other sites

2 hours ago, Sp@ce_d said:

Not sure if this is what you mean, but in the image inspector / preview you can zoom & pan the preview using zoom slider at bottom & thumbnail at top right?

Thanks @Sp@ce_d!  I had completely missed the image inspection icon under "Image Control".  Thanks for pointing me in the right direction 👍

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

Just to say have been playing around a bit & it looks v promising indeed.  I ran ABE, then deconvolution & then MLT on an image and then cloned it.  On one I tried GHS and then two HTs, on the clone just an HT.  And the GHS version looks far better - more subtleties & nuance in nebular features, and also it looks like less graininess on the background.

This could be v promising & become a staple of my normal workflow - thank you for sharing, will continue to experiment with it!

  • Like 3
Link to comment
Share on other sites

@mike1485& @Gunshy I've just downloaded this & will give it a try over the next couple of days on my most recent image (Widefield NA & Pelican Nebulas) I'm not sure if I'll get very far to start with as I'm fairly new to PI.
I'd also like to thank you for putting this out for anyone to use, its gestures such as this that restore a little bit of my faith in humanity 🙂

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

Thanks everyone for the kind comments.

Here is a half hour video tutorial on getting started with the GHS script.   It was taken from a Zoom meeting where I was showing some fellow members of my local centre (Victoria) of RASC how to get started.  I have put the video on Youtube.  Please excuse the videography and elementary editing.

https://youtu.be/ke5B8XQBwVc

I hope this helps.
Thanks,
Dave

  • Like 4
Link to comment
Share on other sites

6 minutes ago, Gunshy said:

Thanks everyone for the kind comments.

Here is a half hour video tutorial on getting started with the GHS script.   It was taken from a Zoom meeting where I was showing some fellow members of my local centre (Victoria) of RASC how to get started.  I have put the video on Youtube.  Please excuse the videography and elementary editing.

https://youtu.be/ke5B8XQBwVc

I hope this helps.
Thanks,
Dave

The video provided is private, so no one can see it

Link to comment
Share on other sites

12 hours ago, Gunshy said:

Here is a half hour video tutorial on getting started with the GHS script. 

Thanks Dave, this was a useful addition to existing commentary. In the video you ask for the SP to be placed just to the right of the histogram peak (for the first stretch) but in an earlier thread here where you ran through the basics you said to put the SP between the start of the histogram and the peak, so to the left (of the histogram peak). Was the video a one off change for that data?

Thanks

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

Actually no, the video isn't really a one off.   For the video, I didn't know what the subject matter of the video really was until it was stretched.

However, as I am playing with the script I am learning things myself, so I would like to modify my instructions somewhat, to : Place SP somewhere within the histogram near the peak,  move the peak up and test via the preview.   Then adjust to taste, keeping SP within the histogram range that is above "0" in the linear view.  

Here are my refined guidelines, but please realize that most of the people I have seen replying and reading these posts are far more skilled and talented than I at actual imaging and image processing than I am.   I am fearful that those just starting out will take my advice as gospel, when that is not my intent.   All of these stretches are reversible (via undo, image deletion, or the "undo" button), so the best advice I can give is to play with it, see what you like best, and make that your individual style of data interpretation:

The further left you put SP for the initial stretch, the more you will bring out the background.   However, if it is too far to the left, you may bring out low level noise too much.  Then try moving it towards the right.

If you put SP on the right hand side of the peak, then the background will tend to be left more dark.  So if this is your goal, ie leave. the background dark then it may be best to be on the RHS (Right Hand Side) of the peak.

As I say the video - in general the whole curve on the LHS of the histogram of the linear image - will generally contain the background noise, the background itself, and the subjected matter.   The histogram peak might be in the background or the subject matter and which of the two depends on the image, and how much you want to stretch it depends on what you want to show.   On an STF view, check how much of the image is covered by the subject matter itself.  If the subject matter covers more than half of the total image, the peak likely represents subject matter and you should place SP on the LHS of if.   If less than half, you can move SP more to the right.     

On the video a got a bit "lucky" on the SP position.   A little less lucky, and I would have had to go back, reposition SP, and conduct another initial stretch.   Clearly the peak in the Helix nebula image represented background.

Check the image after a "test" initial stretch and matching parts of the histrogram (including where the peak is) to the image will help you design a better initial stretch SP position as well as guide your follow-up stretches.   

Cheers,

Dave

 

 

  • Like 3
  • Thanks 1
Link to comment
Share on other sites

2 hours ago, Gunshy said:

Actually no, the video isn't really a one off.   For the video, I didn't know what the subject matter of the video really was until it was stretched.

However, as I am playing with the script I am learning things myself, so I would like to modify my instructions somewhat, to : Place SP somewhere within the histogram near the peak,  move the peak up and test via the preview.   Then adjust to taste, keeping SP within the histogram range that is above "0" in the linear view.  

Here are my refined guidelines, but please realize that most of the people I have seen replying and reading these posts are far more skilled and talented than I at actual imaging and image processing than I am.   I am fearful that those just starting out will take my advice as gospel, when that is not my intent.   All of these stretches are reversible (via undo, image deletion, or the "undo" button), so the best advice I can give is to play with it, see what you like best, and make that your individual style of data interpretation:

The further left you put SP for the initial stretch, the more you will bring out the background.   However, if it is too far to the left, you may bring out low level noise too much.  Then try moving it towards the right.

If you put SP on the right hand side of the peak, then the background will tend to be left more dark.  So if this is your goal, ie leave. the background dark then it may be best to be on the RHS (Right Hand Side) of the peak.

As I say the video - in general the whole curve on the LHS of the histogram of the linear image - will generally contain the background noise, the background itself, and the subjected matter.   The histogram peak might be in the background or the subject matter and which of the two depends on the image, and how much you want to stretch it depends on what you want to show.   On an STF view, check how much of the image is covered by the subject matter itself.  If the subject matter covers more than half of the total image, the peak likely represents subject matter and you should place SP on the LHS of if.   If less than half, you can move SP more to the right.     

On the video a got a bit "lucky" on the SP position.   A little less lucky, and I would have had to go back, reposition SP, and conduct another initial stretch.   Clearly the peak in the Helix nebula image represented background.

Check the image after a "test" initial stretch and matching parts of the histrogram (including where the peak is) to the image will help you design a better initial stretch SP position as well as guide your follow-up stretches.   

Cheers,

Dave

 

 

I was wondering if it's possible to have some sort of realtime preview or is that not really possible for the script?

  • Like 2
Link to comment
Share on other sites

Thanks for this Mike,

It’s a fantastic tool. I’ve been playing around with it and I’m now getting the hang of it, the basics anyway. It’s brilliant for controlling the stars. I really like it. :) 

Edited by Scooot
  • Like 3
Link to comment
Share on other sites

1 hour ago, matt_baker said:

I was wondering if it's possible to have some sort of realtime preview or is that not really possible for the script?

Hi Matt

There is the Image Inspection dialog which gives a preview with the ability to use zoom/pixel readout/etc - but of course it's not real-time.  If all you need is a visual check of the image then I suggest applying the stretch by clicking the "tick" icon on the main window in the usual way.  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.

Mike

  • Like 1
Link to comment
Share on other sites

1 hour ago, Scooot said:

Thanks for this Mike,

It’s a fantastic tool. I’ve been playing around with it and I’m now getting the hang of it, the basics anyway. It’s brilliant for controlling the stars. I really like it. :) 

Hi Richard

Many thanks for the feedback.  I'm glad you are finding the tool helpful.

Mike

  • Like 1
Link to comment
Share on other sites

That video was v helpful - thank you.  And I have to say so far I am really liking the GHS tool!  Excellent.  Went back to some data on IC410 Tadpoles & played around with it (but w/o any HT, Curves Transformation or LHE).  And I m-u-c-h prefer what came out this way.

Workflow was 4 main steps:

1. ABE then GHS a few times (using the sliders as per the video) to generate an image to pull out range masks & star masks

2. With those masks, went back to the ABE image for Deconvolution.  And then GHS again a few times, tweaking the settings.

3.  Went back to the deconvolved ABE & did Photometric Colour Calibration (PCC wouldn't work on the GHSed image - I guess b/c its stretched?).  Then GHS a few times again.

4.  Pixel Math of the output images from 2 & 3 - the PCC image alone was noisier but had a bit more colour in darker areas which I couldn't yet figure out how to coax from GHS alone.  So just a smidgeon of Image 3 in this Pixel Math.

I definitely prefer what came out via this than the first time I played w this data using now old-for-me :)  techniques.

Since there are more clouds ahead, will try & play w old Fireworks Galaxy data too.

Thank you again for creating & sharing this tool - another great example of the astronomy community spirit!

PS - StarXterminator doesn't work on my laptop (old) so it'd be v interesting to see what would happen in other images if you separate stars from nebulosity & then play separately w GHS on each & then recombine?

IC410_7h24_APP_PI GHS_crop.png

IC410_7h24_APP_PI GHS_crop closer w tadpoles.png

IC410_7h24_APP_PI GHS_crop closer.png

Edited by vineyard
added PS
  • Like 3
Link to comment
Share on other sites

1 hour ago, vineyard said:

That video was v helpful - thank you.  And I have to say so far I am really liking the GHS tool!  Excellent.  Went back to some data on IC410 Tadpoles & played around with it (but w/o any HT, Curves Transformation or LHE).  And I m-u-c-h prefer what came out this way.

Workflow was 4 main steps:

1. ABE then GHS a few times (using the sliders as per the video) to generate an image to pull out range masks & star masks

2. With those masks, went back to the ABE image for Deconvolution.  And then GHS again a few times, tweaking the settings.

3.  Went back to the deconvolved ABE & did Photometric Colour Calibration (PCC wouldn't work on the GHSed image - I guess b/c its stretched?).  Then GHS a few times again.

4.  Pixel Math of the output images from 2 & 3 - the PCC image alone was noisier but had a bit more colour in darker areas which I couldn't yet figure out how to coax from GHS alone.  So just a smidgeon of Image 3 in this Pixel Math.

I definitely prefer what came out via this than the first time I played w this data using now old-for-me :)  techniques.

Since there are more clouds ahead, will try & play w old Fireworks Galaxy data too.

Thank you again for creating & sharing this tool - another great example of the astronomy community spirit!

PS - StarXterminator doesn't work on my laptop (old) so it'd be v interesting to see what would happen in other images if you separate stars from nebulosity & then play separately w GHS on each & then recombine?

IC410_7h24_APP_PI GHS_crop.png

IC410_7h24_APP_PI GHS_crop closer w tadpoles.png

IC410_7h24_APP_PI GHS_crop closer.png

Thanks for sharing your workflow, images and experience with the GHS script.  

To answer your question about Photometric Colour Calibration, it is designed for use only on linear images.  As you suspected, PCC should not be used on stretched images.  

I notice you say you did not use HT, CT or LHE.  You are probably already aware of this but to avoid any confusion, GHS is a great alternative to HT and CT but LHE is a rather different beast.  While GHS, HT and CT all apply a global transfer function to each pixel, LHE transforms each pixel using a transfer function derived from the histogram of the local neighbourhood of that pixel (hence the name!)  So I would suggest keeping LHE in your workflow if the image warrants it, even if using GHS for stretching.

The images look great, I look forward to seeing the Fireworks Galaxy in due course - it doesn't look like the clouds will be rolling back any time soon :( !

Mike

Edited by mike1485
  • Like 3
Link to comment
Share on other sites

Thanks @mike1485 - yes sorry clumsy typing of me - I meant that the additional nuances that come from GHS were just from that (ie without adding any LHE icing on top).  Will report back on Fireworks hopefully in next few days.

(I'm going to try & see if PCC on an unstretched image of that also introduces more graininess in GHS vs running GHS on the straight data - does PCC in essence distort the initial data histogram a bit (?)  and therefore GHS initial settings may then perhaps best be starting with different D & b - let's see, I guess that's the pt of experimentation :))

Cheers

  • Like 2
Link to comment
Share on other sites

4 hours ago, vineyard said:

Thanks @mike1485 - yes sorry clumsy typing of me - I meant that the additional nuances that come from GHS were just from that (ie without adding any LHE icing on top).  Will report back on Fireworks hopefully in next few days.

(I'm going to try & see if PCC on an unstretched image of that also introduces more graininess in GHS vs running GHS on the straight data - does PCC in essence distort the initial data histogram a bit (?)  and therefore GHS initial settings may then perhaps best be starting with different D & b - let's see, I guess that's the pt of experimentation :))

Cheers

Hi Vineyard,

One of they keys I have found, aside from D & b, is the SP point.   For the initial stretch @mike1485 and I thought about setting up a button that would "automatically" choose a D, b, and SP to use.   We abandoned this approach because it was dependent on both the image/subject and the goals of the image processor.   I find myself changing my mind on where exactly to advise placement of SP, at least for the initial stretch.   So my final answer on this, important parameter, is to try a few different ones on our image at first and see, while keeping it within the histogram you can see :  too low an SP and background noise will be apparent,  too high and only the highlights will be emphasized.   Somewhere in between will balance highlights with background according to your taste.   Of course, subject stretches of the image can be made to adjust this balance further.

As for b and D, in the documentation I say to place the histogram peak somewhere between 0.2 and 0.25 after the initial stretch.   Even this advice may not be best for the image you are processing.  For galaxies or subject matter that only occupies a minority of the total image FOV, a much lower histogram peak may be desirable.   If you have access to the histogram information, take a look at the histograms that go with the images you like on either on a sharing website, or by loading the images into your own image processing software.   That can give you a sense of where to put the histogram peak, and just as important what shape it should take.

On subsequent stretches, SP remains important but also the levels of all the the other parameters.   One thing of note is that subsequent levels of b should be much smaller than on the initial stretch (where b>8ish is recommended to protect stars).  Too high a b here may make the image to the right of SP stand apart from the image to the left of SP and also exaggerate the noise or "graininess" within the pixels that exist close to SP.    With a smaller b, the precision with which SP is place is less important than on the initial stretch.   Use SP, LP and HP here to control the overall brightening and dimming of the portions of image itself.  For example you and dim the background while brightening the highlights (or not) by manipulating these parameters.

One trick I have learned, is when going to apply HDMRT for "localized brightness and contrast (or dynamic range) manipulation" is to somewhat overbrighten the highlights, or the portions of the image that you want the HDRMT process to take effect. 

 Other than that, by trial and error you can develop your own "tricks" and if you do, please continue to share them!

Cheers,

Dave

  • Like 3
Link to comment
Share on other sites

Thanks Dave @Gunshy that's really helpful.  Yes will tinker away w different settings to see what happens (the save log functionality is also handy that way :) ). I just posted a re-do of my IC410 using GHS w star-reduction here - the prior version above that (using now-old workflow) in that thread is just embarrassingly bad in comparison. A v nice tool 👍🏾👍🏾🙏🏾

  • Like 2
Link to comment
Share on other sites

On 30/12/2021 at 10:59, vineyard said:

Thanks Dave @Gunshy that's really helpful.  Yes will tinker away w different settings to see what happens (the save log functionality is also handy that way :) ). I just posted a re-do of my IC410 using GHS w star-reduction here - the prior version above that (using now-old workflow) in that thread is just embarrassingly bad in comparison. A v nice tool 👍🏾👍🏾🙏🏾

Nice work, Vineyard, well done.   Lots of detail in the nebulosity.   

Additional star protection, if desired can be had by moving the HP slider down.   HP is also most helpful when doing subsequent GHS stretches to add/adjust contrast within an image.   LP can similarly be used to avoid darkening the background too much.

I'm very glad you find the tool useful.   Keep me posted!

Dave

  • Thanks 1
Link to comment
Share on other sites

3 hours ago, geeklee said:

My first proper go at stretching three masters - Ha, OIII and SII - using the GHS script with multiple iterations.  It controlled Eta and Mu Gem well during the stretch.

https://www.astrobin.com/swc0q9/

CKCQadILbnED_16536x0_iVNKIlg3.thumb.jpg.5b5f5aa8a52d65b5e4dfafe005b82d4e.jpg

Thanks again @mike1485 and @Gunshy for their efforts.  A useful addition to the toolbox.

That’s a fantastic image. 

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

That's spectacular!   I'm off to visit your Astrobin site now.   Thanks so much for sharing, and I'm glad you had such good success.   Any tips, tricks, or difficulties you encountered along the way to producing this would be greatly appreciated.

  • Thanks 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
 Share

×
×
  • 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.