Generalised Hyperbolic Stretching Version 2.1.0

Hi Mike,

I use a lot the image inspection window and it is very good. Just wanted to suggest ( from my point of view) a little visual improvement to operation. Obviously from numbers it's easy to know where RGB values are.


Thanks a lot for yours great tool

Fabio
Thanks Fabio. I will certainly consider for a future update.
 
Hi Fabio,

Just further to your image interrogator question, I thought I would post a bit of a "recipe" on setting the initial stretch parameters based on its use... Just in case this helps any users. I think using the image interrogator is a critical piece of using GHS, and while you can use it without it, I believe enquiring pixel values is a great help. It is definitely in Mike's plans to improve the script to make it easier, but here is the "recipe" in case anyone is interested....

1) Once you have loading your linear image into the script, zoom in on the histogram and choose an SP to the left of the histogram peak, but within the area that is visibly, on a linear histogram basis, above the 0 line - precise placement isn't super critical at this stage.

2) Set b to a high level 10-15 (I usually use 15 now), leave LP and HP at 0 and 1, and then zooming out of the histogram view) slide D to place the histogram peak at or above about 1/4 away across, watching the image preview to make sure you can see all of the background and subject matter comfortably. For most images (unless the entire image is subject matter that you want to show), the contrast will likely be fairly low. (This is because we likely picked this initial SP so low, that we put a lot of contrast to the left of the histogram).

3) Pull up the Image Interrogator and show the preview mode. What we want to do here is show the preview mode so we can see our way around, but what we are actually interested in the "before" value of pixels as shown in the upper left window. What we are interest here is the before values for the dimmest parts of the subject matter (the dimmest parts of what you want to show against the background). Click on a couple of spots in the image and mentally average the R,G,B values (if in colour) and average the before value of the various spots (or the minimum) .

4) Exit the Image Interrogator and enter that estimate for into the text box for SP. (Now I know this involves typing a number, and Mike and I are looking at ways to avoid/streamline this). This value of SP should be to the right (higher value) that you used to create the preview. If this is not the case, use a lower SP for your image interrogation/enquiry. For images, that for most of the area, contain just background you may end up with an SP value well to the right of the histogram peak. For images that are entirely covered with subject matter, it will likely remain to the left of the histogram peak, but somewhat to the right of your initial SP pick.

5) Once you enter the number and hit <return>, you will see the image and histogram change - likely the histogram peak will shift back to the left. What we have done to the image is place that maximum contrast right where the subject matter emerges from the background. If not, you may want to go back a couple of steps and adjust SP, but in most cases this is a pretty sure fire way to get a good value for the initial stretch SP. Take a look at the histogram/image and unless you are very lucky you will have to make some adjustment to b and D, now that we have established SP.

6A) On the extremes you will have as SP well to the right of the linear image histogram peak (see 6B or 6C) if this is not the case. In these cases you may have actually "bifurcated" or split into two the histogram and the image and thrown the histogram peak quite far to the left (the image will likely look awful). The only tricky part here, is that you will find reducing either b or D, or both will start to shift the histogram peak of the resultant image back to the right and reduce the "bifurcation effect", caused by actually placing too much contrast here. In most cases, you will want to remove any bifurcation of the histogram or the image preview by lowering D,b, and both - that way the image should smoothly transition from background to subject matter. You can differentiate between D and b to place the histogram peak where you want it as well. Since this likely represents background that you don't want to highlight in this case it will likely end up less than 1/5th the way across, but don't be overly concerned where the histogram peak is place. A more important goal of this adjustment is described in 6C.

6B) In this extreme, it is likely that your SP chosen is still to the left of the linear histogram peak. Your histogram may look fine, and your image may be ok, or even a little dark. If you haven't used the maximum 15 for your b value, you may consider increasing this. Otherwise you can increase or decrease D to see the dim features in the background that you are after. In most cases, this will involve placing the histogram peak at or to the right of 1/5th the way across, but for now don't be overly concerned where precisely the histogram peak is placed - see 6C and 7.

6C) In either case of 6A or 6B, I have found that my favourite view of images have a LOG histogram view (unzoomed) that, going right from the LHS of the log histogram view rises to a peak, then comes down and quickly transitions from its peak to a MONOTONIC (constant log slope) all the way to the RHS of the log histogram view. This results the "best" distribution of contrast for many images., understanding that you may have a good reason to deter from this, but in most cases, something like this will be your ultimate goal. Your adjustments of b and D should attempt to achieve this - ie trying to establish as best as you can, this monotonic log-histogram decline to the right of the histogram peak.

7) Once you feel you have done the best job you can, you may find you have lowered b even as low as 3 or 4 in this initial stretch. You should always check the RHS to see if the brightest stars are starting to accumulate. If so, you might want to add a dash of HP by lowering it from 1. You may also find that this helps (or hurts) in achieving the "monotonic decline" log histogram shape you are after. It can definitely also be used (decreases) to darken the image somewhat, but this is likely better reserves for a follow-up stretch. The opposite, in terms of lightening the image can be achieved by increasing LP from 0, but you will not be allowed to increase it above SP which will still be at a very low value as it refers to the linear image. Whether reducing HP or increasing LP - the goal is to aheive, as best as you can a good distribution of contrast. When you are there, the image should look pretty good as well, so don't forget to check the preview. When satisfied, execute the initial stretch.

