PixInsight Forum

Software Development => New Scripts and Modules => Topic started by: Silvercup on 2011 September 28 06:55:14

Title: HaRGBCombination Script
Post by: Silvercup on 2011 September 28 06:55:14
Hi:

I have developed a HaRGB Combination script that I posted here: http://pixinsight.com/forum/index.php?topic=3401.0 (http://pixinsight.com/forum/index.php?topic=3401.0).

I repost here so anybody miss it, and for your consideration.

(http://farm7.static.flickr.com/6156/6169031015_f9f92899d4_b.jpg)

(http://farm7.static.flickr.com/6153/6169565372_62ff356f0c_b.jpg)

Image Credits Jim Misti.

The script is very simple to use:

In Control Channels we choose the Ha and RGB images, the filters bandwidth and the Ha multiplication factor.

You will realize that lowering the RGB Bandwidth fewer Ha passes down and viceversa, but the differences are not very evident.

The multiplication factor is more  important because it will increase more or less the intensity of Ha, if we have a noisy channel we can not multiply much, if there is more signal we can increase multiply factor (in Harry's example up to 4) .

In Color Calibration Control we can choose whether or not to color calibrate the final image. Uncalibrated is selected by default for script to go faster. Checking Color calibration will calibrate the final image, for it, we will choose a preview of the background and a preview (or the entire RGB image) for white balance that you PREVIOUSLY defined in the RGB image. Depending on the image we choose Layers Structure detection or not. Finally, we can apply or not SCNR to green to finish calibration.

Checking AutoSTF we can apply an AutoSTF when we use a linear images, otherwise we would not see anything. In the case of combining with stretched images you must uncheck it.

Show Buttons. Show HaRGB and RGB buttons allow us to see the RGB and the HaRGB combination, both buttons open the console while working, do not touch the script until it closes the console and display the images, especially HaRGB Show takes a while, so don't be impatient as Pi can do strange things.

I put the script in a zip.

I would like to see results, and tell me if there is any fault, or if I can improve.

Silvercup.

Title: Re: HaRGBCombination Script
Post by: Alejandro Tombolini on 2011 September 28 07:16:50
Thank you for sharing it Silvercup. It sound very easy to use, I only need some data to try!.

Saludos, Alejandro.
Title: Re: HaRGBCombination Script
Post by: Juan Conejero on 2011 September 28 10:15:32
Hi Silver,

An outstanding work as usual. Congratulations! ;)

This script can be extremely useful for most PI users, and I can see many possibilities of further development in the short-medium term. Can we include it in the standard set?

If you agree, I can release a special update to distribute it to all PI users through the update system. Do you think it is production stable, or is it still in the beta stage? If it is stable we should distribute it through the standard repository (update.pixinsight.com); otherwise we should release it through update-devel. In both cases I can send a massive email notification. I look forward to your decision.
Title: Re: HaRGBCombination Script
Post by: Harry page on 2011 September 28 12:35:11
Hi

I sometimes add Ha to blue / lum is there a way to add some more options  >:D

Harry
Title: Re: HaRGBCombination Script
Post by: jtheios on 2011 September 28 13:57:14
I tried this LATE last night after I read the original post about the script. WOW. It worked great. Thanks so much. This past summer I've taken a lot of Ha data with the goal of eventually adding it to my LRGB images. Unfortunately, I just haven't had the time to study the Forum threads  and videos on the various techniques.  Now I have something to keep me busy this winter when the weather gets more iffy!

One question. The resulting image seem to have too much in the blue channel. What's my best approach to tone it down-- Curves?

John
Title: Re: HaRGBCombination Script
Post by: Silvercup on 2011 September 28 15:37:56
Hi all:

Juan, I would like to see some results whit this script, and find a method to dim red channel where B and G channles have strong signal.

Harry, I have resumed (again) the multichannel combination script. In this script you can mix channel the way you want. My problem is time.

John, if you have too much blue, perhaps Color Calibration is not performing well. You can create any number of preview for background and white balance. So I'll try background neutralization with several previews. Take in consideration that you must select a preview of the background in the RGB but you must take care of Ha, so do not select a preview where the final image has Ha. If this fail, uncheck color calibration and calibrate manually.

Silvercup
Title: Re: HaRGBCombination Script
Post by: jtheios on 2011 September 28 20:22:10
Quote
Take in consideration that you must select a preview of the background in the RGB but you must take care of Ha, so do not select a preview where the final image has Ha. If this fail, uncheck color calibration and calibrate manually.

Okay, I'll try that, thanks.
- John
Title: Re: HaRGBCombination Script
Post by: Juan Conejero on 2011 September 29 00:02:02
Quote
Juan, I would like to see some results whit this script, and find a method to dim red channel where B and G channles have strong signal.

The best way to get the script thoroughly tested is by releasing it through update-devel. Can I proceed?
Title: Re: HaRGBCombination Script
Post by: Silvercup on 2011 September 29 01:43:29
Yes,  You can  :)

Silvercup
Title: Re: HaRGBCombination Script
Post by: RickS on 2011 September 29 02:32:45
Great script, thanks!  It worked a treat with my widefield of the Tarantula nebula area.

Cheers,
Rick.
Title: Re: HaRGBCombination Script
Post by: jtheios on 2011 September 29 07:41:41
Quote
Take in consideration that you must select a preview of the background in the RGB but you must take care of Ha, so do not select a preview where the final image has Ha.

That did the trick. Thanks, Silvercup. Also, I seem to get better results by running the script on linear images, and not stretched-- which I had tried initially.

-- John
Title: Re: HaRGBCombination Script
Post by: Jordi Gallego on 2011 October 02 02:03:13
Thanks again for your work Silvercup :D
Title: Re: HaRGBCombination Script
Post by: Lex on 2011 October 02 14:39:43
Hi,

thanks for sharing! I tried ti integrate it in PI but it tells me something like error lin 83 or so?
Am I doing something wrong?  ???

Thanks

Lex
Title: Re: HaRGBCombination Script
Post by: Harry page on 2011 October 21 09:17:57
Hi Juan

Did this script get lost in the mist


Harry
Title: Re: HaRGBCombination Script
Post by: Harry page on 2011 October 21 09:40:51
Hi

Just had a new play  8)

Couple of things

1) do not apply STF to the images before applying script as it will crash PI

2) I would like to preview the Ha emission so I can see if I have it right

Kind regards Harr
Title: Re: HaRGBCombination Script
Post by: Juan Conejero on 2011 October 24 11:03:23
Hi Harry,

Quote
Did this script get lost in the mist

Indeed! I overlooked it completely --too many things in my head I'm afraid. I'll publish it through update-devel ASAP.

By the way, I owe you a cocoon ... although I guess you managed to get it as you want without my help, did you?
Title: Re: HaRGBCombination Script
Post by: Harry page on 2011 October 24 11:29:59
Hi

I know you are a busy man  >:D

I did get the stars better , would have liked them a little less intrusive but my skills failed me

Harry
Title: Re: HaRGBCombination Script
Post by: Harry page on 2011 November 30 13:25:03
Hi

I find if I try and run the script twice ( testing settings) the old script crashes  >:D

Also did you give any thought on being able to see the modified Ha image before combination , lastley could the script tidy up after its self delecting the working images when complete  :-*

Harry
Title: Re: HaRGBCombination Script
Post by: dayers on 2011 December 01 09:15:01
Has this script been released through the update process yet? I don't see it.

Dave
Title: Re: HaRGBCombination Script
Post by: Alejandro Tombolini on 2011 December 08 08:18:53
Has this script been released through the update process yet? I don't see it.

Dave
I think it has not.

I'm trying to install it in the script folder but it does not appear. Does it work with W7 64 bit?

Saludos. Alejandro.

Title: Re: HaRGBCombination Script
Post by: Harry page on 2011 December 08 11:20:53
Hi

Lord Juan has not sent ot out yet  8)

You can download it from above and then run the script from there :D

Harry
Title: Re: HaRGBCombination Script
Post by: Alejandro Tombolini on 2011 December 08 11:43:18
Exellent, thank you Harry, I'll do that.

Saludos. Alejandro.
Title: Re: HaRGBCombination Script
Post by: marekc on 2012 January 04 20:00:50
This looks like a great script! I can't wait to try it!

Unfortunately.... my monitor isn't tall enough to run the script  :-[

When I run the script, the script window is fairly tall, and it doesn't fit on my monitor. I can't access the buttons at the bottom of the script window. Thus, I can't run the script.

