Author Topic: New script: ColorMask  (Read 81941 times)

Offline calan

  • Newcomer
  • Posts: 34
Re: New script: ColorMask
« Reply #90 on: 2017 April 16 23:13:30 »
Thanks so much for this script.  ;)

I notice that with strength set to 1 (or even .75), I'm picking up "color" in unexpected areas, and at a value of zero I get nothing. What is a good value to set the strength to normally, and what was the intended use for it...since you can define the target with the hue sliders?

Any updates on when it will become a process?

Thanks again!

Offline RickS

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1298
Re: New script: ColorMask
« Reply #91 on: 2017 April 17 01:58:04 »
Thanks so much for this script.  ;)

I notice that with strength set to 1 (or even .75), I'm picking up "color" in unexpected areas, and at a value of zero I get nothing. What is a good value to set the strength to normally, and what was the intended use for it...since you can define the target with the hue sliders?

Any updates on when it will become a process?

Thanks again!

Glad to hear it is useful to others.  I use it a lot in my processing.

The Mask Strength parameter defines how strongly the mask matches hues as they move away from the midpoint of the range.  With a strength of 0.5 the mask strength decreases linearly between the midpoint and endpoints of the hue range (from 1 at the midpoint to 0 at the ends.)  For values > 0.5 you get a mtf() curve that is stronger and for values < 0.5 it is weaker.  mtf() is defined in the documentation for HistogramTranformation and the x parameter is 1-mask_strength.

I mostly use the mask strength at the default of 1 and set the start and end hue points carefully, but occasionally I set a wider range of hues and set the mask strength to have less influence away from the midpoint.  It depends on what you are trying to achieve - a strong effect over a range or a diminishing effect at the edges.

If you are picking up "color" in areas you don't expect it then I suspect you need to adjust the range of hues.  Use ReadoutOptions with CIE L*c*h* mode to probe with the cursor in the areas of interest and look at the h* values.

My C++ skills are pretty rusty so I don't see me having the time to convert ColorMask to a process any time soon though it would be nice to have dynamic previews.  Perhaps when I retire :)

Cheers,
Rick.

Offline jlmanatee

  • Newcomer
  • Posts: 8
Re: New script: ColorMask
« Reply #92 on: 2017 June 07 15:24:39 »
I must admit to being a neophyte to understanding masks, so please bear with me.  In v0.7 of this excellent script, the mask references have changed to chrominance, lightness,  and linear.  In the older versions, they were known as binary, lightness, linear and curved.  I'm trying to follow the original instructions.  How do the older mask names correspond to the newer mask names? 
  Also, I understand what is being accomplished by the magenta mask to decrease magenta star halos and the  green mask to decrease green.  In both cases, I assumed the mask is inverted to protect everything but those colors.  But I'm confused by the cyan mask.  Is it applied to protect anything cyan (thus not inverted)?  Or is employed to provide for pushing up red and blue in areas that are already cyan (thus inverted).  I assumed the mask was not inverted.  But my results have not been as I thought they might be in obtaining Hubble pallet colors I was going for (on IC 1396).  Any advice is much appreciated.  The attached files are before/after.  The before is an HT stretch of a simple SHO combination

 

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4729
Re: New script: ColorMask
« Reply #93 on: 2017 June 07 16:10:50 »
you want to expose the cyan areas so you can modify the color from cyan to more of a blue.

i usually use chrominance mode. i think rick would have to give the definitive word on how to map the old names to the new; i think chrominance is probably "curved" and binary was dropped but don't quote me on that.

rob

Offline msmythers

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1178
    • astrobin
Re: New script: ColorMask
« Reply #94 on: 2017 June 07 19:51:33 »
I made a screen shoot of the various versions and posted it a couple of pages back in the thread. There is a little explanation of some of the features within the script tools themselves. I remember somewhere Rick explained everything but I that might have been updated as the versions changed. Anyway here is that screen shoot. Maybe this will help. I don't know if Rick ever released a v0.1 , v0.4 or v0.5.

For myself I found the curved mask added complexity that I rarely if ever really needed. For me it was also trial and error. The problem which isn't a negative was that you had to setup a start, mid and ending hue. This set where the curve center point was going to be. This allowed for a possible great slope to one side of the curve if needed. Then you had to decide which direction the curve needed to be. Great control but maybe a bit much for most cases. The chrominace mask I believe is curvature mask with fixed centered midpoint. These are just my observations.

The binary mask was one I never really needed also.

For targeting a very specific color range the chrominance mask is what I use probably 95 percent of the time. The other 5 percent I use the RangeSelection tool.

For what it's worth, this tool is one of those I would sorely miss if I did not have PixInsight. I use it with standard daytime images for fine color corrections.


Mike

Offline RickS

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1298
Re: New script: ColorMask
« Reply #95 on: 2017 June 07 19:58:58 »
The colour range you select is what the mask exposes.  A magenta mask exposes the magenta areas and a cyan mask exposes the cyan areas.  If you want to adjust the cyan areas just create a cyan mask, apply it and go for it.  If you want to adjust the areas that aren't cyan then use Invert Mask.

