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

Offline calan

  • Newcomer
  • Posts: 34
    • View Profile
Re: New script: ColorMask
« Reply #90 on: 2017 April 17 06: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 Guru
  • ****
  • Posts: 681
    • View Profile
Re: New script: ColorMask
« Reply #91 on: 2017 April 17 08: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: 3
    • View Profile
Re: New script: ColorMask
« Reply #92 on: 2017 June 07 22: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 Council Member
  • *******
  • Posts: 3081
    • View Profile
Re: New script: ColorMask
« Reply #93 on: 2017 June 07 23: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 Guru
  • ****
  • Posts: 714
    • View Profile
    • My Astrobin page
Re: New script: ColorMask
« Reply #94 on: 2017 June 08 02: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 Guru
  • ****
  • Posts: 681
    • View Profile
Re: New script: ColorMask
« Reply #95 on: 2017 June 08 02: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 Guru
  • ****
  • Posts: 681
    • View Profile
Re: New script: ColorMask
« Reply #96 on: 2017 June 08 03: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 Guru
  • ****
  • Posts: 714
    • View Profile
    • My Astrobin page
Re: New script: ColorMask
« Reply #97 on: 2017 June 08 03: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 Guru
  • ****
  • Posts: 681
    • View Profile
Re: New script: ColorMask
« Reply #98 on: 2017 June 08 03: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 Guru
  • ****
  • Posts: 714
    • View Profile
    • My Astrobin page
Re: New script: ColorMask
« Reply #99 on: 2017 June 08 03: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: 246
    • View Profile
Re: New script: ColorMask
« Reply #100 on: 2017 June 17 03:19:42 »
I wonder what's going to come first - PI 1.8.5 or ColorMask 1.0? :P

Offline RickS

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 681
    • View Profile
Re: New script: ColorMask
« Reply #101 on: 2017 June 17 03: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
    • View Profile
Re: New script: ColorMask
« Reply #102 on: 2017 June 22 16: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 Guru
  • ****
  • Posts: 714
    • View Profile
    • My Astrobin page
Re: New script: ColorMask
« Reply #103 on: 2017 June 22 17: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