I'm using a 15" MacBook Pro, with a monitor that is 900px high. Is there any way for me to change the size of the script's window?
Title: Re: HaRGBCombination Script
Post by: Ioannis Ioannou on 2012 January 05 00:25:02
Just to help a bit people that want to enable in the script list.
Edit it (with a text editor) and add at the top something like the below :

Quote
#feature-id    Utilities > HaRGBCombination

#feature-info  Script to combine Ha with RGB \
               by Silvercup \
               see http://pixinsight.com/forum/index.php?topic=3446.0

#feature-icon  HaRGBCombination.xpm


save the script  and then add it from Scripts -> Feature Scripts

Or, load it in the script editor and run it with F9

BTW, I did not had any crash issues so far and I have used it 10-15 times on old and new images, both under W7 64b and Linux 32bit.

1-2 small requests (Silvercup ? ) :

If you stop it abnormally it leaves residual views hanging around (Ha, R,G,B etc).
It assumes that there are no views already named Ha, R,G,B , which produces problems if there are.
It will be good (not confusing for the user) if the lists of views inside the script are excluding the above temporary views (the ones that the script is producing, ie R,G,B etc).
I would also like to have a way to preview HaEmmision, but since the script is modal and the view hidden.....

( Silvercup , did I mentioned how glad I am for this script?  ;D )
Title: Re: HaRGBCombination Script
Post by: troypiggo on 2012 April 02 04:38:12
Just came across this script tonight.  It looks like it has a lot of potential, however I've noticed some issues.

1. As Ioannis mentions above, to get it to be recognised by Feature Scripts you have to manually edit those lines in the script file.

2. The window is huge on my screen, MacBook Pro 17" 1440x900 (so not a small screen), and the bottom isn't visible.  Be nice to either have it not quite as long, or be able to reduce the size of some of the sections of the window like you can with the ImageIntegration ones for example.

3. If you run it a few times, the number of views becomes huuuuuge.  Can't it remove them after use?

4. Getting past the above, I thought it looked very promising.  If I click the "Show HaRGB" button, the image in the "Window Preview Control" at the top of the script's window looks exactly like the image I wanted.  However in PI's main window the "RGB" does not look the same.  I can't get an image to look like the script's preview window.

5. If I enable the colour calibration feature, the script crashes.
Title: Re: HaRGBCombination Script
Post by: cornyyy on 2012 April 25 08:14:14
Hi Silvercup,
Hi Juan,

this script sounds great and the pics seem to be great too. But I can´t click on the Preview or OK-Buttons because they where outside my screen (on my MacBook 15"). I´m not able to rescale the script-window.
Can you tell me how to fix the script that I can use it properly.

Cornel
Title: Re: HaRGBCombination Script
Post by: Ioannis Ioannou on 2012 April 25 10:16:46
Hi,

Since development on this VERY INTERESTING script seems stalled, I took the opportunity to play with it a bit.
As Juan said it needs a bit of cleanup. But for the moment I would like to share my changes so far - at least they will solve the 2 main issues mentioned so far , ie headers at the top and the size of the screen. I hope Silvercup does not have an objection ? (since there is no copyright notice I'm not sure the status of it).

Title: Re: HaRGBCombination Script
Post by: cornyyy on 2012 April 25 11:15:38
THX Ioannis,
the script works well for me and fits on my screen  :) :) :)

Cornel
Title: Re: HaRGBCombination Script
Post by: Harry page on 2012 April 25 11:42:25
Hi

Great work in tidying up the script  :D

A view of the modified Ha would be great before combination, so you can see if the settings are right  ;D


Harry
Title: Re: HaRGBCombination Script
Post by: Ioannis Ioannou on 2012 April 25 11:56:05
Well, I believe the script really needs an expert (Silvercup ? Juan ? Georg ? anyone ?) to tidy it up - I'm an amateur.
No promises, but if a more experienced than me can not spare some time on it, I may give it a try on my (limited) spare time and add a few more improvements .
Title: Re: HaRGBCombination Script
Post by: Silvercup on 2012 April 25 12:35:26
Hi all:

Feel free to modify the script.

I'm currently out of business for personal problems, sorry.

Silvercup.
Title: Re: HaRGBCombination Script
Post by: Harry page on 2012 April 26 12:57:57
Hi Silvercup

I hope things get better for you soon , we miss you here is pixy land

Harry
Title: Re: HaRGBCombination Script
Post by: Ioannis Ioannou on 2012 April 27 04:29:40
Sorry to hear Silvercup, I hope for the best

Pending a few answers on the library from the script Gurus, here it is as I have modified it so far. Give it a try.
Title: Re: HaRGBCombination Script
Post by: troypiggo on 2012 April 27 13:37:55
Silvercup - thanks so much for creating this script and hope things get better soon for you!

Ioannis - likewise, thankyou for picking up this script and continuing on the very useful work of Silvercup!

I've been playing with the script on a few different images and have some feedback if you don't mind?

* The window is large and doesn't fit comfortably on my 1440x900 display.  It seems that a lot of the script's window is taken up by the preview at the top.  But the preview seems redundant since there's a separate preview window in the main PI workspace that exactly mimics what you're seeing in the script's preview window.

* I really like the new "toggle Ha image" button.  This, with the "show RGB" and "show HaRGB" buttons allows blinking the 3 images to see before/afters etc.  Great idea.

* One comment, though, is that it's not immediately clear that "show HaRGB" is actually the button that does all the work.  For me, usually it's clicking "OK" that sets the script off doing the work, and "show HaRGB" could be misinterpretted as just showing a preview.  Perhaps there should be a  "generate HaRGB" button just above those, the have 3 toggle RGB/Ha/HaRGB buttons?

* I'm not sure of the workings behind the colour calibration part, but I just had the script hang when using it.  I had specified a background preview from my Ha image and white balance preview from the RGB image.  If I copied the bg preview from the Ha image to the RGB image and called it up from there, the script did finish and work fine.  Probably my fault, just letting you know.

* When choosing the views/images to use for Ha source, RGB source, and the colour calibration previews, the list is also filled with automatically generated views from the script itself.  I can't envisage that they'd ever actually be used for those selections, and they clutter up the drop down box adding confusion to the selection.  Perhaps views that the script itself generates could be removed/hidden from the drop down?

If you've read this far, thanks so much :)
Title: Re: HaRGBCombination Script
Post by: Ioannis Ioannou on 2012 April 27 15:47:34
* The window is large and doesn't fit comfortably on my 1440x900 display.  It seems that a lot of the script's window is taken up by the preview at the top.  But the preview seems redundant since there's a separate preview window in the main PI workspace that exactly mimics what you're seeing in the script's preview window.

Well, it is not exactly redundant. You see it is not just a preview, it is the CONTROL of the real Preview window (and as the matter of fact I made it to be the control of the HaEmission window also, without copying a preview of Ha though). The problem arises from the fact the with PJSR scripting you have limited access to the functions of the PCL library. As Juan has explained in the past you do not have access to the real Preview windows as used from the normal PI's processes.
From what I know so far (*),  the Dialog used as the main control for the script has the exclusive control of the screen (it is "modal", meaning that you do not have access to the other windows until you close it). So, how you zoom in/out or navigate in the Preview (or HaEmission) window ? You have a small window at the top and you scroll or move the mouse into it - and this allows you to control the other window(s). Try it.

