Mask doesn't prevent stars from being rescreened in protected portion of image

Hi Adam,

I'm trying to put extracted stars back only into the unprotected portion of a masked image.  Using any of several techniques (adding two images together in PM, using the combine(), or using the star rescreening expression) the mask doesn't seem to prevent the stars from being put back into the protected portion of the image.  Both images, starless and stars, are nonlinear.  The mask is enabled, and I can see where the mask should be protecting the image when I show/hide the mask.

The starless image was saved as a TIFF file, brought into Photoshop, and then back into PixInsight.  Since I thought this might be causing a problem, I tried the same thing with an XISF starless image that hadn't been converted to a TIFF or brought into Photoshop, but after rescreening the stars still appeared in what should have been the protected portion of the image.

If I create a mask and do anything else to the same image into which I'm trying to rescreen the stars, e.g., curve manipulation, convolution, etc., the mask works exactly the way it's supposed to and protects the portion of the image I had protected with the mask.   Since I thought it might be the method I was using to extract the stars with StarXterminator I tried generating a star image with and without the rescreen checkbox checked, but got the same result, i.e, stars were put into what should have been the protected portion of the image.

I was hoping you (or one of your members) had run across this problem or a similar one in which a mask was not working and could give me some advice about what to try next, or what I might not be doing correctly.

Thanks so much. 

Greg

Comments

  • Greg,

    Some screenshots would be helpful showing the issue.

    1. You need to make certain the mask is the correct color. Are the stars in your mask black?
    2. You need to make certain the mask is NON-Linear. This is a very common error.
    3. Not all scripts honor masks (most do).
    4. Pixel Math honors masks.
    5. The Tif/XISF format does not matter. 

    What you do think? Should I keep my day job?

    -the Blockhead
  • Thanks for the reply, Adam.

    I'm not sure I explained what I'm trying to do (or perhaps I am not interpreting your responses correctly).  I attached a screenshot of what I'm trying to do.

    Hopefully, the image I attached is sufficient to explain the process I'm using.  In the result of the rescreening, the stars are still appearing in the protected areas. Perhaps I'm not applying a mask in the correct way. 

    I hope this clarifies a bit.  Thank you again!

    Greg
    ProblemRescreeningStars_PixInsight_Markup.jpg
    2225 x 1378 - 626K
  • Update:

    After experimenting a bit, I found that if I Create a New Image with PixelMath or with the ScreenStars script, the masking doesn't work.  I have to check Replace target image and then the masking works. 

    Not sure why this is, but this is apparently my solution.  Is there a way to Create a New Image and still have the mask applied, Adam?

    Thank you again!

    Best,
    Greg
  • Correct, new image would not work. You need to replace pixels on an image that has a mask. 
    The create new image would not see the mask. Think of a mask as an extra "channel" of an image. Creation of new images ignore extra channels.


    -the Blockhead
  • Ah, I understand!!  Thanks again, Adam.

    Best,
    Greg
  • edited August 2024
    The work around to create a new image is to clone the original image first, then apply the mask to the clone and then apply PixelMath/ScreenStars to the clone.
Sign In or Register to comment.