Statistical Stretch Script: My new script to dynamically calculate & perform astro image stretching

Sdílet
Vložit
  • čas přidán 5. 05. 2024
  • Where you can find my scripts: www.setiastro.com/pjsr-scripts
    Repository URL for pixinsight: raw.githubusercontent.com/set...
    My newest script will dynamically determine how to stretch your astro image based on the images statistics. That way it will hold the background to a user specified level, increase the brightness of the true signal and prevent the image from being over stretched. A very common thing seen if anyone has ran STF on a starless noiseless image!
    If you have questions or comments please leave below! They are all really appreciated!
  • Věda a technologie

Komentáře • 132

  • @setiv2
    @setiv2  Před 2 měsíci +4

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

    • @TevisC
      @TevisC Před 2 měsíci

      It still has an error
      run --execute-mode=auto "C:/Program Files/PixInsight/src/scripts/StatStretchV1prod/statisticalstretch.js"
      Processing script file: C:/Program Files/PixInsight/src/scripts/StatStretchV1prod/statisticalstretch.js
      *** Error: Signature verification failed for 'StatisticalStretch': Unknown code signing identity 'FranklinMarek': C:/Program Files/PixInsight/src/scripts/StatStretchV1prod/statisticalstretch.js

    • @setiv2
      @setiv2  Před 2 měsíci +1

      @@TevisC please remove the .xsgn file. Seems your pixinsight authorship library wasnt updated recently.

    • @terrybertrand7159
      @terrybertrand7159 Před 2 měsíci

      I'm running the latest version of PI 1.8.9-2, and It still won't load for me even after removing the .xsgn file.

    • @setiv2
      @setiv2  Před 2 měsíci

      Can you send what error you are getting? You can also email me which is a big help since we can send screenshots too

    • @terrybertrand7159
      @terrybertrand7159 Před 2 měsíci

      @@setiv2 Disregard my above post, for whatever reason it loaded and is working now - thank you.

  • @johnhawkes7681
    @johnhawkes7681 Před 2 měsíci +12

    Been using PI for more than 10 years and used about a dozen quick stretch methods of all shapes and sizes and then this simple to use script comes along and does a better job out the box than the lot! Super work, looking forward to your next innovation! Many thanks.

    • @setiv2
      @setiv2  Před 2 měsíci +2

      That is great to hear! I appreciate it!

  • @LogansAstro
    @LogansAstro Před měsícem +2

    Looking forward to trying to this out asap.

  • @JeffHorne
    @JeffHorne Před 2 měsíci +3

    Very nice. And the “under the hood” description, I think, is the best way to learn how to really use a script. So awesome. I’d love to see this kind of walkthrough for other commonly used scripts/processes.

  • @terrybertrand7159
    @terrybertrand7159 Před 2 měsíci +2

    I finally got a chance to play with this script on a recent M101 image that I took. This is a great script, I really like it a lot! Thanks for your effort.

  • @kekkoukedarake110
    @kekkoukedarake110 Před 2 měsíci +4

    My first trial worked great! Thank you for your hard work and contribution. I will enjoy this script a lot.

  • @stevewest7839
    @stevewest7839 Před měsícem +1

    That is freeking amazing. Great video on it, thanks for developing this terrific tool.

  • @bengterlandsson7921
    @bengterlandsson7921 Před 2 měsíci +1

    This script is great. It will be my go to way to stretch images from now on. After stacking and cropping, graXpert, blurX, noiseX and then your stretch script! Excellent job! Thanks

    • @setiv2
      @setiv2  Před 2 měsíci

      Great to hear!!

  • @josephluciani5531
    @josephluciani5531 Před 2 měsíci +1

    Amazing tool, very innovative! Thanks for this Frank.

  • @Crazyslevin
    @Crazyslevin Před 2 měsíci +2

    Awesome Script Seti! Thank's a lot for the work!

  • @danbartlett7923
    @danbartlett7923 Před 2 měsíci +2

    Love it! Thank you Franklin.

  • @brianastrodoc2886
    @brianastrodoc2886 Před měsícem +1

    Brilliant. I’ll be using this script in my workflow.

  • @davechaton6771
    @davechaton6771 Před 2 měsíci +3

    That's a realy nice script. I usually start my stretch with Masked Stretch, and this did a great job much faster and easier. Thanks

    • @setiv2
      @setiv2  Před 2 měsíci

      Great to hear!

  • @CGastro
    @CGastro Před 2 měsíci +1

    looking forward to try it.

  • @christopheguigot841
    @christopheguigot841 Před 2 měsíci +1

    Sacré boulot encore….merci beaucoup .

  • @AstroIsland
    @AstroIsland Před 2 měsíci

    For many years I’ve struggled with STF and Hyperbolic stretch. Then you came along to save the day! Thanks so much for this. I’m going to redo all my images. Can’t wait for Nebula season as well to stretch new objects. Clear skies and thanks again for this game changer!

    • @setiv2
      @setiv2  Před 2 měsíci

      You are so welcome! That is really great to hear!

  • @jims9982
    @jims9982 Před 21 dnem

    Cannot wait to try this out. Thank you so much.

  • @AstraPharmaq8
    @AstraPharmaq8 Před 2 měsíci +1

    This is a very cool little tool you have there, thank you for sharing!

  • @traceymonroe9026
    @traceymonroe9026 Před 2 měsíci +2

    Thanks so much for the script, this is perfect and exactly what I was searching for.

  • @Excessus1978
    @Excessus1978 Před 2 měsíci +2

    Thanks you all the great videos you make! I'll try this script! Thanks!

  • @Thommy78
    @Thommy78 Před 2 měsíci +1

    Great work! Thank you. Looking forward to test it out.

  • @bobc3144L
    @bobc3144L Před 2 měsíci +1

    It is certainly easy to use and fast. I will have to play around some more with the adjustment sliders but I redid an old IC1805 using .25/.1 and it turned out well after some curves to blacken the background. EdgeHD 11/6200MM. Thank you. Great explanations!

  • @mishkobre8147
    @mishkobre8147 Před 2 měsíci +2

    Great script, thank you

  • @walterhock7809
    @walterhock7809 Před 2 měsíci +2

    This is really awesome!

  • @viewintospace
    @viewintospace Před 2 měsíci +2

    Cool stuff! I will for sure test it out!

    • @setiv2
      @setiv2  Před 2 měsíci

      Looking forward to any feedback from your tests!

  • @gnnyman
    @gnnyman Před 2 měsíci

    Very impressive! Thanks!

  • @qx3V45p
    @qx3V45p Před 2 měsíci +1

    Very nice! You have some cool scripts. Thank you!

    • @setiv2
      @setiv2  Před 2 měsíci +1

      Thanks! This should fit in right in, in time for nebula season with my other scripts.

  • @simonpepper5053
    @simonpepper5053 Před měsícem +1

    Really great script and really well explained thanks I will be using going forwards

    • @setiv2
      @setiv2  Před měsícem

      Great to hear! Always open to suggestions and improvements too.

  • @MrBebopbob
    @MrBebopbob Před 2 měsíci +1

    Very nice. I will try this on some M101 data I am currently integrating. Thanks.

  • @sajjadahmed46
    @sajjadahmed46 Před 5 dny

    this is amazing... really appreciate your efforts!!

    • @setiv2
      @setiv2  Před 5 dny +1

      Glad you found my scripts!!

    • @sajjadahmed46
      @sajjadahmed46 Před 5 dny

      @@setiv2 Not as glad as i am :)

  • @franckmalterre6087
    @franckmalterre6087 Před 2 měsíci

    Nice work, I have to try that !!

  • @zborkz
    @zborkz Před 2 měsíci +1

    Great work

  • @IcedReaver
    @IcedReaver Před 2 měsíci +1

    Downloaded this script last night and it worked great on my LRGB M33 image. I always have trouble stretching galaxy images, but this worked so well! One area of improvement would be to have an interactive preview of some kind. When you launch the script, you cannot undo/redo changes on the image whilst the script dialog box is open. As a workaround, I create a process icon using the triangle and adjust the settings in this window whilst testing on some previews. It's quicker than re-launching the script. Minor comment aside, thanks for making a great script and making in available free of charge Franklin. Subscribed to the channel and sent a donation via your website :)

    • @setiv2
      @setiv2  Před 2 měsíci +2

      Wow thanks so much! Real time preview is beyond my coding experience right now (I am not a coder and these are the first times i have done anything in javascript and learning as I go). That is a future goal for sure. I do know my math though, while the dialog is still open just change the target median to whatever new value. It re does the calculations and adjusts the image to your new target value. No need to exit out.

    • @IcedReaver
      @IcedReaver Před 2 měsíci

      @@setiv2 Ah that's cool! So if I have performed stretches by adjusting the median, and also change sigma boost, does that compound with the existing stretch(es) or does the script work to give the same final result irrespective of how many times I executed it? As you say, this would avoid having to close and reopen the script. Nice work on your first script too, I'll be checking out the Star Stretch one next :)

    • @setiv2
      @setiv2  Před 2 měsíci +1

      It does compound. If you start with no optional sigma boost then all the math is completely reversable. I would suggest executing it until you find the median you like, then click the sigma boost for one final execute. I would also suggest my NB to RGB stars script as we come into nebula season. No need to shoot seperate RGB stars anymore :)

  • @andynowlen
    @andynowlen Před 2 měsíci +1

    I like this a lot. Thank you. Maybe you can do a video that shows a comparison between your model and GHS.

    • @setiv2
      @setiv2  Před 2 měsíci +3

      GHS is just a different tool honestly. What I started doing is this as my initial stretch and then GHS to do a final tweak to highlight whatever I want to focus on.

  • @galactus012345
    @galactus012345 Před 2 měsíci +1

    Great work, I love your approach and explaination.
    Some questions to better handle the script
    Do you recommend to stretch starless image or not necessarily ?
    My osc images looks greenish after the script, shall i always colorcalibrate it first ?
    No option to color balance like ez stretch ?

    • @setiv2
      @setiv2  Před 2 měsíci +2

      With OSC with an IR cut filter you will always want to run SPCC before any stretching. If you are using narrowband filters you would extract and work all the channels seperately. You dont want your stretching solution to do the color balancing. Stretching should preserve the color balance. I always remove my stars and stretch the starless and stars seperately (hey I got a script for star stretching too :) ). General workflow I follow is. GraXpert (or other gradient removal) -> BlurX -> SPCC if RGB -> StarX -> NoiseX -> Stretch.

  • @jacquesbeauropert
    @jacquesbeauropert Před 2 měsíci

    too strong. Congratulations😉

  • @DominikW
    @DominikW Před 2 měsíci

    Adding the script as an instance icon bakes the settings into the process. Calling it globally via the script window displays default values but upon executing, the settings that were initially set in the instance are used.
    Example: open process, change Target Mean to 0.1. Save process icon. Double click icon and execute globally (adding a view string to circumvent the error message of missing view). The script loads and displays 0.25 (i.e. default values). But executing uses the initial values that were set in the icon instance, in this case 0.1.

    • @setiv2
      @setiv2  Před 2 měsíci

      You cant run this script globally. You can also just double click any parameter to vhange the value when you double click the saved icon. Sure there arent sliders but it does the exact same thing as the dialog.

  • @randomtinkering
    @randomtinkering Před 2 měsíci +1

    Do you stretch each Mono channel individually with the tool? Or do you clean the channels up, combine and use your tool?

    • @setiv2
      @setiv2  Před 2 měsíci +1

      That really depends on your target. Nebula you can stretch seperately until you like how they look, for galaxies you probably want to combine and color calibrate prior to stretching

  • @ThePope_francis
    @ThePope_francis Před 2 měsíci +3

    how did you gain 100 subscribers overnight 😭😭😭

  • @TevisC
    @TevisC Před 2 měsíci +1

    Parsing repository update information: Parsing Signature element (line=1 offset=0): Unknown code signing identity 'FranklinMarek'

    • @setiv2
      @setiv2  Před 2 měsíci

      If you 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

    • @TevisC
      @TevisC Před 2 měsíci

      @@setiv2 run --execute-mode=auto "C:/Program Files/PixInsight/src/scripts/StatStretchV1prod/statisticalstretch.js"
      Processing script file: C:/Program Files/PixInsight/src/scripts/StatStretchV1prod/statisticalstretch.js
      *** Error: Signature verification failed for 'StatisticalStretch': Unknown code signing identity 'FranklinMarek': C:/Program Files/PixInsight/src/scripts/StatStretchV1prod/statisticalstretch.js

    • @setiv2
      @setiv2  Před 2 měsíci

      And there is no .xsgn file in that folder? You can also email me which helps since we can share screenshots to troubleshoot

    • @MarcelloBarile
      @MarcelloBarile Před měsícem

      @@setiv2 will it still get an update notification when installed via the zip package?

    • @setiv2
      @setiv2  Před měsícem

      @@MarcelloBarile no. You need the repository to get the automatic updates. What you need to do is upgrade pixinsight to build 1605 (the latest build that came out in march). That will solve all your signing errors.

  • @stephanechabert5316
    @stephanechabert5316 Před 2 měsíci +1

    Very nice but i have got a problem of resolution. I can't read the explications above. I have the latest version of Pix ang working with my PC in 4K. Kinds regards

    • @setiv2
      @setiv2  Před 2 měsíci

      Is the instruction box text too small, cutoff, showing a scroll bar? You can also email me directly with a screenshot of what you are seeing. That may be more helpful

  • @daveshow07
    @daveshow07 Před 2 měsíci +1

    Would love something like this in Siril 😅

    • @setiv2
      @setiv2  Před 2 měsíci

      I have never used Siril. Can you code within it?

    • @daveshow07
      @daveshow07 Před 2 měsíci

      @@setiv2 you can create scripts, but perhaps not quite to the level in PI. Building a script in Siril seems intuitive enough, but after I spent several hours over the last few days trying to figure out how to attempt your statistical stretch script in Siril and made little progress... Welp 😂

  • @yervantparnagian5999
    @yervantparnagian5999 Před měsícem

    This is super! For an RGB image, would it be best to separate the channels first and then run a Linear Fit process to equal out the colors before doing this Statistical Stretch?

    • @setiv2
      @setiv2  Před měsícem +1

      No, linear fit is a super outdated method. Run SPCC (use my new script Find Background to get your ROI for the backgroundneutralization section of SPCC) then just run Statistical Stretch in the Linked mode.

    • @yervantparnagian5999
      @yervantparnagian5999 Před měsícem

      @@setiv2 Thank you very much for the quick reply. I tried your Find Background, Stretching Stars and Stat Stretch. All three worked incredible.

  • @JohnSmith-rf9if
    @JohnSmith-rf9if Před 2 měsíci +1

    Can you confirm that your install works on Linux Mint. I'm having the same signature problem and deleting the signature file doesn't fix it. I'd really like to give this a try, but can't if I can't install it.

    • @setiv2
      @setiv2  Před 2 měsíci

      The operating system shouldnt matter as it is coded in pixinsights javascript environment. The signature problem shouldnt show up at all if there is no .xsgn file as pixinsight wouldnt have anything to check then. Best i can recommend is download the zip of the script. Extract it. Delete the .xsgn file making sure there is only one .js file in the folder and then go scripts -> feature scripts -> add script. Point it to the folder with the sole .js file in it.

  • @alikheiri7389
    @alikheiri7389 Před měsícem +1

    I think there is an issue with the repo, I get this error:
    Unknown code signing identity: 'FranklinMarek'

    • @setiv2
      @setiv2  Před měsícem

      You need to update pixinsight to the latest build 1605 that came out in march. You get it from the pixinsight downl9ads page

  • @shubinternet
    @shubinternet Před 2 měsíci +1

    It looks like all these images are monochrome in nature. What does this stretch look like for OSC images?

    • @setiv2
      @setiv2  Před 2 měsíci

      I perform a stretch on a color image in the video as well. Go to timestamp 13:05

  • @kiscsigabee
    @kiscsigabee Před 2 měsíci +1

    Awsome! Could this be integrated in Siril too?

    • @setiv2
      @setiv2  Před 2 měsíci

      I have never used Siril. If Siril allows for javascripting I dont see why not. There isnt anything too exotic in this script. You would have tp find someone familiar with Siril though that I could work with.

  • @jimshanks8352
    @jimshanks8352 Před 2 měsíci

    Just tried this on M51 from a ZWO-ASI533MC-PRO OSC. It produces a heavy, dark green cast. Any ideas why or solution?

    • @setiv2
      @setiv2  Před 2 měsíci

      Did you color calibrate first using SPCC or BackgroundNeutralization -> ColorCalibration?

    • @jimshanks8352
      @jimshanks8352 Před 2 měsíci

      @@setiv2 just tried SPCC first and problem solved. Initial image looks good now. Will play with other parameters now to find optimal setting for. M51. Thanks!

    • @setiv2
      @setiv2  Před 2 měsíci

      The stretch preserves whatever colorbalance you have in your image. Glad you got it balanced with spcc and stretched!

  • @willemwitteveen8374
    @willemwitteveen8374 Před 2 měsíci

    Great video. When I perform a stretch, the result is a white screen. What am I doing wrong?

    • @setiv2
      @setiv2  Před 2 měsíci

      Is your STF still on?

  • @speppino
    @speppino Před měsícem

    your repository link is not working in pixinsight. Is there an alternative URL? thanks and great job on the scripts

    • @setiv2
      @setiv2  Před měsícem

      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. Also make sure you copy the full URL. I recommend going to my website and copying the url from there.
      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 files (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

  • @Makrem
    @Makrem Před 2 měsíci

    Hi, nice. How can i resolve this error please : Error: Signature verification failed for 'StatisticalStretch': Unknown code signing identity 'FranklinMarek'

    • @setiv2
      @setiv2  Před 2 měsíci +1

      Seems like your PixInsight isnt updated. You will need to go into C:/ProgramFiles/PixInsight/src/scripts. Find the StatisticalStretch.xsgn file and delete that, Do Not delete the StatisticalStretch.js file though

    • @Makrem
      @Makrem Před 2 měsíci

      @@setiv2
      My PixInsight version 1.8.9-2 build 1601 and not have the StatisticalStretch.xsgn under C:/ProgramFiles/PixInsight/src/scripts

    • @Makrem
      @Makrem Před 2 měsíci +1

      @@setiv2 Solved, i installed manually without xsgn file

    • @setiv2
      @setiv2  Před 2 měsíci +1

      Glad you got it working! I havent had anyone else say they ran into signature errors. PixInsight did push out a new author list when you check for updates that your computer may have missed.

    • @RegulusRemains
      @RegulusRemains Před 2 měsíci

      @@setiv2 github link is broken for me.

  • @thijrtuigynv
    @thijrtuigynv Před měsícem

    I was unable to perform any stretching using your script - it says in red in the console:
    *** Error: Invalid character in expression:
    BlackPoint = iif((med($T) - 2.7*sdev($T))

    • @setiv2
      @setiv2  Před měsícem

      Very weird. What version of statistical stretch are you using? What version and build of PI do you have?

    • @thijrtuigynv
      @thijrtuigynv Před 29 dny

      @@setiv2 I downloaded it from your website yesterday Statistical Stretch V1.5. PixInsight 1.8, I do not know how to find out the build.

    • @thijrtuigynv
      @thijrtuigynv Před 28 dny

      @@setiv2 Statistical stretch V1.5. PixInsight 1.8, build I don't know.

  • @simonhooper2458
    @simonhooper2458 Před měsícem +1

    No idea why but this script just turns everything green. STF does not do this

    • @setiv2
      @setiv2  Před měsícem +1

      You need to color calibrate first. My guess is you were doing an unlinked STF. This script necessarily preserves color calibration.

    • @simonhooper2458
      @simonhooper2458 Před měsícem

      @@setiv2 Ok won't work for me then as colour calibration keeps failing.

  • @ChristianProulx
    @ChristianProulx Před 2 měsíci

    Do you give me permission to show your script to the French community out there , on my CZcams channel ?

  • @karelmachado8535
    @karelmachado8535 Před 2 měsíci +1

    Thank you for sharing. It appears your scripts do not work. See error message below:
    StarStretch2.1signed/star_stretch_v2.1.js
    *** Error: Signature verification failed for 'StarStretch': Unknown code signing identity 'FranklinMarek': /Users/karelyade4ever/Desktop/StarStretch2.1signed/star_stretch_v2.1.js
    run --execute-mode=auto "/Users/karelyade4ever/Desktop/StatStretchV1prod/statisticalstretch.js"
    Processing script file: /Users/karelyade4ever/Desktop/StatStretchV1prod/statisticalstretch.js
    *** Error: Signature verification failed for 'StatisticalStretch': Unknown code signing identity 'FranklinMarek': /Users/karelyade4ever/Desktop/StatStretchV1prod/statisticalstretch.js

    • @setiv2
      @setiv2  Před 2 měsíci

      If you run into a signature error your pixinsight authorship list wasnt updated yet. Please remove the .xsgn files. If you downloaded the zip file only extract the .js file and delete the .xsgn file. If you downloaded from the repository you will have to find the .xsgn files in C:/ProgramFiles/PixInsight/src/scripts

    • @karelmachado8535
      @karelmachado8535 Před 2 měsíci

      Perfect. Will try that tomorrow. Again, thank you. Can wait to try your script.

    • @karelmachado8535
      @karelmachado8535 Před 2 měsíci

      @@setiv2 It work! Thank you.

    • @setiv2
      @setiv2  Před 2 měsíci +1

      @@karelmachado8535 great to hear!

  • @albertmetro2513
    @albertmetro2513 Před 2 měsíci

    Did not work--both methods!

    • @setiv2
      @setiv2  Před 2 měsíci

      What error are you receiving? Also do you have the latest pixinsight build 1605? That is going to be needed as all scripts are started requiring signatures.