The size of the Dialog IS indeed a problem, and arises from the fact that the tool just packs some controls together (preview, buttons, slide bars etc) without actually arranging them in the available screen space. The programmer does not have a clue what the real size will be in each screen. (Juan, Sizer is a great idea but it needs to take the available screen in consideration and/or produce automatically scroll bars, or arrange the controls more intuitively, like TCL/TK's equivalent tool.) 

What I was thinking as solution was to re-arrange the different controls (eg put all the preview buttons together, consolidate some of the others in one line etc) so to give more vertical space.

Moreover to see if I can avoid having the main Dialog as exclusive window : in this case you do not need the Control Preview screen on the top, you will have access to the real Preview/HaEmission window to scroll etc

Quote
* One comment, though, is that it's not immediately clear that "show HaRGB" is actually the button that does all the work.  For me, usually it's clicking "OK" that sets the script off doing the work, and "show HaRGB" could be misinterpretted as just showing a preview.  Perhaps there should be a  "generate HaRGB" button just above those, the have 3 toggle RGB/Ha/HaRGB buttons?


Yes, it is not clear. Actually ShowRGB just copies RGB to the Preview window, Show HaRGB does all the work and copies HaRGB to the Preview window and OK finalize the result and closes the temporary windows. I would had preferred if the sliders actually perform the job on the fly, but the calculations seem to take time, so I think Silvercup made it like this because of this limitation. Let me think how the procedure can be improved though (and of course any ideas are welcomed)


Quote
* I'm not sure of the workings behind the colour calibration part, but I just had the script hang when using it.  I had specified a background preview from my Ha image and white balance preview from the RGB image.  If I copied the bg preview from the Ha image to the RGB image and called it up from there, the script did finish and work fine.  Probably my fault, just letting you know.

Well, I have to check the code and make it more fault tolerant. As far as I understood the logic behind, it is assumed that the BG / White balance previews should be on the original RGB image.

Quote
* When choosing the views/images to use for Ha source, RGB source, and the colour calibration previews, the list is also filled with automatically generated views from the script itself.  I can't envisage that they'd ever actually be used for those selections, and they clutter up the drop down box adding confusion to the selection.  Perhaps views that the script itself generates could be removed/hidden from the drop down?

Yes, I know, it is one of my suggestions also, a few months before. I do not have a quick way to fix this (*) without re-eventing the wheel, but for sure pending improvement.

Also you have to consider that if you close the Dialog abnormally (eg from the X at the right corner or from a crash) you will have all the temporary Views used from it hanging around.


(*) The problem is that I know quit a lot of programming and I have extensive experience of creating new or understanding and changing other people's code, but I do not know the PCL/PJSR scripting library well enough. That's why I said "pending answers from the Gurus" , I need some answers from people understanding PCL/PJSR better, check this topic (http://pixinsight.com/forum/index.php?topic=4182.0)
Title: Re: HaRGBCombination Script
Post by: Harry page on 2012 April 28 02:49:09
Hi

I got it to run once , with very strange overley wide GUI and now I can not get it to run at all

Harry
Title: Re: HaRGBCombination Script
Post by: Ioannis Ioannou on 2012 April 28 12:17:14
Harry, the script (at this stage at least) assumes that you already have a current view open (actually the RGB view). This error appears if you run it without any view
Title: Re: HaRGBCombination Script
Post by: troypiggo on 2012 April 28 21:22:37
Ioannis, not sure if you're up for more ideas at this stage?  I'm wondering if this script is extensible to other narrowband filters other than just Ha.  Perhaps a feature could be to pick a filter image, similar to how Ha is picked with the current script, but you can assign that to a channel or channel mix instead of having it hard-coded to R.  And you could add NB images so it's up to you for OIII, SII, NII etc.  Would that be possible?  I'm sure the logic behind "Vicent's Method" is applicable to all NB/RGB blends?
Title: Re: HaRGBCombination Script
Post by: Ioannis Ioannou on 2012 April 28 22:34:17
Actually I was playing with this idea myshelf. I have tried to apply the method to G and B with OIII using pixelmath last summer. It seems to be something there, but my fits were not good enough to decide. Mind that with Ha and R you have a solid fact to start with : R contains all of Ha. This applies to R and SII, but the other combinations are more tricky - I just do not know the maths behind, if they exist.

From my point of view any idea worths testing, but at this stage I'll defently focus on making Silvercup's work more robust. After this we can expand it.
Title: Re: HaRGBCombination Script
Post by: troypiggo on 2012 April 29 05:52:42
Wouldn't the math be same?  What I'm talking about is the user chooses the mix or percentage of what filter they want in what channel.  So it's just a multiplier (of a value 1 or less say) of the filter times whatever channel they choose.

eg for an RGB image with Ha and OIII only, you might choose 1xHa in the R channel, and say 0.8xOIII in G, and 0.2xOIII in B (or whatever the mix is that splits OIII into G and B).
Or for a Hubble Palette image, 1xSII into R, 1xHa into G, and 1xOIII into B.  You get the Hubble Palette nebulosity and RGB stars.  Unless I'm missing something?
Title: Re: HaRGBCombination Script
Post by: Ioannis Ioannou on 2012 April 29 06:32:45
Wouldn't the math be same? 

Not sure about this. As far as I know, the method uses PixelMath to separate  Continuum from Emission data and then combine Emission with R (or at least this is my understanding so far). But eg OIII is part of both G and B. It is not just combining with percentages specific filter to specific channel. Maybe it can be done if the required percentage can be combined with filter's bandwith somehow, eg OIII is -let say- 8.5nm/2 for Baader and for G, assuming that half the bandwith is from G and the other from B. But all these are really beyond my knowledge, I'm just guessing here.
Title: Re: HaRGBCombination Script
Post by: Ioannis Ioannou on 2012 April 30 06:45:09
Still I have some very irritating points to correct, but I think this version is more robust.
The screen has been re-arranged, please give it a try (especially people with screens with limited height) and tell me your opinion.


Known bugs still pending :

1) If you close it from [X] or with the ESC key it will leave all the internal, temporary, views hanging around (I need help, I do not know how to fix)

2) For some strange reason "Show Ha" button refuses to perform correct STF  and I can not find so far why >:( (Working on it, help is welcomed)

3) The first time that you click on any of the listboxes (to select your Views), they will not show the internal, temporary views. But as soon as you have processed one image (aka you have triggered the console window once) the listboxes go nuts and show all available views (temporary included) (library bug ? need help).
Title: Re: HaRGBCombination Script
Post by: troypiggo on 2012 May 01 04:24:31
Well done.  Had a very quick run through, and it is a much better fit on the screen. Thankyou.
Title: Re: HaRGBCombination Script
Post by: Harry page on 2012 May 01 12:01:51
Hi

Layout is much better , and the silly 40 foot wide script is gone  :D

Get the Ha STF working and you will be on a winner

Thanks for your efforts

Harry
Title: Re: HaRGBCombination Script
Post by: Philippe B. on 2012 May 02 05:13:19
Yes, thanks for your work, this is an important script !
I hope it will be included in a future release.
Title: Re: HaRGBCombination Script
Post by: Ioannis Ioannou on 2012 May 02 06:20:11
OK, since you liked the new layout, I took some time from my lunch break and found the issue with STF on Ha,  cross this bug out.

BTW, how about 4 buttons:  "Show Ha Emission", "Show Ha Continuum", "Show RGB", "Show HaRGB" ? When I was using PixelMath for the same process, the image that was giving me better indication that I had the parameters correct was the C(ontinuum) one, not the Ha emission, what do you think?

And if yes, HaContinuum = HaOriginal - HaEmission will do the trick? correct me if I'm wrong please.

Title: Re: HaRGBCombination Script
Post by: Herbert_W on 2012 May 02 06:41:33
Hi,
Thanks for the script - it is great and will be very helpful.
What is the difference: ha emission and continuum?

Best regards.
Herbert, Austria
Title: Re: HaRGBCombination Script
Post by: Harry page on 2012 May 02 12:06:20
Hi

Excellent I like it as it is with the emiision showing :-*

Many Thanks

Harry
Title: Re: HaRGBCombination Script
Post by: Harry page on 2012 May 02 12:27:16
Hi

Just thinking , some like to add a bit to the blue , how about a slider to add some to the blue channel  :-*

Harry
Title: Re: HaRGBCombination Script
Post by: troypiggo on 2012 May 02 13:44:18
OK, since you liked the new layout, I took some time from my lunch break and found the issue with STF on Ha,  cross this bug out.

BTW, how about 4 buttons:  "Show Ha Emission", "Show Ha Continuum", "Show RGB", "Show HaRGB" ? When I was using PixelMath for the same process, the image that was giving me better indication that I had the parameters correct was the C(ontinuum) one, not the Ha emission, what do you think?

And if yes, HaContinuum = HaOriginal - HaEmission will do the trick? correct me if I'm wrong please.

Excellent work.  If it's simple to add the C button, by all means.  I thought that Vicent's method had the Continuum described as R/Ha?
Title: Re: HaRGBCombination Script
Post by: troypiggo on 2012 May 02 13:47:01
Hi

Just thinking , some like to add a bit to the blue , how about a slider to add some to the blue channel  :-*

Harry

I raised this in a different way earlier in this thread.  The possibility of extending the capabilities to add other channels and even other filters.  Ioannis indicated that his preference was to get the original Ha into R script working well, then entertain the possibility of extending it.
Title: Re: HaRGBCombination Script
Post by: Ioannis Ioannou on 2012 May 03 04:04:41
OK guys, I think it is stable enough to call it a "subversion" V1.3. Put both the script and the icon in the usual directory, regenerate the script list (Feature Scripts -> Regenerate). The only bug that is not yet fixed is the one that will show the temporary Views in the listboxes after you have already pressed one of the buttons (show an image, Apply etc). The first time it is ok.

And  lets catch it from here:

