StarHaloReducer Script

Silvercup

Well-known member
Hola a todos:

Por fin he terminado el Script para reducir halos en las estrellas: StarHaloReducer Script.

user_14_starhaloreducer_1253460241_752449.jpg


El script funciona creando varias m?scaras artificiales: una protege los bordes del preview, otra protege el corazon de la estrella,
otra enmascara el halo para poder modificarlo y por ultimo hay una m?scara que protege (resalta) las peque?as escalas detr?s del halo.

El script es muy intuitivo y como tiene un preview, vemos en todo momento lo que estamos haciendo. Para utilizarlo, creamos un preview centrado
en el Halo.

Si el halo y la estrella son concentricos ya podemos ejecutar el Script.

Si la estrella est? desplazada hacia un borde, antes de ejecutar el script debemos mirar en que posici?n del preview est? el centro
de la estrella para despues indicarlo en el script en los parametros Star Center X y Star Center Y.

Una vez ejecutado el script (e indicados los datos del centro de la estrella si fuese necesario) es cuesti?n de ajustar fundamentalmente
los parametros Luminance Value y Border Protection Value, hasta que veamos una reducci?n del halo evidente sin efecto ringing y que
case con el borde del halo. Podemos ajustar la proteci?n del coraz?n de la estrella con Star Protected Value para que no le afecte la disminuci?n
de luminosidad o de los canales RGB. Por ultimo, si el halo tiene debajo estrellas o estructuras peque?as podemos recuperarlas con Small Scales Protect Mask
e indicando el valor de proteccion con Small Scales Protected Value.



Al darle a OK nos saldr? una copia de la imagen principal con los cambios efectuados en el script y el mismo preview seleccionado por si queremos ejecutarlo una vez m?s.


El proceso se puede repetir cuantas veces sea necesario.




Os dejo el c?digo fuente. Espero que os sea de utilidad y que me digais si se puede mejorar algo o cualquier cosa que se os ocurra.

Un saludo. Silvercup.



Hello everyone,


I finally finished the script to reduce halos around stars: StarHaloReducer Script.

user_14_starhaloreducer_1253460241_752449.jpg


The script works by creating several artificial masks: one protects the edges of the preview, another protects the star core,
other masks the halo for editing and finally there is a mask that protects (highlight) the small scales behind the halo.

The script is very intuitive and has a preview to see what we are doing. To use it, create a preview with the halo centered.

If the halo and the star are concentric then we can run the script.

If the star is shifted to an edge, before running the script we should look the position of the star core in the preview
to indicate in the script parameters Star Center X and Star Center Y.

After you run the script (and the data indicating the star center if necessary) is fundamentally a matter of adjusting
Luminance parameters and Border Protection Value, until we see a reduced halo effect without ringing and
matching with the edge of the halo. We can protect the star core with Star Protected Value an the star will not be affected by the decrease
of brightness or the RGB channels. Finally, if there are stars or small structures beneath the halo we can recover it with Small Scales Protect Mask  
and indicating the value of protection with Small Scales Protected Value.


When OK is pressed we will obtain a copy of the main image with the changes in the script and the same preview selected so we can run the script again.


The process can be repeated as often as necessary.


I leave the source code. I hope it will be useful and tell me if I can do anything to improve it or anything you can think of.

Greetings. Silvercup.
 

Attachments

  • StarHaloReducer.js
    33 KB · Views: 154
Hi Silvercup.

A great looking script. I am very keen to try it out. I tried downloading the .js file and adding it into PI, but PI doesn't seem to 'see' it in the folder....even though I can see it with Windows Explorer. I have just added two other scripts off the forum using the "Feature Scripts" feature, so I know that is working fine. I have even tried re-downloading the file.

I wonder if there is some reason PI is not 'seeing' the .js file?

Cheers
        Simon
 
Hi Simon:

You must add this lines:

Code:
#feature-id Utilities > StarHaloReducer
#feature-info A simple script for reducing star halos.

\
   
\
   Copyright © 2009 Juan M. G?mez

But the script isn't part of PI platform officialy, so I don't put those lines.

Greetings, Silvercup
 
Hola Juan Manuel

Extraordinario trabajo. El script funciona realmente bien, y el algoritmo que has ideado es elegante y eficiente. Bienvenido al desarrollo de scripts en PixInsight  8)

Si no tienes inconveniente vamos a a?adir tambi?n este script al conjunto de scripts est?ndar en PI 1.5.8. Hay algunas cosas que he visto al vuelo. Una de ellas es que quiz? se podr?an usar textos m?s explicativos acerca de algunos par?metros. Por ejemplo, en vez de "border protection value" podr?amos poner "star mask diameter", que creo que se entiende mejor. D?jame echarle un vistazo m?s a fondo y pensar? en m?s sugerencias. Aparte de esto, en cuanto a mejoras en la usabilidad, vendr?a bien tener tool tips que explicasen los par?metros, al menos los m?s cr?ticos (por ejemplo, explicar que los par?metros "Center" est?n en coordenadas del preview, y cosas as?.

En cuanto a mejoras, se me ocurre la posibilidad de proporcionar una previsualizaci?n ampliada en el script (como opci?n). Tambi?n podr?a ser interesante poder controlar el grado de "softening" que se aplica a la m?scara. Iremos pensando en m?s cosas, pero desde luego es un trabajo excelente. Muchas gracias, y ?felicidades!  ;)