The original mask types were Binary (any pixel in the colour range gets a mask value of 1), Lightness (any pixel in the colour range gets a mask value that is the CIE L* value of the pixel), Linear (any pixel in the colour range gets a mask value that starts at 0 near the edges of the colour range and ramps up linearly to 1 at the midpoint of the range), and Curved (same endpoints as linear but the ramp is slow or fast depending on the curvature.)

After using ColorMask a fair bit I found that what I mostly wanted was a mask that was stronger when the colours were stronger, so that's where the Chrominance mask came from.  The mask exposes areas of high chrominance more than areas of low chrominance.

In the latest version of ColorMask I removed the Binary mask since it didn't seem to be very useful.  Lightness is unchanged and Linear is still there.  A Curved mask can be created by adjusting the Mask Strength of a Linear mask, but Mask Strength is now a parameter that can be used with all mask types.

In practice I use a Chrominance mask 95% of the time.

Cheers,
Rick.

Offline RickS

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1298
Re: New script: ColorMask
« Reply #96 on: 2017 June 07 20:06:14 »
I made a screen shoot of the various versions and posted it a couple of pages back in the thread. There is a little explanation of some of the features within the script tools themselves. I remember somewhere Rick explained everything but I that might have been updated as the versions changed. Anyway here is that screen shoot. Maybe this will help.

Thanks, Mike.

I don't know if Rick ever released a v0.1 , v0.4 or v0.5.

There were some intermediate versions that I don't think I released.  0.7 is the one that incorporated most of the feedback I received (at least all the easy stuff!)

For myself I found the curved mask added complexity that I rarely if ever really needed. For me it was also trial and error. The problem which isn't a negative was that you had to setup a start, mid and ending hue. This set where the curve center point was going to be. This allowed for a possible great slope to one side of the curve if needed. Then you had to decide which direction the curve needed to be. Great control but maybe a bit much for most cases. The chrominace mask I believe is curvature mask with fixed centered midpoint. These are just my observations.

Agree it was too complicated and the extra stuff didn't add much value.

For targeting a very specific color range the chrominance mask is what I use probably 95 percent of the time. The other 5 percent I use the RangeSelection tool.

For what it's worth, this tool is one of those I would sorely miss if I did not have PixInsight. I use it with standard daytime images for fine color corrections.

Interesting that I independently came up with 95% and glad to hear it is useful for daytime images as well!

Cheers,
Rick.

Offline msmythers

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1178
    • astrobin
Re: New script: ColorMask
« Reply #97 on: 2017 June 07 20:08:24 »
Hi Rick

How does the mask strength curve the mask? The original had curvature slider with the center position between concave and convext. Is this a different curve now?


Mike

 

Offline RickS

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1298
Re: New script: ColorMask
« Reply #98 on: 2017 June 07 20:23:29 »
How does the mask strength curve the mask? The original had curvature slider with the center position between concave and convext. Is this a different curve now?

Mike,

It's the same mtf() function being used but I reversed the sense.  A strength of less than 0.5 is concave and greater than 0.5 is convex.  I thought it was easier to understand that a strong mask selects the edges of the colour range more strongly and a weak mask less strongly.

In retrospect, I should have had a beta program for the script and released it when it was a bit more polished  ;)

Cheers,
Rick.

Offline msmythers

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1178
    • astrobin
Re: New script: ColorMask
« Reply #99 on: 2017 June 07 20:59:14 »
Seems very shiny to me.

I always looked at scripts and modules that we have to add ourselves as beta. They graduate from beta status once they're part of the standard distribution.



Mike

Offline troypiggo

  • PixInsight Addict
  • ***
  • Posts: 258
Re: New script: ColorMask
« Reply #100 on: 2017 June 16 20:19:42 »
I wonder what's going to come first - PI 1.8.5 or ColorMask 1.0? :P

Offline RickS

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1298
Re: New script: ColorMask
« Reply #101 on: 2017 June 16 20:52:29 »
I wonder what's going to come first - PI 1.8.5 or ColorMask 1.0? :P

The only things left on my to-do list are the difficult items and I'm about to go on a business trip, so I'd be putting my money on PI 1.8.5  :P

Offline btuttle

  • Newcomer
  • Posts: 1
Re: New script: ColorMask
« Reply #102 on: 2017 June 22 09:57:52 »
I'm a brand new newbie to PI and the forum. I would like to download the New script: ColorMask, but for the life of me, can't figure out where the link is, although it is in front of my face.
Thanks for help
Bruce

Offline msmythers

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1178
    • astrobin
Re: New script: ColorMask
« Reply #103 on: 2017 June 22 10:03:37 »
Bruce

First page of this posting. At the bottom of the first section by Rick there is a paperclip. That is the script.



Mike

Offline Andres.Pozo

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 927
Re: New script: ColorMask
« Reply #104 on: 2017 August 06 10:01:11 »
Hi Rick,

I am trying to use the ColorMask script, but I get strange results. It seems that the masks don't select the desired colors.

I have generated a pair of synthetic images trying to understand the behavior of the script. The test images are generated using ChannelCombination from monochrome images. The first has the values L=0.5, c=0.5, h=[0..1] and the second L=0.5, c=1.0, h=[0..1]. I have generated masks for the six predefined colors and the masks don't seem to fit the colors. It seems that the ranges of the predefined colors are not right.

I don't know if I am doing something wrong or if there is an error in the scripts.

Andrés.