The C image should not be difficult , it is matter of just copy-paste-change-test , ie some spare time.
BTW  I have to check the maths Silvercup used, I though it was subtraction, not division  :-[ .
The slider to the other channels also should not be difficult (from the programming point of view) as soon as :


BTW, as for adding Ha to blue, I guess you know Vicent's objections about (Ha is not always the same with Hb, Hb may not even exists in the specific target, or it may have different structure etc) ?

Title: Re: HaRGBCombination Script
Post by: Geoff on 2012 May 22 00:47:58
I had a quick play with this script, adding H alpha to M83.  It really gives the image a lift.  Thanks for this.
Geoff
Title: Re: HaRGBCombination Script
Post by: Geoff on 2012 May 22 01:57:41
Hi,
Thanks for the script - it is great and will be very helpful.
What is the difference: ha emission and continuum?

Best regards.
Herbert, Austria
Some objects only emit light at very specific wavelengths (H alpha, OIII, etc). This is emission radiation. Others such as stars emit light at all wavelengths (including H alpha). This is continuum radiation.  So the Ha light from stars is just part of a continuum. So is any Ha light from reflection nebulae.
Geoff
Title: Re: HaRGBCombination Script
Post by: Herbert_W on 2012 May 22 02:43:57
Hi George!

Thank you for the answer!

Best regards
Herbert
Title: Re: HaRGBCombination Script
Post by: neuling on 2012 June 02 03:31:44
Hello,

I have a problem with the HaRGB script. I don't really know how to add/install it on Pixinsight.
I know this  are really the basics but still I'm new. :)

Thanks for help.
Title: Re: HaRGBCombination Script
Post by: Jack Harvey on 2012 June 02 13:38:22
I keep getting this error with my Mac 64 ver
Processing script file: /Users/coyyote/Desktop/HaRGBCombinationV1/HaRGBCombination.js
*** Error [000]: /Users/coyyote/Desktop/HaRGBCombinationV1/HaRGBCombination.js, line 90: Error: ImageWindow.ImageWindow(): invalid dimension(s)
Title: Re: HaRGBCombination Script
Post by: Fco. Bosch on 2012 June 02 13:49:28
Hello,

I have a problem with the HaRGB script. I don't really know how to add/install it on Pixinsight.
I know this  are really the basics but still I'm new. :)

Thanks for help.

1) download the script and save it to folder Pixinsight/scr/scripts
2) run PI
3) select menu/script/feature script
4) press add button and select "scr"; and you will find the new sript ...

Enjoy!


Title: Re: HaRGBCombination Script
Post by: neuling on 2012 June 02 16:11:45
Thanks for help now it works
Title: Re: HaRGBCombination Script
Post by: Ioannis Ioannou on 2012 July 27 02:26:14
Sorry Jack for the delayed answer, other obligations kept me away from the forum.

You are getting this error because you do not have one of your windows (eg Ha or RGB) open when you call the script.
Strange, I thought I had a dialog box warning for this, early enough. I have to recheck the code.

BTW did anyone used it so far ? How about more ideas (and the maths behind them please) to include ?
Title: Re: HaRGBCombination Script
Post by: prokyon on 2012 August 29 18:34:45
Thank you very much for that srcipt! The first time in my astrophotographers life I am happy with a HaLRGB. My results with PS were always different and it was really hard work - now it is fun.  ;)

Here my result:

http://www.prokyon.startime.at/Bilder/M16M17_HaLRGB_80perc.jpg

Thank you Silvercup!!
Title: Re: HaRGBCombination Script
Post by: marekc on 2012 August 30 09:30:50
Hi Prokyon,

That's a really nice image! I can't think of too many images that show both the Eagle and the Swan like that. The deep red Ha nebulosity shows up nicely, but the stars still look 'natural'. Great job!
Title: Re: HaRGBCombination Script
Post by: Ioannis Ioannou on 2012 September 04 04:11:29
Hello guys,

Long time nobody bothered with this script. Today I needed it once again, and BTW I fixed two small issues :

1) Now there is an "AutoSTF Linked RGB" parameter, default uncheked. Most of the times my RGB images at this stage, are neither Background Neutralized, nor Color Calibrated, so having the script performing a linked-RGB STF is useless.

2) I made a better warning when you open the script without an active Image.

I would like to expand it (although free time is limited) , but I 'm lacking the theoretical background.
I just do not know the maths needed.
So any ideas/suggestions (plus the needed maths) are more than welcomed.

Version 1.4 attached.
Title: Re: HaRGBCombination Script
Post by: Ioannis Komianos on 2012 September 04 10:20:57
Hello John,

That script is very useful!

Thanks for updating!
Title: Re: HaRGBCombination Script
Post by: mcbbcn on 2012 October 14 20:30:28
Great script!  Thanks for all your efforts.

M.
Title: Re: HaRGBCombination Script
Post by: mcbbcn on 2012 October 14 22:14:23
Hi,

I'm learning how to integrate this script into my current flow.  So, I have a couple of questions.

1) Do you apply this script before or after DBE?  I assume it's 'after' DBE, but I don't like to assume, so I wanted to check...

2) Also, I see that the script integrates the Color Calibration controls.  I usually run Background Calibration, and then Color Calibration in my RGB.  So, does the script color calibration takes care of Background Calibration 'and' Color Calibration? Or do I need to run Background calibration before I run the script with the Color Calibration previews selected? I assume that I have to run Background calibration, and I don't have run Color Calibration after I run this script.

If somebody could validate my assumptions, that would be very helpful.

Thanks for your help,

Miquel Casas
Portland, OR
Title: Re: HaRGBCombination Script
Post by: Ioannis Ioannou on 2012 October 14 23:35:32
Hello Miquel,

Well, I'm not claiming to be an authority, I'm just telling you my flow, the way I feel better working with it.
I perform DBE before the script ( as the matter of fact, most of the times, I prefer DBE before even RGB combination. My feeling is that DBE works better on mono photos)
I do not use the Background Neutralization, Color Calibration and Green SCNR from inside the script, I prefer to just do the HaR-G-B with it and then perform these steps after. Although I have to admit the script seems to do a good job with them also.

Just my 2 cents.
Title: Re: HaRGBCombination Script
Post by: mcbbcn on 2012 October 15 21:38:57
Hi Ioannis,

I've seen your work & I have a great respect for your opinion.  So, I'll definitely follow your advise.

Thank you so much for your help,

Miquel Casas
Portland, OR
Title: Re: HaRGBCombination Script
Post by: Astrodoc on 2012 December 24 09:28:31
Hello all.  I've used earlier versions of the script fine.  I installed the latest (1.4) in MacOS64 version of PI 1.8.0 RC1.  I get the following error (I do have Ha and RGB images open):


*** Error [000]: /Users/rbrecher/Documents/PixInsight Scripts/HaRGBCombination.js, line 129: Error: GenericImage::Allocate(): Insufficient number of channels


