Author Topic: Colour Mask Script  (Read 2080 times)

Offline Ryderscope

  • Member
  • *
  • Posts: 74
Colour Mask Script
« on: 2018 June 28 18:16:48 »
I am trying to use the colour mask script to treat blue halos around stars in a narrow band image of NGC 6188. I've used this technique successfully before but I have noticed something in the process that I don't understand.

For this image I am trying to be quite specific about the hues that I want to modify to remove the blue halo. I have measured them with the readout probe which shows the blue halo to have a hue of around the 200 - 220 mark. When I select the default 'Blue' setting in the colour mask script (Hue range of 180-300) it correctly selects the blue halos. However, if I try to be more specific and select a halo range of 200-220 the script is not picking up the blue areas. I have tested this using a number of settings and find that I need to set the tool to a hue range of 260-300 to select the blue halos properly.

The attached image is a snapshot of the PI desktop which demonstrates the output of my testing. I have a preview of a small area of the image showing a star with the classic blue halo. The blue area around the star is in the hue range of 200-210. The orange area surrounding the star is in the hue range of 16-20. I then show a number of outputs from the CM tool with the hue settings. The other CM script tool settings that I used were: Chrominance Mask; Mask Strength 1.0; Mask blur: 0.

My assumption is that to pick up the specific blues that I am after I should be setting the tool to a hue range of 200-210 but I seem to need to set it to 260-300 to capture this. I can work around this for now but I am curious to know the answer as it would help me to improve my understanding of the operation of the script.

Links to images and attachments follow.






Offline msmythers

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1178
    • astrobin
Re: Colour Mask Script
« Reply #1 on: 2018 June 28 22:21:58 »
I'm not sure what is going on with yours but let me show and explain what I did. First I simply cropped your image to remove all the masks, just to be clear. I did nothing else to the image. I set my Readout Data to CIE L*c*h* and made sure that the Readout Mode is Mean.

My screenshoot left to right top to bottom.
We have the image I find the lightest color of interest which has a hue of 213. Next I look for the darkest and that is 267. I apply those numbers to the ColorMask Script. My mask has holes so my nunbers were not correct.
The bottom row. I apply the new color mask to the image, invert and look at the hue values in the open sections. I then set the color mask tool with the new number of 271+1. The +1 is just to make sure I didn't miss anything. And there is the new mask.

I always start with no values in the tool. Don't preset to blue or red or whatever color unless you plan on using that preset setting. It's just a habit I got into a long time ago.

I hope that helps.

Mike
« Last Edit: 2018 June 28 22:40:20 by msmythers »

Offline Ryderscope

  • Member
  • *
  • Posts: 74
Re: Colour Mask Script
« Reply #2 on: 2018 June 29 01:05:19 »
Thanks for your prompt response Mike. The difference that I am seeing is due to the fact that I had set my read out data to HSV as opposed to  CIE L*c*h* which you have indicated in your example. I was of the understanding that the 'H' or hue on HSV would be the same as the h* in L c* h* but this appears to not be the case. If I use the h* readout option then the colours do line up with the colour mask script.  I now need to understand why this is so and what the numbers in the HSV read out panel mean. More research is indicated here so I shall press on.

Cheers,
Rodney
« Last Edit: 2018 June 29 01:18:49 by Ryderscope »

Offline RickS

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1298
Re: Colour Mask Script
« Reply #3 on: 2018 June 29 04:28:19 »
Hi Rodney,

CIELAB L*c*h* is a true colour space and is what the ColorMask script uses to define hue values.  HSV is not a colour space, but a transformation of an underlying space.  I'm not sure how PI implements this (whether it assumes some specific underlying colour space or uses the profile attached to each image, or something completely different) but whatever it does the hue values in HSV are not the same as CIE h*.

Cheers,
Rick.

Offline Ryderscope

  • Member
  • *
  • Posts: 74
Re: Colour Mask Script
« Reply #4 on: 2018 June 29 04:40:28 »
Very good, thanks Rick - it was becoming apparent that this was the case. I knew that it was worth pursuing the query because I would learn something new in the process.

Thanks again,

Rodney