Big Update: Statistical Stretch v1.3 Linear to NonLinear Script - Now with functioning preview!
Vložit
- čas přidán 9. 05. 2024
- I am not a coder and this took considerable amount of work for me. I felt it important to get this to the community though. We now have a functioning preview that allows you to see what your end result will be first prior to committing!
Please share, leave comments and suggestions. I hope you all like the update!!
You can update PixInsight via Resources - Manage Repositories and add the following URL: raw.githubusercontent.com/set...
Zip files on my website for standalone downloading.
www.setiastro.com/pjsr-scripts - Věda a technologie
Version 1.3.1 Updated.
-Auto Resize the Preview is clicked by default. You can uncheck it to have the preview zoom in if you need a closer look.
-New instance icon when you drag it on an image it will now open the dialog instead of executing immediately. If you also double click the icon and click the blue square it will also open the dialog.
Repository and zip files on my site are now updated
Wow, that was a quick turnaround on introducing the preview feature! Simply outstanding, can't wait to try it out!
Outstanding work and much appreciated.
Wow! This is really nice of you to do. What a time and effort saver. I tried it on a really good M31 stack and the stretch was a little weak. Not much different than the autostretch I saw on my iPad after my 180 sec subs popped up on the screen. I am sure with a preview screen I can find the perfect settings.
I dont like stretching because Its too complicated for my simple mind to understand. Your script is an amazing tool for the community. Bless you sir!
Joe D
This is an amazing addition/update to your statistical stretch. The preview makes this fool proof and user friendly. Just brilliant!
I just tried to stretch with v1.3 for the first time; I'm blown away!!! Great job Frank.
Another Amazing Script Sir ! Thanks for all of your hard work !
Many thanks. Thank you for this excellent script.
Outstanding! I'll try the new features on my next Target.
Love your work, my go to stretching tool now.
I come back her to thank you again.I don´t know if I'd get better results with GHS but your script is SO, SO, So easy. I don't think I'm going to use anything else to stretch . Thanks again
Very well done Frank, great update !!!
This is such a great script. Thank you!
Sacré boulot encore…bravo..!.merci.
Fantastic work! Can't wait to try it tomorrow
got it to work yesterday by re-downloading Pi. Thanks for the script.
Useful update to a great script. Keep it up Frank.
Of course, I’ll show your script to the French community, nice job you’ve done.
I tried it, I love it, it has completely changed my image processing routine. Thank you so much for this.
Wow! Great to hear!
Great update. Thank you.
Great Job! Thank’s. It works perfect 👍
Every month seems to be Christmas lately - from the amazing Gradient remover last month to statistical stretch this month - just wow and thank you for doing this for us all! Rather a powerful, timesaving tool - played with it last night and was impressed! Not sure how to best use number of iterations yet - have to look at that next. Thank you Franklin!
Thats great to hear!! I am debating on just removing the iterations. That was the math nerd in me wanting an option to iterate it automatically such that the whole thing reaches convergence, in other words running it even moreafter convergence wouldnt actually change anything. Does it make a big difference in the quality of the output? Honestly probably not at all. Does it mean the median would be exactly at your target goal and the black point exactly 3 sigma below the median? Yes lol. I am just excited I was able to script enough to get this out to the community!!
Preview is a great addition.....
Perfect!! Thank you!
Thank you very, very much.
Statistical Stretch. Very Nice!
Great update!
Nice Script, Frank. I would suggest a "size to fit" button or a zoom feature for the preview window. Maybe down the line as your coding gets even better.
Omg it took two solid days to work out all the issues to get this thing to display a preview at 25% the original size so you werent stuck at a 1:1 preview. I originally did want a resizable zoom but my god this was all much harder than I anticipated. For sure on my to do list to incorporate some kind of rescaling for the preview.
@setiv2 I'm not a coder so I have no clue what it takes to implement that kind of feature. It was just an obvious suggestion that you already know would improve the usability of the script. Again, great work! I'm looking forward to implementing it on my next processing job.
Nice job!!
Great content thanks
Great additions! Quick question…does the normalization take place after curves, or before? Thanks, my friend!
After the shift in the median. Actually normalization was hardcoded in V1.0, that was that 3rd step to readjust the whitepoint. I thought in this version I would make it user optional
Super update Franklin. Such a great script. There are some great processes and scripts in PI but I find some of them just to long winded to use. This is a great example of how a simple script can get the job done without six dozen iterations. Are you developing hands on or using an iterative approach with ChatGPT?
ChatGPT is great to work through troubleshooting and easy maintenance code. Had to learn on the fly a ton. Especially since PJSR (pixinsight javascript runtime environment) is super old and missing tons of standard features. So 75% of the time you are just trying different approaches to get it to do what you want. The math behind the stretching itself to me is straight forward. A nice user interface with a preview has been..... let's just say a challenge :)
Thanks for developing this script. I have been using it extensively on my current image. The preview feature makes the process so simple now, kudos for including it. Just of note, the fit to preview drop down, is this meant to fit into the SS preview window or does it reference something else for scale?
It scales the image down to fit the width of the preview box (scale factor has to be an integer so it gets it as close as possible)
I also sent out an update today v1.3.3 that offers a couple different zoom factors for the preview as well
Interesting.
I think the reason why so many are getting green images is that when linear image is first brought onto PI screen we are used to then doing STF stretch and unlinking if RGB image without thinking, pre Colour calibration.
Oh i agree. Someone made a good point about needing an unlinked stretch for comined SHO images. I agree you would need an unlinked stretch then, although I always just stretch them seperately prior to combining.
This is a great and helpful script. Thank you very much. I have one question about version 1.5: What does the “Automatic Convergence” function do? I don't see any difference in the result if I check this box or not.
The only time it will make a difference is if the normalization shifts the median of the image away from the target, it will then run the stretch again to ensure the images median is at the target median selected by the user. So for almost all images that wont do anything as the analytic solution is very exacting and the normalization doesnt shift anything much at all. Only for those couple cases will you ever see an iteration 2 actually get performed. That is why I removed the slider. It is robust enough 1 iteration is almost always sufficient.
This is very good, well done. Best to date 1click stretch solution? It looks like.👍 I will not ditch the GHS, which I like too much, but I can see how these can work together. Thank you!
Thanks! I like GHS too, my goal with this was to use the data in the image itself to do the initial stretch, get you 90% the way there. Then you can use something like GHS to do those artistic contrast tweaks based on what you want to see in the image. GHS can be really clunky for the initial stretch as well. I think the two work perfect hand in hand. Statistical Stretch first then hop right into GHS.
@@setiv2 Exactly, I found your script does exceptional job at the initial stage especially when applied in areas of high dynamic range (I used a low setting). Then it's just a matter of using GHS to do the more selective work. I think many people will be using it in no time. 👌
Great work once again. I do have a question, for images with stars, 0-1 makes sense, but for starless images, maybe 0-0.9 would be good.. or wont it matter?
Are you referring to the normalization? Images with stars normalization wont do anything as some of the stars will already have 1.0 for a pixel value. And for bright nebula and galaxy cores you dont want to force the ceiling to 0.9 as some portions may be brighter than that after stretching
@@setiv2 Yes, normalisation 👍🏼 I usually don't stretch anything (other than stars) beyond 0.9 so as not to lose detail, as it tends to look too white after that and you can't make out the same structure. Ill just have to try it out & see what works, and either use or 'not use' the normalisation setting for a given use case. Liking the new tools you're putting out btw.
Yes. Every object is a little different. That is why making a 1 push button tool so difficult. Trying to keep the interface simple and thr math behind it powerful to get you 90% the way there so all you have to do is tweak it. Normalization was hardcoded in V1.0 and i decided to split it out. I bet you have some brighter pixels in your starless images than you realize as well, pull up the Statistics Process and see what the maximim value is.
@@setiv2 Challenge accepted 😉
I use colour ASI294MCPro camera so RGB from outset. The stretch is always previewed via PI STF, although wanted to try yours before Colour calibration. Now understand that have to do latter first before applying your Script. It would be good if you included similar STF to initially view image.
Hi, thanks for your wonderful script but what I’m not sure about is, will the image still be linear as if the image had been stretched using stretch screen analysis in Pixinsight?
Are you asking if you use the preview windiw then decide to exit out of the script without hitting execute? The image will still be linear. As soon as you hit execute it stretches the image and is now non-linear
Just tried the script and it works well, so I wanted to add it to my personal icon set. However, unlike other processes and scripts, it gives an error message and the script won't open from the saved icon's script parameters window without a "target view" value. That value, of course is the image file to apply the script to after the script opens.
The script cant be run in a global context. You can save the script, if you double click it you can change any parameters in the dialog then you drag and drop the blue triangle on the new image. If you want the full dialog open again you need to open it via the scripts -> utilities. That is a coding choice btw. If everyone wants it to be clicking the blue square or deagging the icon to a new image opens the dialog instead i can make that change. That may make more sense now that I have incorporated the preview
@@setiv2 Thanks for the quick reply. l like your idea of being able to drag the script icon to an image so that it opens the script's dialog box, giving us access to the new preview feature without having to go through scripts -> utilities. I use custom icons not only for quicker access, but to preserve notes on usage for each of my process or scripts..
Mike
@@mikei.6294 i just started a poll to see what everyone wants. Be sure to cast your vote and leave a comment!
I was unable to get the script into Pixinsight. I downloaded manually but not sure where to place the script in the pixinsight sub folders. Any help would be appreciated.
If you havent upgraded to PixInsight build 1605 (which came out in March) I highly recommend you do that as all scripts are going to require signatures going forward. You do this from the PixInsight download site. This will fix the error if you are trying to use the repository.
If you still run into a parsing error or signature error you can download the zip file directly from my website and then just extract the .js file (delete the .xsgn file). You can then go to Scripts -> Feature Scripts -> Add Script and select the folder you extracted the .js file too.
Let me know if this helps
Frank
When I run it gives green image. How do I unlink? The video appeared to cover this but did not?
No it says the stretch preserves colorbalance, you need to run spcc or color calibration first prior to stretching
Hi, your script looks amazing. Would love to try it but sadly your repository gives me just an error message in Pixinsight: "Parsing repository update information: Parsing Signature element (line=1 offset=0): Unknown code signing identity". Tried just running the script but I cant run it manualy.
If you havent upgraded to PixInsight build 1605 (which came out in March) I highly recommend you do that as all scripts are going to require signatures going forward. You do this from the PixInsight download site.
If you still run into a parsing error or signature error you can download the zip file directly from my website and then just extract the .js file. You can then go to Scripts -> Feature Scripts -> Add Script and select the folder you extracted the .js file too.
Let me know if this helps
Frank
@@setiv2 Thank you very much! I didnt know I was sill running an older version. Update fixed the problem. Cant wait to try out the script :)
can you verify the repository URL? can't get it to work. I downloaded the zip file and that worked fine. looks like an excellent alternative to GHS. can't wait to try it.
You need to upgrade to PixInsight build 1605 (that came out in March) if you want the repository to work. You get that from the PixInsight download site. Hope this helps!
Also getting the code signing error "Parsing Signature element (line=1 offset=0): Unknown code signing identity 'FranklinMarek'". I would like to add the repo rather than add the scripts manually.
You will need to update to PixInsight build 1605 (which came out in March). You do this from the PixInsight download site.
Let me know if this helps
Frank
@@setiv2 I did this week ago
Sorry I was reading version wrong. I'm at 1601. I will update.
Yeah 1605 is the latest one that is requiring all the digital signatures
Pixinsight giving a missing signature error when adding repository. Would you know a workaround for this?
You will need to update to Build 1605 (it came out in March) for the repository to work. You can get it from the PixInsight download page. Otherwise if you get the zip file from my site delete the .xsgn file in the zip folder extract the .js and go Scripts -> Feature Scripts -> Add scripts
@@setiv2 Thanks for such a quick response, and it worked well. Your Statistical Stretch script is now my stretch method of choice. Do you know what's under the hood of the regular STF stretch & as such, why Statistical Stretch works so well in comparison?
@@emuhead Yes. I actually cover what STF is doing in this video czcams.com/video/lo1SssohJgc/video.html
Ouch v1.3.3 is a big step backward. I'm unable to retrieve the same kind of stretching that I was obtaining with v1.3.2 and below. Very difficult to retrieve low level tidal streams that where evident with previous versions
Iteresting. 1.3.3 didnt change any stretching algorithm. It just defaulted the dropdown and added zoom levels for the preview. The algorithm had been the same since 1.2
You can email me and we can run some tests we older versions. They should produce the same exact stretch as the pixelmath formulas didnt change.
@@setiv2 Sure, I'll do... it's really strange
As expected, after you provide the v1.3.2 I was UNABLE to reproduce my previous results, so we can mark this as an "user error", because v1.3.3 doesn't introduces ANY regression (as I've suspected). Thanks for your help!
I'd say you're well on your way to being a "coder."
Ha! I am sure if anyone that really knows what they are doing looks at my script they will say "why did you do it like that? You did it all wrong!"