Anyone know what's going on?  Happy hols to all, and best for 2013.  To the PI TEAM:  Great job, guys.  I know I speak for many when I say thanks for your dedication!
Title: Re: HaRGBCombination Script
Post by: Ioannis Ioannou on 2012 December 24 10:17:10
Please try this (because for some strange reason I can not replicate the error under Windows) : open the script with a text editor and change at line 128 the true to false ( according to PCL's docs should be false and used to be false, how this got screwed up ? copy-paste I guess ).
Save and try again, should work ok (except if I have the same mistake somewhere else, again by copy-paste :( ) .

Please confirm and I'll release it as bug fix.

Thanks
Title: Re: HaRGBCombination Script
Post by: pfile on 2012 December 24 10:18:41
don't you want to wait in case the bug is actually in PI 1.8? or else then you have to do your own regressions on the script. based on the bug reports coming in on 1.8 i think it's going to be a while before we are using 1.8...
Title: Re: HaRGBCombination Script
Post by: Ioannis Ioannou on 2012 December 24 10:20:15
Aha!! 1.8 RC1 !! I did not upgraded yet, that's why I can not replicate it.
But in any case, according to PCL's docs, this point should had been false anyway. Just try it to see if fixes the specific error (I will not upgrade to 1.8 RC1 soon)



Title: Re: HaRGBCombination Script
Post by: Juan Conejero on 2013 January 22 11:54:15
Hi Silvercup / John,

Sorry for not having included this script in the new 1.8.0 RC2 release (I overlooked it again, doh!). If I see no trivial problems on RC2, I'll release it as an update ASAP.
Title: Re: HaRGBCombination Script
Post by: Ioannis Ioannou on 2013 January 22 11:57:07
Juan, I'm still using 1.7 !!  :-[
RC2 solved the problems reported above with RC1 ?
Title: Re: HaRGBCombination Script
Post by: Juan Conejero on 2013 January 22 12:05:00
Quote
RC2 solved the problems reported above with RC1 ?

Yes! I have just tested the script with RC2 and it works after a small fix. Change line #128:

   this.HaView= new ImageWindow(this.RGBView.image.width,
                                 this.RGBView.image.height,
                                 1,
                                 32,
                                 true,
                                 true,
                                 Ha_NAME);


with this:

   this.HaView= new ImageWindow(this.RGBView.image.width,
                                 this.RGBView.image.height,
                                 1,
                                 32,
                                 true,
                                 false, /* ### */
                                 Ha_NAME);


(because the image has a single channel, so it has to be in the grayscale color space). With this change the script seems to be working nicely. Could you please test it more thoroughly?
Title: Re: HaRGBCombination Script
Post by: Ioannis Ioannou on 2013 January 22 12:12:17
Yap, this true->false mistake is mine, should be changed (BTW I did not noticed the problem at 1.7, it was accepted as is with the previous version).

I will not be able to upgrade to RC2 and test soon, I'm currently traveling for business to the other side of the globe (and suffering from heavy jet lag :( ). My time is very limited and I will not be able to test until early February.

Other people that are using the script ?


Title: Re: HaRGBCombination Script
Post by: Harry page on 2013 January 22 12:58:01
Hi

Have tested the script with Juan's bit

Script runs ok , but the output image is no longet linear  :o

Harry
Title: Re: HaRGBCombination Script
Post by: Lex on 2013 January 24 12:30:50
Hi guys,

has anybody tested the script with RC3? I do not know what I did wrong but my MacBook shows the error code attached.

Normally the scripts should start without opened pictures? Has there got to be be an update for the scripts?
Btw, I have also have this problem with aberration spotter?
Or is there a new way to incorporate those magnificent scripts?

Thanks  ;)



Title: Re: HaRGBCombination Script
Post by: Harry page on 2013 January 24 12:33:30
Hi

Images have to be open when you start the script

Harry
Title: Re: HaRGBCombination Script
Post by: Lex on 2013 January 24 12:54:25
Hi Harry,

I think I am sitting on the line; I opened some pictures but the error remains  ???
Title: Re: HaRGBCombination Script
Post by: Harry page on 2013 January 24 13:00:06
Hi

Try this version

Does not give out linear images - need someone to help here though

Harry

Title: Re: HaRGBCombination Script
Post by: Lex on 2013 January 24 13:05:10
Harry,

yep, thanks a lot; this one is working  :laugh:
Is there a difference compared to the other one?
Title: Re: HaRGBCombination Script
Post by: Harry page on 2013 January 24 13:09:37
Hi

There was a mistake juan spotted , I just typed it in  :laugh:  ( look a few posts back )


Harry
Title: Re: HaRGBCombination Script
Post by: Jules on 2013 February 23 06:36:43
Hi

I copied the above script into the Pixinsight/contents/src/scripts folder on my macbook pro, but PI 1.8 RC3 does not see this script nor does 1.7. Can anybody make out if I have made a blunder with this please?


OS X 10.8.2

Thanks

Julian
Title: Re: HaRGBCombination Script
Post by: ugatza on 2013 February 23 16:43:33
It doesn´t work the link to download the script?
Title: Re: HaRGBCombination Script
Post by: georg.viehoever on 2013 February 24 02:57:39
Use Script/Feature Scripts... to register scripts.
Title: Re: HaRGBCombination Script
Post by: Jules on 2013 February 24 03:17:39
Georg

Thanks very much, thats worked!

Regards

Julian
Title: Re: HaRGBCombination Script
Post by: Ioannis Ioannou on 2013 February 24 10:41:37
ugatza which link you tried? The one Harry posted just a few topics above (which is the latest) works, I just tried.

BTW, Juan, will you final include it in 1.8  ? (I admit it, I didn't tried any 1.8 RC yet, no time :( )
Title: Re: HaRGBCombination Script
Post by: ugatza on 2013 February 24 12:37:59
Yes, finally I´ve tried with the one Harry posted and works, at least in my pc. Later will try in my notebook. Thank you.
Title: Re: HaRGBCombination Script
Post by: lucchett on 2013 April 09 13:03:54
Hi ,
does someone know if the script works properly under 1.8 rc5?
Is the result linear?
Many thanks,
Andrea
Title: Re: HaRGBCombination Script
Post by: troypiggo on 2013 May 23 11:25:19
Not sure about RC5 but I just used in on RC7 and Harry's one just a few posts up worked fine.
Title: Re: HaRGBCombination Script
Post by: Ioannis Ioannou on 2013 May 23 11:33:52
Yap, I also installed RC7 and can confirm Harry's (Juan's) correction.

BTW, I though that Juan was supposed to release it with 1.8 ? (and hopefully clean it up a bit with his huge knowledge on the library? I did my best, but still there are some rough points to be fixed)
Title: Re: HaRGBCombination Script
Post by: gspiegelman on 2013 June 09 11:00:25
I have tried this script under 1.8, but I do not get the dialog to show, the script just appears to run and I get an error "Not enough layers". Can anyone help here?
Title: Re: HaRGBCombination Script
Post by: Ioannis Ioannou on 2013 June 10 02:36:52
gspiegelman,  you have to be more specific, what window you had opened when tried, what options you put in the script etc etc. It works fine with my 1.8rc7 (The latest, with Harrys' correction)
Title: Re: HaRGBCombination Script
Post by: Ioannis Ioannou on 2013 August 14 23:27:52
Hello PI forum,

Long time we did not improved this script (which BTW, still is not officially included in 1.8 ). Yesterday night I was watching the excellent tutorials from Gerald, http://www.werbeagentur.org/oldwexi/PixInsight/PixInsight.html , especially the Oiii Ha R G B linear combination. I was not surprised with the trick used, i.e. swap the colors to use the HaRGB script for Oiii combination (I have tried it myself in the past), but I realized that I'm guilty of negligence : swapping back and forth the colors to achieve the combination is a lot of wasting time for everybody, while the HaRGBCombination script can be expanded to be able to do the same with THREE Narrowband filters.

Today is a national holiday here, I woke up early, family was still sleeping, and so I decided to test again my limited knowledge in PI scripting and try to make our lives easier. The interface has been finished and you can find a preview below. As you can see it is heavily based on HaRGBCombination but it will be a new NBRGBCombination script ;) . BUT I have some questions on the maths and I would appreciate anyone that can assist . Originally Silvercap implemented the "Vicent method" with these PixelMaths (free form):

Ha <- (Ha*RGB_bandwidth-RGB*Ha_bandwidth )/(RGB_bandwidth-Ha_bandwidth) -  hmm , take out the stars ?   

R <- R+(Ha-med(Ha))*HaMultiplier - not sure but, take out the nebula ? Leave only stars ?  Continuum ?

Ha <- LinearFit(Ha with R)

R <- max(Ha,R)

and finally
RGB combination

Now then, I'm not familiar with this procedure, although I have used it a lot of times via the script. Digging into my saved PixelMaths from 1-2 years ago, I found differences on what I had understood as the "Vicent" method (although I understand the concept used), so I need opinions if the same can be used with other filters on other channels (with the corresponding Bandwidth of course, not all filters are 7nm like Baader's Ha).
 
In the case of Ha there is a hidden assumption: Ha is already included in R. But e.g. with O3, part of it is in Blue and part of it is in Green. How we handle this ? Different mixing multipliers ? And I do not feel confident on the first two maths and the result they produce - at least not without previewing the result before applying it. Maybe now it is a good time to review, revise and make them more robust and general ?

Opinions please!!!!
Title: Re: HaRGBCombination Script
Post by: troypiggo on 2013 August 15 02:31:54
That's exciting development.  Haven't played with it, but I'm curious what channels the 2 other NB images get mapped to?  With HaRGB script it's a given that the Ha goes to R.  Perhaps another option where you could map the NB images to the channel of your choice?
Title: Re: HaRGBCombination Script
Post by: Ioannis Ioannou on 2013 August 15 03:51:59
Of course, that's the idea. I may have to make the labels more clear,NBr means first narrowband that will be joined to R, NBg means second narrowband that will be joint to G etc. That way you can have 4 or 5 or 6 filters.



Using the same for HST or similar ? Hmmmmmm this is more tricky than it sounds, due to the way the combination happens now with pixelmath. Lets keep that thought for later. My target now is to expand the existing script.
Title: Re: HaRGBCombination Script
Post by: oldwexi on 2013 August 15 10:29:52
Hi Ioannis!
Thats a great extension of the HaRGBCombination script.

