Author Topic: Drizzle is causing a brightness shift  (Read 2612 times)

Offline samueljohnchia

  • Newcomer
  • Posts: 3
Drizzle is causing a brightness shift
« on: 2017 May 10 16:07:59 »
Hi everyone, I'm just starting out in astrophotography and recently made my first real exposures of the night sky. Coming from Singapore, it was immensely humbling to see the night sky for the first time in a place with so little light pollution. After trying out Deep Sky Stacker and ImagesPlus (Roger Clark of clarkvision.com favourite tools), I encountered a great deal of frustration with broken color management, file format issues, poor star alignment and sub-par interpolation for resampling. I just received a trial version of PixInsight and I must say I am extremely impressed thus far. I've only explored it a little bit (alignment, integration and drizzle), and I still have much to learn about astrophotography image processing.

I have a problem with the drizzle function at the moment. It is causing the image's brightness to shift to a darker tone, while the color more or less remains similar. Is there a way to prevent this? Perhaps turn off any normalization or scaling to prevent this?

When using ImageIntegration, I turn off all normalization and scaling to preserve the original brightness and color from getting shifted. I read about this in Roger Clark's articles, which seem to be very, very good. He is adamant against any channel scaling, which he says ruins star colors and to restore those colors perfectly later is difficult to impossible, and invariably causes more noise to be visible from added image processing. He recommends PixInsight users to turn off any normalization. I read on the PixInsight website that in fact normalization is especially necessary for pixel rejection, for meaningful statistical rejection. It sounds perfectly logical to me. I understand PixInsight is not doing per channel scaling causing colors to shift, but performing an overall scaling adjustment so the luminance remains more constant between images. In my Lights exposures, there were no clouds at all and the illumination levels were very constant, so I see no difference with normalization turned on or off for ImageIntegration, which seems logical too. Please correct me if I am wrong. In my exposures for the landscape, I was a little late and was shooting in astronomical to nautical dawn, so each exposure was slightly brighter as time passed. I tried my best to manually normalize them in my raw converter, but it was not perfect, and thus leaving normalization on caused relatively large brightness shifts between the final stacked results, which proved disastrous for stitching later. Turning off normalization resulted in virtually no brightness shifting and my panorama was saved.

I've tried looking for such a setting in DrizzleIntegration, but to no avail. I had thought turning off 'Enable Image Weighting' would solve it, but it didn't. I ended up with exactly the same (darker) result. Please see the attached image example, which shows one of the light frames on the left, and a regular integrated stack in the middle (exactly the same except for better S/N), and the darker result with drizzle integration on the right. I understand what is causing this brightness shift. I greatly appreciate any advise. Thank you!

Offline RickS

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1298
Re: Drizzle is causing a brightness shift
« Reply #1 on: 2017 May 10 17:58:33 »
Is this linear, i.e. unstretched, data with a screen stretch applied?  The screen stretch calculated by ScreenTransferFunction depends on statistical properties of the image, so it is likely to apply a different stretch to the drizzled image.  Try applying exactly the same stretch to the undrizzled and drizzled data and see if you get more similar results. An easy way to do this is to drag the screen stretch parameters from obe of your images to the HistogramTransformation process and then apply to both images.  Here's an excerpt from the STF reference doc that describes how to do this:

Quote
You can drag a STF instance to the control bar of the HistogramTransformation tool window, and the HistogramTransformation tool will import its histogram parameters from the STF instance. When the STF instance defines the same parameters for the three RGB channels, HistogramTransformation will import them in its RGB/K combined transformation. Otherwise each set of STF parameters is imported in its corresponding channel-specific transformation of HistogramTransformation. The reverse operation, that is importing a HistogramTransformation instance in ScreenTransferFunction, is also possible and works in a similar way.

Cheers,
Rick.

Offline samueljohnchia

  • Newcomer
  • Posts: 3
Re: Drizzle is causing a brightness shift
« Reply #2 on: 2017 May 10 19:51:44 »
Is this linear, i.e. unstretched, data with a screen stretch applied?  The screen stretch calculated by ScreenTransferFunction depends on statistical properties of the image, so it is likely to apply a different stretch to the drizzled image.  Try applying exactly the same stretch to the undrizzled and drizzled data and see if you get more similar results. An easy way to do this is to drag the screen stretch parameters from obe of your images to the HistogramTransformation process and then apply to both images.  Here's an excerpt from the STF reference doc that describes how to do this:

Quote
You can drag a STF instance to the control bar of the HistogramTransformation tool window, and the HistogramTransformation tool will import its histogram parameters from the STF instance. When the STF instance defines the same parameters for the three RGB channels, HistogramTransformation will import them in its RGB/K combined transformation. Otherwise each set of STF parameters is imported in its corresponding channel-specific transformation of HistogramTransformation. The reverse operation, that is importing a HistogramTransformation instance in ScreenTransferFunction, is also possible and works in a similar way.

Cheers,
Rick.

Hi Rick, the image source are Tiffs output from Raw Therapee, the raw converter that I use. No additional stretching was done in PixInsight and I don't want any stretching. That is, I want the exact same brightness and color as whatever my raw converter gave me. The non-drizzled integrated image is this way, but the drizzled image is darker - for no obvious reason to me.

Offline RickS

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1298
Re: Drizzle is causing a brightness shift
« Reply #3 on: 2017 May 10 20:14:25 »
Hi Rick, the image source are Tiffs output from Raw Therapee, the raw converter that I use. No additional stretching was done in PixInsight and I don't want any stretching. That is, I want the exact same brightness and color as whatever my raw converter gave me. The non-drizzled integrated image is this way, but the drizzled image is darker - for no obvious reason to me.

So, you're stacking non-linear data, which is not a normal use case.  If you're drizzling up to a higher resolution then I'd expect to get lower pixel values in the resulting image - you're spreading the data across more pixels.  In the normal case where the data is linear this doesn't matter because it's going to get stretched afterwards.  In your case it does matter, but I don't think you'll find an option for DrizzleIntegration that makes it better.  It just isn't designed to do what you want.

Here's an idea for fixing the brightness after you drizzle: resample a copy of the original integration to match the size of the drizzled image then use it as the reference image for LinearFit.

Cheers,
Rick.

Offline samueljohnchia

  • Newcomer
  • Posts: 3
Re: Drizzle is causing a brightness shift
« Reply #4 on: 2017 May 11 19:49:41 »
Thank you. I understand the problem now.