New MaskedStretch Tool

Ghsmith45

Well-known member
Mar 3, 2012
923
7
Sydney, Australia
cdesselles said:
Geoff:  Have you tried sstretching without using the new tool to see the difference?  Just curious.
Yes. While I get a better stretch in the main feature (galaxy, nebulosity), the stars do seem sharper with a more conventional stretch.
 

Juan Conejero

PixInsight Staff
Sep 2, 2004
8,380
467
57
Valencia, Spain
pixinsight.com
Geoff said:
One thing I have noticed is that using the masked stretch can soften and slightly blur the edges of the stars.
The MaskedStretch algorithm is a point operator. This means that neighbor pixels are not correlated by MS, so there's no way it can blur the image.

IMO, we are all heavily accustomed to nearly-saturated stars. This is just because of the tools and algorithms that we have been applying to stretch images for many years. However, hard star edges should be considered artifacts because they denote data losses caused by deficient handling of bright image features, just as ringing artifacts for example.

The MS algorithm generates much better star profiles because it protects the highlights from excessive amplification. Your image is an excellent example:

http://www.astrobin.com/76328/

The stars are very nice in this image. They have soft profiles, which allows them to show different star colors with good color saturation. Since the stars have been protected by MS, they have moderate lightness levels that leave room for chroma components to vary across a wide range of hues.
 

Ghsmith45

Well-known member
Mar 3, 2012
923
7
Sydney, Australia
Thanks Juan for your nice comments about the stars. On rethinking, i can appreciate that this is the way stars should look. A hard edge doesn't fit well with the usual bell-shaped curve expected of a typical star profile. As you say, we come to accept wrong things as normal because we see so many examples.
Geoff
 

topboxman

Well-known member
Mar 11, 2012
294
1
Reno, NV
peternagy.smugmug.com
When is the best time to use Masked Stretch. This is my typical flow:

1) Dynamic Crop
2) DBE
3) BN
4) CC
5) MMT to reduce noise while image is still linear
6) HT
7) HDR
8: LHE
9) ACDNR
10) Curves Transformation
11) UnSharp Mask

Would Masked Stretch be used after step 5? Is Masked Stretch best use on linear images?

Thanks,
Peter
 

topboxman

Well-known member
Mar 11, 2012
294
1
Reno, NV
peternagy.smugmug.com
How about tweak with HT after Masked Stretch or anywhere else during post processing of non-linear image if necessary?

So, Masked Stretch is supposed to be some kind of alternative to HT?

I will play with Masked Stretch on some of my old images and compare with HT.

Thanks,
Peter
 

sreilly

Well-known member
What I've found for my images, and this is personal taste, is usually using a background image and a setting of 0.09. If this seems too different than what I'd like I experiment between that and 0.14. Regardless I usually find that I'll followup with a curves stretch to increase contrast which is what I usually do after using the Histogram Stretch tool as well. For my luminance after calibration, alignment, stacking, crop, dbe as needed (almost always), I'll do a masked stretch with a sampled background (preview) void of stars and object, HDRW, maybe an unsharp mask, masked Local histogram stretch, and then a final curves adjustment. If I have enough data I usually don't need any noise reduction (in my opinion) but even still I would combine with my RGB image before and see how the result looks. What I have found in PI is usually to get an appealing L+RGB image (again personal taste) I usually need a darker than I would normally do luminance background. If and when we get layering in PI this would be a bit easier by adjusting the opacity of each layer. After the final image is made I'll look at possible noise reduction. I try to stay away from this process as I usually see the final image blurring the sharper details but then it may be my use of noise reduction and I'm doing it wrong.

The only real difference when creating the RGB image is I add the background neutralization and color calibration after DBE. Most everything else follows except the HDRW on the RGB data unless there is no luminance for that image. Then a dynamic align (I bin my RGB 2x2 and Lum 1x1) and use LRGB Combination to create the L+RGB image. Then maybe noise reduction if needed.

But then again there are far better PI processors here than me but this is my basic routine.

-Steve
 

Warhen

PixInsight Ambassador
Yes, yes Torsinadoc! This is what I see consistently. I'd talked privately with Carlos some about this but never did show you an example Carlos. I Do like MaskedStretch. I Do now agree that loss of contrast (compared w/ HT) can be recovered sufficiently w/ Curves or LHE. What I Can't seem to make work is combining L w/ RGB, without that star artifact. Any thoughts Juan/Carlos?

If I use HT for L but use MaskedStretch on RGB it occurs at LRGBC. If I MS both and then combine, I don't like the result. If I try to combine while still linear, doing one MS afterward, I get an usable result. Any suggestions? Thanks all!
 

Carlos Milovic

Administrator
Sep 2, 2004
2,172
1
Santiago, Chile
www.astrophoto.cl
Have you tried the ImportL process in my development set? It uses a different strategy to import lightness, modifying the RGB channels depending on both the old and the new lightness. This is used in HDR processing, to account for the strong data compression, to retain original colors.
 

Alejandro Tombolini

PixInsight Ambassador
Torsinadoc said:
As you can see below, I get an odd coloration of a star.  I tried several settings but not sure how to avoid this?
Hi Torsinadoc,

I think that there are two alternative to solve it. The main is to have data that allow make a HDR, and the second is to repair the stars.
I do not have a good set of image to make an example with HDR but I am just processing an Antares that is useful to show the reparation.



First I have applied Masked Stretch tool to a crop of the image with Antares using the default values. As expected the center of the star does not look fine.



Over a clone of the linear image apply the Repaired HSV Separation script. Set the desired levels to Clip Shadows and Repair level and check V- no repairs for the scrip to generate also the Unrepaired V



You will get four new images:
Unrepaired V
V
Sv
H



I have seen in some cases that is better to generate the new image using the Unrepaired V instead of V. Using channel Combination tool generate the new image.



The center of the stars look better now in the linear image:



Finally apply the same Masked stretch process to the repaired image.



I also recomend that you see Bob Andersson post about this script.

Saludos, Alejandro.