As this script works perfect for me with linear data
i appreciate the shortcut you built in to mix every NB Image in any RGB Channel in any amount wanted!!!
Great.

Concerning Vicents method sometimes we use line 2, 3 or 4 but only when doing it manually.
For Line 1 of Vicents method we are just in progress todo research to understand it better...

Gerald
Title: Re: HaRGBCombination Script
Post by: Ioannis Ioannou on 2013 August 16 04:54:22
OK, here you are.
Renamed it to NBRGBCombination to indicate that it is not just Ha anymore. Kept the version numbering to avoid confusion. It is an extension of HaRGBCombination. Installation with the usual way.

My tests with older HaRGB images were ok (tested on 1.8RC7, should be ok with previous also).
Give it a try please, I do not have enough data to test all the cases (and/or contact me with PM to provide me data for tests)

Mind that I had to re-arrange the components on the screen.
Also I unchecked a few of the checkboxes, like the SCRN. I never do SCRN or Color calibration via the script.
MIND the default numbers for bandwidth are based on Baader filters.
Recommendations and feedback are more than welcomed.
Title: Re: HaRGBCombination Script
Post by: Juan Conejero on 2013 August 16 11:30:34
Hi John,

Nice improvement to the original script. I assume that by "Vicent's method of narrowband combination" you refer to this article (http://pixinsight.com/tutorials/narrowband/theory/en.html). In his article, I think Vicent made a remarkable contribution with the concept of continuum map. Vicent's approach is based on synthesizing a broadband image from the narrowband data. This is an open line of development that we have not yet exploited. We have so many projects, and unfortunately we have so little time and human resources...

Quote
Ha <- (Ha*RGB_bandwidth - RGB*Ha_bandwidth )/(RGB_bandwidth - Ha_bandwidth)

I'm not sure what the intent is with this expression. Essentially, the continuum map is the quotient between the broadband and narrowband images. This is basically a flat fielding operation, where the narrowband image acts like a model of the attenuation applied by the narrowband filter. Put in a more understandable form, the continuum map allows us to isolate just the continuum emission data in the image. So the continuum map in this case would be something simpler such as:

CM = NR( k*Red / Ha )

where k acts like a compensation factor in case it is necessary (k=1 by default), and NR() is a noise reduction operator. Once we have a CM we can synthesize a "clean" broadband channel using Vicent's iterative method, as described in the article. See Figure 8 for example. The crux of this method is avoiding the mix of narrowband and broadband data, which leads to unnecessary noise transfers.

Now the problem with this method is that it is sound for Ha because the red channel can be used as Ha's broadband counterpart with a physical basis, but what happens with OIII, SII, etc? It remains unclear how to build a continuum map for these filters in practice; as I said above this is an open line of development.

Quote
R <- R+(Ha-med(Ha))*HaMultiplier

This simply mixes Ha and red data. By subtracting the median, it is removing Ha's mean background. By multiplying by a scaling factor, it is controlling the amount of Ha that enters the mix. I don't know if anything else was intended, and I don't know also why the median is being subtracted this way.

Quote
Ha <- LinearFit(Ha with R)

This is equalizing the Ha and red images using a linear model, taking red as reference. The linear model assumes that every pixel in both images can be expressed as:

v = B + k*S

where v is the pixel value, B is the mean background, k is a scaling factor and S is the pixel's signal. For correctly calibrated and gradient-free linear images, this is a good model.

Despite these complexities, your version of Silvercup's original script is great and can be very useful. I encourage you to further develop it. Once we test it with 1.8 RC7, it would be a nice addition to the final 1.8.0 release. Just a few suggestions regarding the interface:

- Simplify/organize input controls. Instead of the current stack of "Source NB to ..." items, consider defining three GroupBox controls for the R, G, B narrowband images.

- I would label "Scale" instead of "Multiplication factor".

- When a narrowband component isn't selected, the corresponding numerical items should be disabled.

Also I would rethink the suitability of ColorCalibration. For a narrowband combination, the broadband data should be pre-calibrated.
Title: Re: HaRGBCombination Script
Post by: marekc on 2013 August 16 11:36:37
I have a question about the NBRGB Combination script:

What should I use for the "White Balance Preview"?

I know that if I were shooting a galaxy, I would simply drag a preview around the galaxy. Pixinsight uses the overall color of a spiral galaxy as the basis for the white balance in Color Calibration.

But for a target with no spiral galaxy, such as a nebula, Pixinsight's Color Calibration routine offers `Structure Detection' as an alternative. In other words, it uses the stars in the image for the white balance. So far, so good.

But if I select the 'Structure Detection' check box in the NBRGB script, it demands that I also select a "White Balance Preview".

What should this "White Balance Preview" be? A preview that includes most of the image?

(I am trying to process an image of the Trifid nebula and the nearby open cluster M21.)

Thanks,

- Marek
Title: Re: HaRGBCombination Script
Post by: Ioannis Ioannou on 2013 August 16 12:48:10
Thank you Juan for your contribution on the discussion, I was suspecting that the maths behind the script were not build on rock

I'm not sure what the intent is with this expression. .......
Now the problem with this method is that it is sound for Ha because the red channel can be used as Ha's broadband counterpart with a physical basis, but what happens with OIII, SII, etc? It remains unclear how to build a continuum map for these filters in practice; as I said above this is an open line of development.

Yap, as as I was suspected. But you see, the script produces easily nice results (at least with Ha), so I guess we all got lazy and used it without looking deeper. In any case it is a base, I guess the maths can always be improved. At least there is something we can play with.

Quote
Just a few suggestions regarding the interface:

- Simplify/organize input controls. Instead of the current stack of "Source NB to ..." items, consider defining three GroupBox controls for the R, G, B narrowband images.

Yes, the interface has became clattered and needs a redesign, I tried a few combinations with Groupboxes, but the result was more clattered than this, filling the screen and -as the script is modal- making the preview unusable. I'll try to think something better (ideas also are welcomed).

Quote

- When a narrowband component isn't selected, the corresponding numerical items should be disabled.

Yes, there are a few improvements like this for the UI to make it more intuitive. This was just a quick&dirty hack during a few morning hours of a holiday, just to put the idea on the table and to create something usable fast. Improvements like these can (and will) be done.

Quote

Also I would rethink the suitability of ColorCalibration. For a narrowband combination, the broadband data should be pre-calibrated.

YES, I can not agree more. I did not removed the interface and the routines regarding color calibration and SCRN, but I never understood why they were there at the first place and as the matter of fact, personaly I never used them. On this version I just unchecked them by default to discourage the usage just because they are already checked. Maybe it is good idea to totally remove this part of the script ? People ? ideas ?

Title: Re: HaRGBCombination Script
Post by: Ioannis Ioannou on 2013 August 16 12:54:40
What should I use for the "White Balance Preview"?

Marek, as you can see at Juan's and my answer above, IMHO the color calibration should not happen with this script.

As to answer your question (OT for the script), you can always use a white reference from another photo (eg a galaxy) - at least this is what I'm doing when I want to balance a photo with nebulae without galaxies.
Title: Re: HaRGBCombination Script
Post by: marekc on 2013 August 16 13:09:42
Thanks, Ioannis, that helps.

So, just to make sure I'm doing things correctly, here's how I'm using the script:

1) I make an RGB image with ColorCombination.

2) I select that RGB image as the RGB image in the NBRGB script.

3) I have the Ha image open, too, and I select it in the NBRGB script.

4) I make sure the filter bandwidths are correct. (I'm using Baader RGB filters, so I leave the RGB bandwidth at 100nm.)

5) I select previews in the Color Calibration portion of the script, but I leave the `Apply Color Calibration' box UNchecked.

6) I click the `Show RGB' button, and let the script work until I see an RGB image in the preview window.

7) I then click the `Show NBRGB' button, and let the script work until I see the image in the preview window change.

8) I click OK, and now I've got an HaRGB image.

Does that workflow look reasonable?

Thanks,

- Marek
Title: Re: HaRGBCombination Script
Post by: Ioannis Ioannou on 2013 August 16 13:36:50
Marek, step 5 is not needed, do not put white or black balance previews if you are not going to do color calibration (which IMHO is recommended). My workflow is :

1) DBE on each channel, RGB combination, dynamic crop, background and color calibration, dynamic alignment with Ha, O3 etc

2) open the script, select the RGB image, select the Ha, O3 narrowband(s), check the bandwidth, 100, 7 and 8.5 are for Baader filters, change accordingly

3) play with the multipliers of Ha, O3, previewing the changes with "Show NBRGB" (and I'm also going back-forth with Show NBr, Show RGB etc to see what it was and how it changes).

As soon as you are happy press OK

Title: Re: HaRGBCombination Script
Post by: Juan Conejero on 2013 August 17 10:51:51
Maybe it is good idea to totally remove this part of the script ? People ? ideas ?

Definitely. I would suppress the color calibration section because it makes no sense IMO.
Title: Re: HaRGBCombination Script
Post by: marekc on 2013 August 17 10:55:31
Thanks for the workflow tips, Ioannis! I used the script as you described, and it worked great! I didn't have a lot of Ha data to add to my RGB Trifid, and the script gave me a nice subtle `bumping up' of the red nebulosity. Just what I was looking for!

