Author Topic: How to create binary rectangular mask  (Read 2941 times)

Offline sixburg

  • Member
  • *
  • Posts: 63
How to create binary rectangular mask
« on: 2013 October 30 17:01:57 »
There is an old post by Juan that discusses mask create via pixel math but the embedded links / pictures / formulas aren't there any more.  Does anyone know the answer to this (and to that original) question?

Offline oldwexi

  • PixInsight Guru
  • ****
  • Posts: 627
    • Astronomy Pages G.W.
Re: How to create binary rectangular mask
« Reply #1 on: 2013 October 31 06:53:37 »
Hi Sixburg!
one of the ways to create a rectangular mask is:
Clone your image,
load PixelMath process, write 0 (Zero) in the top line and drag the triangle
over the clone image. This results in a black image.

Then create a preview in the original image with your mouse, resize and move it
whereever you want to have it.

Than start the script: SubstitutewithPreview,
in the Source line you enter the imagename where the preview is located
in the Target you enter the name of the black image.
press ok

So you get a black image with your rectangle. Either you use the
rectangle that way or soften it with RangeMask,
or set it to binary white with PixelMath using the expression:
iif($T > 0, 1, $T) or set it to gray by using PixelMath with
iif($T > 0, 0.5, $T)

Hope this helps

Gerald

Offline Alejandro Tombolini

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1267
    • Próxima Sur
Re: How to create binary rectangular mask
« Reply #2 on: 2013 October 31 20:16:54 »
Hope this helps
Thanks Gerald, your informacion always helps!.

Saludos, Alejandro.

Offline sixburg

  • Member
  • *
  • Posts: 63
Re: How to create binary rectangular mask
« Reply #3 on: 2013 November 03 13:26:05 »
Thanks as well!  This worked like a charm.