Remaining stretches should involve adressing any remaining bulges in the log histogram profile. These bulges likely correspond to parts of the image that seem "flat" and need contrast to show detail. By looking at the bulges and using the image interrogator to find these "flat spots" in the image, place SP where you want contrast added in the image, and bulges in the histogram profile pushed down. In general use a higher b for sharp bulges, and a lower b for broad based ones, then D to achieve the result. At the same time you can use HP, LP to control the image brightening - keeping an eye as to where the transform sits relative to the "identity" line, and using HP to control both adjust "darkening" and the stars on the far right of the of the histogram.

The recipe isn't foolproof, and is of course, subject to take and the utility of the result, but here it is in case it helps.

Dave
 
Thanks a lot Dave and Mike for your effort to make our pixinsight life's easier and better.

Your tool is great!

I read at begin all excellent documentation and follow all video tutorial (yours an Paulyman astro too) and I recommend everyone to do the same.

This recipe add some new skill to my workflow, all in general, but mainly in the steps 3-4 (we can call it "find the best SP value"?)
Before, I use the Image Interrogator empirically to evaluate the sky background values, the DSO values and stars values to be sure to not dim or saturate a lot the stars, but not to find "systematically" the best place over to put SP.

Thanks again

Fabio
 
Hi Mike,

I use a lot the image inspection window and it is very good. Just wanted to suggest ( from my point of view) a little visual improvement to operation. Obviously from numbers it's easy to know where RGB values are.


Thanks a lot for yours great tool

Fabio
Hi Fabio
I have just released GHS v2.2.0 which hopefully gets close to what you were after here.
 
I was just getting into GHS (log Y axis, adjustable inflexion point, etc. - all excellent and reproducible) when I updated to PI 1.8.9-0. Not the new one, which appears to have a few bugs. But now I can't locate GHS.

GHS is still in the repositories list. Checked for updates; all good. Re-opened PI. No dice. It's not on the Scripts->Utilities menu as before, and can't locate it elsewhere.

Any suggestions?

I have new data and could not wait to try GHS from linear.
Cheers, Chris.
 
Hi Chris. How frustrating! Did you update to the new PixInsight version then move back to v1.8.9-0? I have noticed this can cause the issue you describe. What operating system are you on?
 
No, I did a “check for updates” and updated from 1.8.9 to 1.8.9-0.
After that GHS disappeared.

I can’t see a way to “uninstall” a script and start again. I tried moving the src and doc folders for GHS, but PI still “knew” it had them installed even when they were removed. Can’t find how it stores that info.

Cheers, Chris.
 
Hi Chris. Sorry, in my previous post I confused the issue by referring to a non-existant version of Pixinsight. In the 1.8.9 series there is only 1.8.9 and 1.8.9-1. As you say you are not on "the new one", I guess you are on 1.8.9.

From what you say, you don't yet feel ready to move to 1.8.9-1. I would say, I have been using it and it is working fine for me. There were one or two teething problems but the PI team have worked hard over the last few weeks and I think things are looking good now. So my first suggestion would be to do the 1.8.9-1 upgrade and that should then pick up GHS as part of the updates and all will be well, hopefully!

If you still don't feel comfortable upgrading to 1.8.9-1 then one approach is to find the file called updates.xri in your Pixinsight installation folder/directory. This file tells Pixinsight what updates have been installed in your current PI installation. If you delete this file then restart PixInsight it will download all updates from your repositories list including PI official updates and any third party scripts like GHS you use. This approach is a bit of a sledgehammer but should crack the nut!
 
One quick question Mike. When I drop the triangle instance onto the workspace, it creates an instance icon OK. But when I double click on it, I seem to get a fixed transform instance, with no controls. This behaviour seems quite different to the norm, where an instance can continue where one left off, and continue adjusting controls with Preview, etc.

Or am I missing something?
 
One quick question Mike. When I drop the triangle instance onto the workspace, it creates an instance icon OK. But when I double click on it, I seem to get a fixed transform instance, with no controls. This behaviour seems quite different to the norm, where an instance can continue where one left off, and continue adjusting controls with Preview, etc.

Or am I missing something?
Hi Chris
You are not missing anything - what you are seeing is normal behaviour for scripts. It is only process instances that will open up their own interface as you describe.
 
Hi,

Have found this extremely useful after a LOT of coffee inbound... I have 4 images up on Astrobin and some discussion. I find this works very well especially if you use StarXterminator and NoiseXterminator on the linear images first... why stretch the noise and stars if that can be avoided....

Post at Astrobin on GHS with Images
 
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
HI,
Sorry I must have missed this post earlier. The download has expired, and I need some more information about what you mean by "can't get this histogram rise with your script.

Embedded within the TAIC video is a presentation that provides a summary of understand how GHS works and overview on how to use it. A PDF of the slides is available here. I hope this helps.

Dave
 
I want to chime in and say what a game-changer GHS has been for me! My HistogramTransformation stretches and some others I've tried didn't always work for some of my more challenging datasets, but now I'm going back through and re-trying the datasets I abandoned because GHS has been working sooooo much better. It is truly fantastic, thank you!
And thanks for coming on The Astro Imaging Channel to present it. I've made a clip of the process of applying GHS as part of the new "TAIC Shorts" series I've been working on for TAIC.
 
I want to chime in and say what a game-changer GHS has been for me! My HistogramTransformation stretches and some others I've tried didn't always work for some of my more challenging datasets, but now I'm going back through and re-trying the datasets I abandoned because GHS has been working sooooo much better. It is truly fantastic, thank you!
And thanks for coming on The Astro Imaging Channel to present it. I've made a clip of the process of applying GHS as part of the new "TAIC Shorts" series I've been working on for TAIC.

Thanks for the feedback, Molly - it's great to hear you are having success with GHS. The new TAIC Shorts series is a great addition to the channel - thanks for making one for our GHS presentation.
 
Back
Top