Doing Background Neutralization and Color Calibration on the RGB image, *prior* to running the NBRGB script, as you suggested, seemed to give a better result than my previous attempt.

- Marek
Title: Re: HaRGBCombination Script
Post by: cornyyy on 2013 August 17 13:15:09
Hi Ioannis

thanks for the script improvement. It works great for my efforts. But can you mix the Halpha a bit into the blue channel as well to show the Hbeta Emission in the RGB also?

Thanks a lot
Cornel
Title: Re: HaRGBCombination Script
Post by: Ioannis Ioannou on 2013 August 18 06:40:48
OK, If anyone else does not have an objection, I'll remove (actually hide) the calibration part next version (not sure when because I'm leaving for business trip now). This will make the screen smaller and I will be able to re-arrange the components better. Of course any suggestion is more than welcomed.

cornyyy: the last script posted allows you to mix any narrowband filter to any of the three channels, as much as you want. Did you tried it ? You just have to put your Ha in both NBr and NBb and then trim the corresponding multipliers (or "Scales" as Juan suggested).  Please give it a try and let us know how it worked.

BUT, IMHO, this is not a good practice. Presence of Ha structures does not mean similar Hb structures - if you search the forum you will find an older post from Vicent demonstrating exactly this.
Title: Re: HaRGBCombination Script
Post by: cornyyy on 2013 August 28 01:17:56
Hello Ioannis,

sorry for my delayed reply... i was in vacation.

Thanks for your suggestion. I put the Halpha also in blue to simulate the Hbeta Emission. Are I am right, that the Multiplication factor 1.20 means 120%?

So if i want to mix the Halpha to the red and 15% into the blue channel, i had to adjust the multiplication sliders for red to 1.2 and for blue to 0.18?

Cheers
Cornel
Title: Re: HaRGBCombination Script
Post by: Ioannis Ioannou on 2013 August 28 05:51:37
Sorry for my late reply and not been able to produce newer version, currently also at vacations.
Yes, I think you are correct re 0.18.
Title: Re: HaRGBCombination Script
Post by: Philippe B. on 2013 September 06 00:10:57
Nice job !
fore sure Color calibration is useless in this function.
We already have calibrated the RGB image, then add NB components.

Cheers,
Title: Re: HaRGBCombination Script
Post by: mads0100 on 2013 September 07 16:40:07
Why hasn't this been added to the release yet?  It seems to work pretty well.

Also, is there any way to get the line 129 fixed in the release for us mac users?  It wasn't terribly hard to find but worth correcting.

Title: Re: HaRGBCombination Script
Post by: Ioannis Ioannou on 2013 September 07 23:04:52
Just come back and I will try to find some free time to make the changes agreed above.

Of course, Juan will decide for releasing it or not.

mads0100, what is the problem with line 129 you mentioned ?  Is this something in the latest script (NBRGBCombination ) ? Because I'm not aware of it.
Title: Re: HaRGBCombination Script
Post by: Juan Conejero on 2013 September 08 02:18:16
Hi,

The color calibration section should be suppressed before releasing this script as an official update (I'd remove it completely, not just hide it, since it is a conceptual error). Along with this, I'd suggest some GUI improvements:

* The buttons in the preview section should be of fixed size and have just the necessary width. They should be stacked at one side (customarily, buttons are normally placed at the right side of previews and lists). The preview control should grow to fill all the available space.

* The channels control should be divided into four sections IMO: RGB, Red, Green and Blue.

* When the dialog is resized vertically an empty vertical space appears below the preview section. This should be removed and the preview control should grow vertically instead.

* Easy to fix but important: the spacing between standard Apply, Cancel and OK buttons should be 8 dialog units (now it's zero)
Title: Re: HaRGBCombination Script
Post by: Ioannis Ioannou on 2013 September 08 08:42:07
Which bring us to the next topic in subject: I took over maintenance of this script when Silvercup mentioned that had no time for it, and I wanted to improve it for my own workflow. Since then I put effort on it for fun, mostly when I used it for my images and had found something that could be improved during the process. But in any case, for me it was always a challenge on computer programming. I do have many many years experience on the topic, BUT:

1) I do not really know the programming language (but looks familiar and similar to many others). 
2) I do not really know the library used, or have documentation on it, other than browsing in the object explorer, looking into other people's code, periodically ask questions on the forum or just plain guessing.
3) I do not really have knowledge of the imaging methods and the maths used - again just guessing based on experience.

So, as you may understand, and considering that I do not really have an urge on an "official release", it will be difficult for me to put efforts on cosmetics or compliance on specific way of programming or look and feel.  I'm not saying that I can not do it  - although I do not know how to do a few things that Juan asked. For these I have to spend time to find out. Neither do I say I won't do it - it will just take me more time (never seem to have enough).

Simple putting it, it is not so fun for me right now, and if you wait me to implement all of these, it will take some time.

Sooo, considering that Silvercup gave the script with a "do whatever you want with it"  (meaning "public domain" in my book), anyone wanted to contribute at this stage, will be more than welcomed.


Title: Re: HaRGBCombination Script
Post by: topboxman on 2013 September 08 11:14:10
Hi Juan,

Can you or your team tweak this script for official release? It would be quicker since you or your team have the most experience.

Thanks,
Peter
Title: Re: HaRGBCombination Script
Post by: jdonald on 2013 September 13 10:50:39
Where do I download the script?
Title: Re: HaRGBCombination Script
Post by: Ioannis Ioannou on 2013 September 13 12:17:14
Previous page of this topic, so far the latest is attached on this message:
 http://pixinsight.com/forum/index.php?topic=3446.msg40130#msg40130

BTW my current tests with 6 filters (HaO3RGB) show good results.Anyone else tested it so far?

Pity that there are no people with scripting knowledge (and/or free time) to contribute on the code.
I'll have to find some free time to continue it.
Title: Re: HaRGBCombination Script
Post by: topboxman on 2013 September 21 11:55:23
I have been using HaRGBCombination script with good success. Now with latest NBRGBCombination script I noticed that no matter how much I change the parameters, it does not appear to make any difference in the preview screen. But I noticed the difference in previous HaRGBCombination script. It seems that NBRGBCombination script may be using hard coded parameters and ignoring my settings.

Does anyone else see what I am seeing?

Peter
Title: Re: HaRGBCombination Script
Post by: Ioannis Ioannou on 2013 September 21 13:07:35
Hmm, Peter, I'll check again the code tonight.
BTW, no matter what the preview does, is the final result correct?
Title: Re: HaRGBCombination Script
Post by: topboxman on 2013 September 21 13:24:55
The final result looks pretty good but I cannot tweak the changes because it does not appear to change in the preview. For example setting a Multiplier of 1.2 and 10.0 didn't make any difference. What I have not yet done is save both images of different settings to see if both images are different. Will get back to you later about this.

Peter
Title: Re: HaRGBCombination Script
Post by: Ioannis Ioannou on 2013 September 21 13:28:58
Checking as we post. So far I can not see anything strange on the code, but I'll check more and see if there is a bug somewhere.
Title: Re: HaRGBCombination Script
Post by: topboxman on 2013 September 21 13:47:57
I think it's okay. I was working in my room with the shades open and my room was bright. So I closed the shades and turned off the lights and noticed the change using Multiplier of 1.2 and 10. I am seeing same effects for both scripts. The bright room made it difficult to notice the change.

Sorry about the false alarm.

Peter
Title: Re: HaRGBCombination Script
Post by: Ioannis Ioannou on 2013 September 21 14:47:23
No problem. It made me look again back in the script, and maybe I found another bug (not related).
Also maybe I can spend some time to start the changes Juan mentioned.
Title: Re: HaRGBCombination Script
Post by: topboxman on 2013 September 21 16:02:58
Thank you for your contribution for finishing this script.

Peter
Title: Re: HaRGBCombination Script
Post by: mattssporre on 2013 October 16 23:49:13
Quote
Originally Silvercap implemented the "Vicent method" with these PixelMaths (free form):