===============================


Hi Juan Manuel,

Outstanding work. The script works really well, and you've devised an algorithm that is both elegant and efficient. Welcome to PixInsight script development 8)

If you don't mind, we can add also this script to the standard set in PI 1.5.8. There are some things that I've seen on the fly. One of them is that perhaps we could use more explanatory texts about some parameters. For instance, instead of "border protection value" we could write "star mask diameter", which I think is more understandable. Let me take a more thorough look and I'll think on more suggestions. Besides that, concerning usability improvements, it would be convenient adding some tooltips to explain parameters, the most critical ones at least (for example, explaining that the "Center" parameters are in preview coordinates and the like).

Regarding functionality improvements, the script could provide a zoomed preview, as an option. Also interesting could be to provide control over the degree of softening that is applied to the mask. We'll be thinking on more improvements, but this is indeed an excellent work. Many thanks, and congratulations! ;)
 
Hi Silvercup,

Thanks for the info. I inserted the lines and it imported just fine. Its a really nice script. I love the slider bars working on the live preview...this really helps with tuning the parameters.

I'm not too sure of the convention here, but I would be really pleased if you put the extra lines in every sample script you did....I can add them and remove them from my Sample Script box whenever I want....but if they are all this good then they will be added and stay there! Well done.

I have a copule of simple questions about the script though....

Does it apply the halo reduction to all of the stars in the Parent Image, or just the brightest or largest ones? How does it determine which ones to apply it to?

Cheers
Simon
 
Hi, Simon:

The Script only manage one star halo, the one selcted by the preview. If there are more star halos you must run the script for every one. The script uses three concentric mask and they are individual for each star halo case.

As an example, I have slightly corrected Stephan's Quintet by Hubble in less that ten minutes:

user_14_hs_2009_25_x_xlarge_web_fa.jpg


Juan, I agree with your comments, there are some bugs too. For example, if you close de window script with the x button the images used by the script don't close.

Greetings. Silvercup.
 
Hi Silvercup,

Wow, that is really cool. So this effectively lets me say "I'll just select that star there for halo reduction" by putting a small preview over it and applying the script to that preview. And repeating this process for the five big blobby stars in my image.

So is it just looking at the brightest / largest star in the preview? In other words, how does it know which one to choose?

Cheers
        Simon
 
Hola Silver.

Tengo algun problema con el script. En cuanto intento ajustar el primer par?metro, sea cual sea, el cuadro del preview experimenta un aumento brutal de luminosidad que no hay forma de corregir. Y de ah? no paso...

Saludos
 
I have also seen this problem.....the first slider that I touch results in the preview region turning almost black and it is stuck like that for the rest of the session. It is an intermittent problem, because I have tried it the next day and it was fine. Intermittent problems are always the worst to track down!

I really like this script but I'm having great trouble using it. The problem is that the image at the top of the process window (the short wide preview) is a bit too small for me to judge whether I am tweaking the parameters correctly. It would be good if the image could be quite a lot larger and much closer to a 1:1 aspect ratio....prefereably equivalent to the Preview that is defined.

Cheers
        Simon
 
Hola Ignacio:

Voy a bajarme la ultima version del pixi a ver que ocurre. Tengo la versi?n anterior y el script responde perfectamente a los ajustes.

Me acabo de bajar el PI 1.5.9 y a m? el script no me da problemas. Uso Vista 64 bits. Tengo que probarlo con m?s im?genes. Es algo raro lo que te pasa Ignacio.

Simon:

You can change the preview's size editing the line no. 1195 width the script editor:

Code:
this.setMinSize(600,150);

Change the 150px height width a value that ajust to your screen.

Code:
this.setMinSize(600,250);




Un saludo
Silvercup
 
Pues yo voy con la 1.04.09.0553 eng (X86) y no puedo bajarme nada nuevo. Como mucho podr?a reinstalar pero poco m?s.
El caso es que he pensado como has hecho tu la prueba y he deducido que has abierto PI, luego una imagen y finalmente te has puesto a probar el script. Pues exactamente como comentas, el script va perfecto. El problema por lo que veo viene cuando has estado previamente procesando. Debe haber alg?n conflico con la memoria de alguna otra herramienta o alguna cosilla de esas.
De todas formas ya aprobecho para agradecerte el trabajo con este script. Mis halos son bastante molestos y muy frecuentes as? que me viene de lujo.

Saludos
 
I am have trouble get a good result back ground comes out black. I have a beta version it does not have a background adjustment.

Max
 
Since this script can be used recursively, is there a way to keep it on screen between executions.  I haven't got the hang of it yet, my star has artifacts remaining from the (reduced) halo but my star image is bloated. I then have to select Script/Utilities/StarHaloetc and the parameters I used have been reset to the defaults.

Charles
 
Back
Top