Ha <- (Ha*RGB_bandwidth-RGB*Ha_bandwidth )/(RGB_bandwidth-Ha_bandwidth) -  hmm , take out the stars ?   

R <- R+(Ha-med(Ha))*HaMultiplier - not sure but, take out the nebula ? Leave only stars ?  Continuum ?

Ha <- LinearFit(Ha with R)

R <- max(Ha,R)

Is this really Vicent's method? Looking into the script I miss several components (but when I learned programming object oriented programming was not standard so it makes me unoriented  :)).

1. I do not see the creation of the continuum map (C = R/H in the case of Ha addition to the R channel)
2. I do not see any denoising of C
3. I do not see any creation of the attenuated R (or R flat fielded by Ha)

I would expect something like this (sorry for the crude programming syntax)

Repeat until "satisfied"
   Normalize(H to R);
   C = R/H;
   C = denoise(C);
   R = C*H;
end;

As far as I can see none of these steps are in the script, but it might be hidden to my eyes among all the "this.object.var()" stuff?

Moreover Vicent's method should also handle the difference in star sizes by creating a (k*Ha)GB image (swap the R channel with k*Ha where k is supplied by the user), use the Lum of this k*HaGB image in combination with the chrominiance info (a and b channels) from the HaRGB image created in the loop above.

I cannot see that either in the script  :surprised:

What I can see though is a max(R,H) - so is this really a (max(R,H))GB script, in combination with smart re-scaling (or star handling) of H and R (the two first math expressions in the quote above)?

The final possibility is that I am the one in need of denoising  :o

BR
Matts
Title: Re: HaRGBCombination Script
Post by: Ioannis Ioannou on 2013 October 17 01:39:13
Well, I think you are right. I always had doubts about the maths used. Original the discussion started from this thread (and others before it) http://pixinsight.com/forum/index.php?topic=3401.0 were you can see Silvercap's comments:

Quote
The script do a linear fit between Red and Ha, then do the Vicent Peris pixelmath's with a little diference, in a third step the script do a max between original Ha  and recombined HaR. Yes, I add Ha to Red.

And you are right, it does not have the denoise, neither the repeated process that Vicent mentioned. But - frankly- I do not think that there is a final method, everything is under investigation. Meanwhile this script does a decent job.

BTW all the job is done from the line that says

Code: [Select]
this.Calculate_NBRGB = function() {
up to the line that says (excluded) :

Code: [Select]
this.showNBRGB = function() {
all the pixelmaths are there (I'm not giving line numbers because the version I have on my laptop is heavily modified - when I have free time I'm trying to clean it up and improve it).

Title: Re: HaRGBCombination Script
Post by: mattssporre on 2013 October 17 01:51:58
Thanks for answering Ioannis,

I agree the script does a good job, but I notice changes in star color. If I only add Ha to the red channel the star color changes are subtle but they are there. If I do a "full add", ie also O3 and S2 data the star colors def change (could also be due the ambiguity with how to add O3 and S2 data).

One of the "promises" of Vicents method was to preserve star color (as well as star brightness) so that is why I am trying to understand it.

BR
Matts
PS thanks for modifying this script it is def easier than "fooling" the HaRGBCombination script by swapping channels :D
Title: Re: HaRGBCombination Script
Post by: Ioannis Ioannou on 2013 October 17 02:39:12
One of the "promises" of Vicents method was to preserve star color (as well as star brightness) so that is why I am trying to understand it.

Of course you realize that all these are tabula rasa and we just playing with them.
As I understand "Vicent's method" is still under investigation.
This script is better described as "Silvercup's method" ;)
Title: Re: HaRGBCombination Script
Post by: Ioannis Ioannou on 2013 November 26 01:31:23
Hello to everyone,

Business and personal issues kept me out of the hobby for long, but recently I had a bit of free time. I tried to process a few of the images I got during summer holidays ( :sad: ) , which of course reminded me that I have neglected this script.

So, here it is , version 1.6. Please test for bugs (none that I know  ;) )
Mainly cosmetics and code cleanup, trying to address (most of) Juan's recommendations.
Installation as usual, ie save/extract to your favorite folder, Script -> Future Scripts -> Add (your folder) and then you will find it in Scripts -> Utilities
 
Juan, take a look please, I think it may be ready for 1.8.
Title: Re: HaRGBCombination Script
Post by: vicent_peris on 2013 November 26 10:12:18
As I understand "Vicent's method" is still under investigation.

Vicent's method does not exist. In the Munich workshop I showed 7 different approeaches to HaRGB combination. Image processing is all about improvisation with good fundamental knowledge and a good eye to see what's happening in the image.


V.
Title: Re: HaRGBCombination Script
Post by: Harry page on 2013 November 26 12:12:17
Hi Vicent

I believe this script was originally based on the Method you kindly shared with me a few years ago

So its all "yours"   8)

Harry
Title: Re: HaRGBCombination Script
Post by: Harry page on 2013 November 26 12:38:53
Hi

I have had a quick go with some Ha and RGB ( all I have ) and it seemed to work very well  :-* and looks tidy

See what others think

Harry
Title: Re: HaRGBCombination Script
Post by: chris.bailey on 2013 November 26 13:07:07
We all know whose method it was  ;D

Yep, seems to work very well!
Title: Re: HaRGBCombination Script
Post by: vicent_peris on 2013 November 26 15:33:20
Hi,

I only say that any image needs a custom workflow, just don't take any of my techniques/articles as a recipe because it will not fulfill your needs in most of the cases.

V.
Title: Re: HaRGBCombination Script
Post by: mads0100 on 2013 November 26 17:36:46
As I understand "Vicent's method" is still under investigation.

Vicent's method does not exist. In the Munich workshop I showed 7 different approeaches to HaRGB combination. Image processing is all about improvisation with good fundamental knowledge and a good eye to see what's happening in the image.


V.

Do you have videos of the talk?  I'd love to understand what's going on better.

Chris
Title: Re: HaRGBCombination Script
Post by: vicent_peris on 2013 November 27 06:58:30
Hi,

No, the workshop was not recorded. But new workshops are coming. :)


Best regards,
V.
Title: Re: HaRGBCombination Script
Post by: Ioannis Ioannou on 2013 November 30 11:01:40
New version, V 1.7. Mostly cosmetics again, trying to address all of Juan's suggestions. Some code cleanup and minor bug corrections.

BTW, the script is general. It will be interesting if there are different pixelmath methods, to have the ability to select which method will be used.

Title: Re: HaRGBCombination Script
Post by: mads0100 on 2014 February 28 04:02:48
Perhaps, just like Warren and crew, you should start video taping them and making them available online for a fee.


Title: Re: HaRGBCombination Script
Post by: Ioannis Ioannou on 2014 February 28 04:10:18
Hmmm, interesting suggestion, but I'll refuse.
I'm making my living with other means.
For me this is just for fun.
Title: Re: HaRGBCombination Script
Post by: mads0100 on 2014 February 28 20:25:58
You could sell the rights to someone to produce the video using you as the expert ;)

And then we'd all benefit!

Title: Re: HaRGBCombination Script
Post by: Ioannis Ioannou on 2014 February 28 22:33:50
I'm not really interested, and frankly, I'm not an expert.

Ok, I guess this is long overdue, but since the released version complains for the lack of a license, and because I do not really like where this can finished, my preference is towards GPL. V2, V3, whatever. Silvercup ? Juan ?
Title: Re: HaRGBCombination Script
Post by: Juan Conejero on 2014 March 01 13:01:57
As long as it does not prevent us from releasing your script as part of the official PixInsight distribution, you can use any software license of your choice. GPL is no problem at all, either version 2 or 3. We already have several GPL'ed scripts in the distribution. Personally, I don't like GPL (I see open source as an option, not as an obligation), but you can use it without problems if you want.

Another possibility if our PixInsight Class Library License (http://pixinsight.com/license/PCL_PJSR_1.0.html) (PCLL), which is a liberal BSD-like license. This is completely up to you.
Title: Re: HaRGBCombination Script
Post by: Ioannis Ioannou on 2014 March 01 13:29:30
Usually I prefer GPL vs BSD-like licenses for code,  we have seen a lot of "bad" examples the last 20 years, that abused open source code with BSD licenses for commercial reasons ( I do not really want to go into this conversation, but I'm sure you know what I mean :sealed: ).

Nevertheless, this is not exactly "my" script, and I do not have a problem with a BSD-like license for this case. I took a look in PCLL and I think it is fine, actually more than ok for this case. So PCLL will be.

Cheers