## Re: [ccd-newastro] Calculating average brightness in an area of a fits image

Expand Messages
• I ll add my two cents to this. It s a topic that has been around for a long time, and there are many ways to look at it. I have my own reference points, and I
Message 1 of 23 , Jun 2, 2013
I'll add my two cents to this. It's a topic that has been around for a long time, and there are many ways to look at it. I have my own reference points, and I think they are useful ones. There's a long discussion about it in my first book with some visualizations that help show the difference; here's a short version without the illustrations.

I call the two different types of color problems color _bias_, and color _imbalance_.

Let's start with color bias. Any bias is simply an offset. It applies to voltages and other things, as well as to color levels. So if there is a bias in a color, it means that the _real_ values are offset by the same number in all cases. So if one pixel has a true value of 100, a bias of 12 means that the pixel will contain a blue brightness value of 112 instead of 100. Another pixel with a true value of 21 will contain the value 21+12, or 33.

To remove a blue bias, you subtract the same amount from the blue channel of every pixel. The trick, of course, is figuring out what that amount is.

So a bias is a uniform, unwanted signal that affects all pixels equally.

A color imbalance occurs when different amounts of signal are recorded for each channel. In this case, the effect on each pixel is proportional, not fixed. For example, blue brightness might be 20% more intense than the other channels. Using the same brightness values as in the previous example, the pixel with a blue brightness value of 100 would have a recorded value of 100*1.2, or 120. The increase in blue brightness for for a pixel with a blue value of 21 would be 21*1.2, or 25.2.

So you can't simply subtract a uniform value to correct a color imbalance, you need to adjust the percentages of each color channel to achieve balance.

So one key point is this: color _bias_ and color _imbalance_ require different mathematical methods to be solved. That's important because it establishes the need to address each individually. You can't properly balance color if there is a bias; you can't remove a bias by color balancing.

(Not explained here, but you be able to see why on your own: if there is even a very small color bias, changing the color balance will amplify that bias. So you must remove color bias first, then balance color. It's also a good idea to look at the color bias after a color balancing, just in case there was any residual you missed.)

There are good tools for each of these corrections. The trick is in knowing how to tell which is which. Looking at the individual color histograms is the best way to spot a color bias: the black point will be different in each channel. (That is, the rise at the left side will occur at different distances from the left margin.) The appearance of a color bias is more subtle; the actual histogram curves will have different proportions. (Note: an image with a lot of one color can mimic this, as when you image a nebula that is heavily dominate by H-alpha emissions.)

More to the point of your question, sky glow is 'sky color' - you can't really separate things like airglow and light pollution; they are all simply recorded during your exposure. On the other hand, once you learn to remove bias and imbalance separately using whichever tool you prefer, you will automatically correct for _all_ color issues correctly. The source is not nearly as important as making sure the right math gets applied to the right issues!

On Jun 2, 2013, at 10:29 AM, Mark Striebeck <mark.striebeck@...> wrote:

> Hi Stan,
>
> Thanks a lot for these instructions (I was just composing an email asking
> how to do this? :-)
>
> But why is it that sky glow affects star colors differently then sky color?
> In my (naive) view, I thought of sky glow as a kind of filter that distorts
> the color for everything equally in an image.
>
> Thanks
> MarkS
>
>
> On Sun, Jun 2, 2013 at 10:25 AM, Stan <stan_ccd@...> wrote:
>
>> **
>>
>>
>> Obviously the sky background color pollution was not handled and those
>> ratios are invalid.
>>
>> To calculate color/filter ratios, it is imperative to first subtract sky
>> bias levels from each component.
>>
>> To manually calculate:
>>
>> For each filtered image, measure the mode or median of nearby dark sky (no
>> stars or nebula) and then measure the avg of a tight and uniform box
>> surrounding the calibration star (G2); subtract the background from the
>> star and use that for the ratio calculations.
>>
>> To calculate via CCDStack:
>>
>> Create a color image, open the "Adjust Color" form (if not already open)
>> and perform a "set background" (if not done already). Drag a tight
>> rectangle around the calibration star and press the "balance" button (be
>> sure the "factor" radio box is checked). The ratios are automatically
>> calculated and displayed. To normalize ratios to a particular color –
>> double-click the area next to the ratio display box for that color. (read
>> Help: Concepts, Color section)
>>
>> Stan
>>
>>
>>
>
>
> [Non-text portions of this message have been removed]
>
>
>
> ------------------------------------
>
>
>
>
• Thanks for these great explanations Stan and Ron. Let me recap (to make sure that I understand it correct). sky glow is a bias that affects different colors
Message 2 of 23 , Jun 2, 2013
Thanks for these great explanations Stan and Ron.

Let me recap (to make sure that I understand it correct).

sky glow is a bias that affects different colors differently, lets assume
it adds (10, 1, 2) in red, blue, green

my imaging train (mostly camera) introduces a color imbalance, let's assume
it's red=1, blue=1.1, green=1.2 (i.e. the green signal is 1/1.1 times
weaker then the red signal)

Now, let's assume that two pixels in my image have the original colors (50,
50, 50) and (100, 100, 100)

Because of sky glow, these pixels will be (60, 51, 52) and (110, 101, 102)
when they enter my scope.

My imaging train distorts them to (60, 46, 43) and (110, 92, 85)

I can't remove the bias first as there is no constant addition/subtraction
that would work for both pixels.

Which means, I have to correct the color imbalance first (either by
selecting different exposure times, or by selecting different weights when
combining the 3 colors). And after that, I can remove the bias from the sky
glow.

Did I get this right?

MarkS

On Sun, Jun 2, 2013 at 11:39 AM, Ron Wodaski <yahoo@...> wrote:

> I'll add my two cents to this. It's a topic that has been around for a
> long time, and there are many ways to look at it. I have my own reference
> points, and I think they are useful ones. There's a long discussion about
> it in my first book with some visualizations that help show the difference;
> here's a short version without the illustrations.
>
> I call the two different types of color problems color _bias_, and color
> _imbalance_.
>
> Let's start with color bias. Any bias is simply an offset. It applies to
> voltages and other things, as well as to color levels. So if there is a
> bias in a color, it means that the _real_ values are offset by the same
> number in all cases. So if one pixel has a true value of 100, a bias of 12
> means that the pixel will contain a blue brightness value of 112 instead of
> 100. Another pixel with a true value of 21 will contain the value 21+12, or
> 33.
>
> To remove a blue bias, you subtract the same amount from the blue channel
> of every pixel. The trick, of course, is figuring out what that amount is.
>
> So a bias is a uniform, unwanted signal that affects all pixels equally.
>
> A color imbalance occurs when different amounts of signal are recorded for
> each channel. In this case, the effect on each pixel is proportional, not
> fixed. For example, blue brightness might be 20% more intense than the
> other channels. Using the same brightness values as in the previous
> example, the pixel with a blue brightness value of 100 would have a
> recorded value of 100*1.2, or 120. The increase in blue brightness for for
> a pixel with a blue value of 21 would be 21*1.2, or 25.2.
>
> So you can't simply subtract a uniform value to correct a color imbalance,
> you need to adjust the percentages of each color channel to achieve balance.
>
> So one key point is this: color _bias_ and color _imbalance_ require
> different mathematical methods to be solved. That's important because it
> establishes the need to address each individually. You can't properly
> balance color if there is a bias; you can't remove a bias by color
> balancing.
>
> (Not explained here, but you be able to see why on your own: if there is
> even a very small color bias, changing the color balance will amplify that
> bias. So you must remove color bias first, then balance color. It's also a
> good idea to look at the color bias after a color balancing, just in case
> there was any residual you missed.)
>
> There are good tools for each of these corrections. The trick is in
> knowing how to tell which is which. Looking at the individual color
> histograms is the best way to spot a color bias: the black point will be
> different in each channel. (That is, the rise at the left side will occur
> at different distances from the left margin.) The appearance of a color
> bias is more subtle; the actual histogram curves will have different
> proportions. (Note: an image with a lot of one color can mimic this, as
> when you image a nebula that is heavily dominate by H-alpha emissions.)
>
> More to the point of your question, sky glow is 'sky color' - you can't
> really separate things like airglow and light pollution; they are all
> simply recorded during your exposure. On the other hand, once you learn to
> remove bias and imbalance separately using whichever tool you prefer, you
> will automatically correct for _all_ color issues correctly. The source is
> not nearly as important as making sure the right math gets applied to the
> right issues!
>
>
>
>
> On Jun 2, 2013, at 10:29 AM, Mark Striebeck <mark.striebeck@...>
> wrote:
>
> > Hi Stan,
> >
> > Thanks a lot for these instructions (I was just composing an email asking
> > how to do this? :-)
> >
> > But why is it that sky glow affects star colors differently then sky
> color?
> > In my (naive) view, I thought of sky glow as a kind of filter that
> distorts
> > the color for everything equally in an image.
> >
> > Thanks
> > MarkS
> >
> >
> > On Sun, Jun 2, 2013 at 10:25 AM, Stan <stan_ccd@...> wrote:
> >
> >> **
> >>
> >>
> >> Obviously the sky background color pollution was not handled and those
> >> ratios are invalid.
> >>
> >> To calculate color/filter ratios, it is imperative to first subtract sky
> >> bias levels from each component.
> >>
> >> To manually calculate:
> >>
> >> For each filtered image, measure the mode or median of nearby dark sky
> (no
> >> stars or nebula) and then measure the avg of a tight and uniform box
> >> surrounding the calibration star (G2); subtract the background from the
> >> star and use that for the ratio calculations.
> >>
> >> To calculate via CCDStack:
> >>
> >> Create a color image, open the "Adjust Color" form (if not already open)
> >> and perform a "set background" (if not done already). Drag a tight
> >> rectangle around the calibration star and press the "balance" button (be
> >> sure the "factor" radio box is checked). The ratios are automatically
> >> calculated and displayed. To normalize ratios to a particular color �
> >> double-click the area next to the ratio display box for that color.
> >> Help: Concepts, Color section)
> >>
> >> Stan
> >>
> >>
> >>
> >
> >
> > [Non-text portions of this message have been removed]
> >
> >
> >
> > ------------------------------------
> >
> >
> >
> >
>
>
>
> ------------------------------------
>
>
>
>
>

[Non-text portions of this message have been removed]
• First, it doesn t matter how they were altered progressively as they went through the atmosphere and into your scope. However that all happens (and it will
Message 3 of 23 , Jun 2, 2013
First, it doesn't matter how they were altered progressively as they went through the atmosphere and into your scope. However that all happens (and it will vary night to night, even in the same night as various lights get turned on and off), it happens.

What you can do is apply corrections. You _must_ remove bias first; trying to balance biased colors is literally impossible (since you are scaling the bias).

(it's just like bias subtraction from darks: however the bias gets there, it has to be removed before you can scale the darks.)

So you must remove the color bias, so you can scale the colors relative to each other.

That's not just for color (or dark frames); that's how you handle a bias in any situation. Bias first (it's additive, therefore linear) and proportional (non-linear) changes second. Non-linear changes to bias create nothing but problems.

On Jun 2, 2013, at 12:27 PM, Mark Striebeck <mark.striebeck@...> wrote:

> Thanks for these great explanations Stan and Ron.
>
> Let me recap (to make sure that I understand it correct).
>
> sky glow is a bias that affects different colors differently, lets assume
> it adds (10, 1, 2) in red, blue, green
>
> my imaging train (mostly camera) introduces a color imbalance, let's assume
> it's red=1, blue=1.1, green=1.2 (i.e. the green signal is 1/1.1 times
> weaker then the red signal)
>
> Now, let's assume that two pixels in my image have the original colors (50,
> 50, 50) and (100, 100, 100)
>
> Because of sky glow, these pixels will be (60, 51, 52) and (110, 101, 102)
> when they enter my scope.
>
> My imaging train distorts them to (60, 46, 43) and (110, 92, 85)
>
> I can't remove the bias first as there is no constant addition/subtraction
> that would work for both pixels.
>
> Which means, I have to correct the color imbalance first (either by
> selecting different exposure times, or by selecting different weights when
> combining the 3 colors). And after that, I can remove the bias from the sky
> glow.
>
> Did I get this right?
>
> MarkS
>
>
> On Sun, Jun 2, 2013 at 11:39 AM, Ron Wodaski <yahoo@...> wrote:
>
>> I'll add my two cents to this. It's a topic that has been around for a
>> long time, and there are many ways to look at it. I have my own reference
>> points, and I think they are useful ones. There's a long discussion about
>> it in my first book with some visualizations that help show the difference;
>> here's a short version without the illustrations.
>>
>> I call the two different types of color problems color _bias_, and color
>> _imbalance_.
>>
>> Let's start with color bias. Any bias is simply an offset. It applies to
>> voltages and other things, as well as to color levels. So if there is a
>> bias in a color, it means that the _real_ values are offset by the same
>> number in all cases. So if one pixel has a true value of 100, a bias of 12
>> means that the pixel will contain a blue brightness value of 112 instead of
>> 100. Another pixel with a true value of 21 will contain the value 21+12, or
>> 33.
>>
>> To remove a blue bias, you subtract the same amount from the blue channel
>> of every pixel. The trick, of course, is figuring out what that amount is.
>>
>> So a bias is a uniform, unwanted signal that affects all pixels equally.
>>
>> A color imbalance occurs when different amounts of signal are recorded for
>> each channel. In this case, the effect on each pixel is proportional, not
>> fixed. For example, blue brightness might be 20% more intense than the
>> other channels. Using the same brightness values as in the previous
>> example, the pixel with a blue brightness value of 100 would have a
>> recorded value of 100*1.2, or 120. The increase in blue brightness for for
>> a pixel with a blue value of 21 would be 21*1.2, or 25.2.
>>
>> So you can't simply subtract a uniform value to correct a color imbalance,
>> you need to adjust the percentages of each color channel to achieve balance.
>>
>> So one key point is this: color _bias_ and color _imbalance_ require
>> different mathematical methods to be solved. That's important because it
>> establishes the need to address each individually. You can't properly
>> balance color if there is a bias; you can't remove a bias by color
>> balancing.
>>
>> (Not explained here, but you be able to see why on your own: if there is
>> even a very small color bias, changing the color balance will amplify that
>> bias. So you must remove color bias first, then balance color. It's also a
>> good idea to look at the color bias after a color balancing, just in case
>> there was any residual you missed.)
>>
>> There are good tools for each of these corrections. The trick is in
>> knowing how to tell which is which. Looking at the individual color
>> histograms is the best way to spot a color bias: the black point will be
>> different in each channel. (That is, the rise at the left side will occur
>> at different distances from the left margin.) The appearance of a color
>> bias is more subtle; the actual histogram curves will have different
>> proportions. (Note: an image with a lot of one color can mimic this, as
>> when you image a nebula that is heavily dominate by H-alpha emissions.)
>>
>> More to the point of your question, sky glow is 'sky color' - you can't
>> really separate things like airglow and light pollution; they are all
>> simply recorded during your exposure. On the other hand, once you learn to
>> remove bias and imbalance separately using whichever tool you prefer, you
>> will automatically correct for _all_ color issues correctly. The source is
>> not nearly as important as making sure the right math gets applied to the
>> right issues!
>>
>>
>>
>>
>> On Jun 2, 2013, at 10:29 AM, Mark Striebeck <mark.striebeck@...>
>> wrote:
>>
>>> Hi Stan,
>>>
>>> Thanks a lot for these instructions (I was just composing an email asking
>>> how to do this? :-)
>>>
>>> But why is it that sky glow affects star colors differently then sky
>> color?
>>> In my (naive) view, I thought of sky glow as a kind of filter that
>> distorts
>>> the color for everything equally in an image.
>>>
>>> Thanks
>>> MarkS
>>>
>>>
>>> On Sun, Jun 2, 2013 at 10:25 AM, Stan <stan_ccd@...> wrote:
>>>
>>>> **
>>>>
>>>>
>>>> Obviously the sky background color pollution was not handled and those
>>>> ratios are invalid.
>>>>
>>>> To calculate color/filter ratios, it is imperative to first subtract sky
>>>> bias levels from each component.
>>>>
>>>> To manually calculate:
>>>>
>>>> For each filtered image, measure the mode or median of nearby dark sky
>> (no
>>>> stars or nebula) and then measure the avg of a tight and uniform box
>>>> surrounding the calibration star (G2); subtract the background from the
>>>> star and use that for the ratio calculations.
>>>>
>>>> To calculate via CCDStack:
>>>>
>>>> Create a color image, open the "Adjust Color" form (if not already open)
>>>> and perform a "set background" (if not done already). Drag a tight
>>>> rectangle around the calibration star and press the "balance" button (be
>>>> sure the "factor" radio box is checked). The ratios are automatically
>>>> calculated and displayed. To normalize ratios to a particular color –
>>>> double-click the area next to the ratio display box for that color.
>>>> Help: Concepts, Color section)
>>>>
>>>> Stan
>>>>
>>>>
>>>>
>>>
>>>
>>> [Non-text portions of this message have been removed]
>>>
>>>
>>>
>>> ------------------------------------
>>>
>>>
>>>
>>>
>>
>>
>>
>> ------------------------------------
>>
>>
>>
>>
>>
>
>
> [Non-text portions of this message have been removed]
>
>
>
> ------------------------------------
>
>
>
>
• Hi Stan, Your below manual calculation is what I call poor man s photometry. This is precisely what the eXcalibrator Classic routine does. When eXcalibrator
Message 4 of 23 , Jun 4, 2013
Hi Stan,

Your below manual calculation is what I call poor man's photometry. This is precisely what the "eXcalibrator Classic" routine does. When eXcalibrator uses SExtractor, a more sophisticated true aperture photometry method provides the data. Both of these methods are repeated for each color channel using exactly the same background sample or aperture.

I have found the "poor man's" method to be surprisingly accurate. The original "eXcalibrator classic" routine provides RGB ratios very close to that when eXcalibrator uses SExtractor.

With my STF-8300 and Baader filters, I get RGB ratios of 1.0, 1.20 and 1.43. This is with pristine skies near the zenith. Mark describes poor seeing conditions for his M51 image. So I think eXcalibrator's extreme ratios are likely valid. The final result seems to agree.

Cheers,
Bob

--- In ccd-newastro@yahoogroups.com, "Stan" <stan_ccd@...> wrote:
>
> Obviously the sky background color pollution was not handled and those ratios are invalid.
>
> To calculate color/filter ratios, it is imperative to first subtract sky bias levels from each component.
>
> To manually calculate:
>
> For each filtered image, measure the mode or median of nearby dark sky (no stars or nebula) and then measure the avg of a tight and uniform box surrounding the calibration star (G2); subtract the background from the star and use that for the ratio calculations.
>
> To calculate via CCDStack:
>
> Create a color image, open the "Adjust Color" form (if not already open) and perform a "set background" (if not done already). Drag a tight rectangle around the calibration star and press the "balance" button (be sure the "factor" radio box is checked). The ratios are automatically calculated and displayed. To normalize ratios to a particular color  double-click the area next to the ratio display box for that color. (read Help: Concepts, Color section)
>
> Stan
>
• Ron, how s this? After calibrating the RGB images, flatten the background for each color channel. Then apply pixel math (addition or subtraction) to all pixels
Message 5 of 23 , Jun 4, 2013
Ron, how's this?

After calibrating the RGB images, flatten the background for each color channel.

Then apply pixel math (addition or subtraction) to all pixels in each color channel to normalize the backgrounds. This sets the black point for each channel to the same level and effectively removes color bias.

Then use your favorite tool, in my case eXcalibrator, to calculate the RGB factors for color balance. Use these RGB factors to create the color image.

Finally, recheck the color bias. A small adjustment may be required to lineup the bottom of the three color histograms.

Regards,
Bob

--- In ccd-newastro@yahoogroups.com, Ron Wodaski <yahoo@...> wrote:
>
> First, it doesn't matter how they were altered progressively as they went through the atmosphere and into your scope. However that all happens (and it will vary night to night, even in the same night as various lights get turned on and off), it happens.
>
> What you can do is apply corrections. You _must_ remove bias first; trying to balance biased colors is literally impossible (since you are scaling the bias).
>
> (it's just like bias subtraction from darks: however the bias gets there, it has to be removed before you can scale the darks.)
>
> So you must remove the color bias, so you can scale the colors relative to each other.
>
> That's not just for color (or dark frames); that's how you handle a bias in any situation. Bias first (it's additive, therefore linear) and proportional (non-linear) changes second. Non-linear changes to bias create nothing but problems.
>
>
>
>
> On Jun 2, 2013, at 12:27 PM, Mark Striebeck <mark.striebeck@...> wrote:
>
> > Thanks for these great explanations Stan and Ron.
> >
> > Let me recap (to make sure that I understand it correct).
> >
> > sky glow is a bias that affects different colors differently, lets assume
> > it adds (10, 1, 2) in red, blue, green
> >
> > my imaging train (mostly camera) introduces a color imbalance, let's assume
> > it's red=1, blue=1.1, green=1.2 (i.e. the green signal is 1/1.1 times
> > weaker then the red signal)
> >
> > Now, let's assume that two pixels in my image have the original colors (50,
> > 50, 50) and (100, 100, 100)
> >
> > Because of sky glow, these pixels will be (60, 51, 52) and (110, 101, 102)
> > when they enter my scope.
> >
> > My imaging train distorts them to (60, 46, 43) and (110, 92, 85)
> >
> > I can't remove the bias first as there is no constant addition/subtraction
> > that would work for both pixels.
> >
> > Which means, I have to correct the color imbalance first (either by
> > selecting different exposure times, or by selecting different weights when
> > combining the 3 colors). And after that, I can remove the bias from the sky
> > glow.
> >
> > Did I get this right?
> >
> > MarkS
> >
> >
> > On Sun, Jun 2, 2013 at 11:39 AM, Ron Wodaski <yahoo@...> wrote:
> >
> >> I'll add my two cents to this. It's a topic that has been around for a
> >> long time, and there are many ways to look at it. I have my own reference
> >> points, and I think they are useful ones. There's a long discussion about
> >> it in my first book with some visualizations that help show the difference;
> >> here's a short version without the illustrations.
> >>
> >> I call the two different types of color problems color _bias_, and color
> >> _imbalance_.
> >>
> >> Let's start with color bias. Any bias is simply an offset. It applies to
> >> voltages and other things, as well as to color levels. So if there is a
> >> bias in a color, it means that the _real_ values are offset by the same
> >> number in all cases. So if one pixel has a true value of 100, a bias of 12
> >> means that the pixel will contain a blue brightness value of 112 instead of
> >> 100. Another pixel with a true value of 21 will contain the value 21+12, or
> >> 33.
> >>
> >> To remove a blue bias, you subtract the same amount from the blue channel
> >> of every pixel. The trick, of course, is figuring out what that amount is.
> >>
> >> So a bias is a uniform, unwanted signal that affects all pixels equally.
> >>
> >> A color imbalance occurs when different amounts of signal are recorded for
> >> each channel. In this case, the effect on each pixel is proportional, not
> >> fixed. For example, blue brightness might be 20% more intense than the
> >> other channels. Using the same brightness values as in the previous
> >> example, the pixel with a blue brightness value of 100 would have a
> >> recorded value of 100*1.2, or 120. The increase in blue brightness for for
> >> a pixel with a blue value of 21 would be 21*1.2, or 25.2.
> >>
> >> So you can't simply subtract a uniform value to correct a color imbalance,
> >> you need to adjust the percentages of each color channel to achieve balance.
> >>
> >> So one key point is this: color _bias_ and color _imbalance_ require
> >> different mathematical methods to be solved. That's important because it
> >> establishes the need to address each individually. You can't properly
> >> balance color if there is a bias; you can't remove a bias by color
> >> balancing.
> >>
> >> (Not explained here, but you be able to see why on your own: if there is
> >> even a very small color bias, changing the color balance will amplify that
> >> bias. So you must remove color bias first, then balance color. It's also a
> >> good idea to look at the color bias after a color balancing, just in case
> >> there was any residual you missed.)
> >>
> >> There are good tools for each of these corrections. The trick is in
> >> knowing how to tell which is which. Looking at the individual color
> >> histograms is the best way to spot a color bias: the black point will be
> >> different in each channel. (That is, the rise at the left side will occur
> >> at different distances from the left margin.) The appearance of a color
> >> bias is more subtle; the actual histogram curves will have different
> >> proportions. (Note: an image with a lot of one color can mimic this, as
> >> when you image a nebula that is heavily dominate by H-alpha emissions.)
> >>
> >> More to the point of your question, sky glow is 'sky color' - you can't
> >> really separate things like airglow and light pollution; they are all
> >> simply recorded during your exposure. On the other hand, once you learn to
> >> remove bias and imbalance separately using whichever tool you prefer, you
> >> will automatically correct for _all_ color issues correctly. The source is
> >> not nearly as important as making sure the right math gets applied to the
> >> right issues!
> >>
> >>
> >>
> >>
> >> On Jun 2, 2013, at 10:29 AM, Mark Striebeck <mark.striebeck@...>
> >> wrote:
> >>
> >>> Hi Stan,
> >>>
> >>> Thanks a lot for these instructions (I was just composing an email asking
> >>> how to do this? :-)
> >>>
> >>> But why is it that sky glow affects star colors differently then sky
> >> color?
> >>> In my (naive) view, I thought of sky glow as a kind of filter that
> >> distorts
> >>> the color for everything equally in an image.
> >>>
> >>> Thanks
> >>> MarkS
> >>>
> >>>
> >>> On Sun, Jun 2, 2013 at 10:25 AM, Stan <stan_ccd@...> wrote:
> >>>
> >>>> **
> >>>>
> >>>>
> >>>> Obviously the sky background color pollution was not handled and those
> >>>> ratios are invalid.
> >>>>
> >>>> To calculate color/filter ratios, it is imperative to first subtract sky
> >>>> bias levels from each component.
> >>>>
> >>>> To manually calculate:
> >>>>
> >>>> For each filtered image, measure the mode or median of nearby dark sky
> >> (no
> >>>> stars or nebula) and then measure the avg of a tight and uniform box
> >>>> surrounding the calibration star (G2); subtract the background from the
> >>>> star and use that for the ratio calculations.
> >>>>
> >>>> To calculate via CCDStack:
> >>>>
> >>>> Create a color image, open the "Adjust Color" form (if not already open)
> >>>> and perform a "set background" (if not done already). Drag a tight
> >>>> rectangle around the calibration star and press the "balance" button (be
> >>>> sure the "factor" radio box is checked). The ratios are automatically
> >>>> calculated and displayed. To normalize ratios to a particular color 
> >>>> double-click the area next to the ratio display box for that color.
> >>>> Help: Concepts, Color section)
> >>>>
> >>>> Stan
> >>>>
> >>>>
> >>>>
> >>>
> >>>
> >>> [Non-text portions of this message have been removed]
> >>>
> >>>
> >>>
> >>> ------------------------------------
> >>>
> >>>
> >>>
> >>>
> >>
> >>
> >>
> >> ------------------------------------
> >>
> >>
> >>
> >>
> >>
> >
> >
> > [Non-text portions of this message have been removed]
> >
> >
> >
> > ------------------------------------
> >
> >
> >
> >
>
• I m not clear on what exactly you mean by flatten the background. It could mean different things in different programs. I m not immediately thinking of any
Message 6 of 23 , Jun 4, 2013
I'm not clear on what exactly you mean by "flatten the background." It could mean different things in different programs. I'm not immediately thinking of any horrors that would result from this, but my own tendency would be to correct gradients later on.

OTOH, they could affect other calculations, so...not inclined to push you one way or the other without seeing examples.

(Have not had to deal with strong gradients since I moved my imaging from Seattle area to New Mexico...so it's been a while.)

On Jun 4, 2013, at 4:16 PM, Bob Franke <bfranke@...> wrote:

> Ron, how's this?
>
> After calibrating the RGB images, flatten the background for each color channel.
>
> Then apply pixel math (addition or subtraction) to all pixels in each color channel to normalize the backgrounds. This sets the black point for each channel to the same level and effectively removes color bias.
>
> Then use your favorite tool, in my case eXcalibrator, to calculate the RGB factors for color balance. Use these RGB factors to create the color image.
>
> Finally, recheck the color bias. A small adjustment may be required to lineup the bottom of the three color histograms.
>
> Regards,
> Bob
>
>
> --- In ccd-newastro@yahoogroups.com, Ron Wodaski <yahoo@...> wrote:
>>
>> First, it doesn't matter how they were altered progressively as they went through the atmosphere and into your scope. However that all happens (and it will vary night to night, even in the same night as various lights get turned on and off), it happens.
>>
>> What you can do is apply corrections. You _must_ remove bias first; trying to balance biased colors is literally impossible (since you are scaling the bias).
>>
>> (it's just like bias subtraction from darks: however the bias gets there, it has to be removed before you can scale the darks.)
>>
>> So you must remove the color bias, so you can scale the colors relative to each other.
>>
>> That's not just for color (or dark frames); that's how you handle a bias in any situation. Bias first (it's additive, therefore linear) and proportional (non-linear) changes second. Non-linear changes to bias create nothing but problems.
>>
>>
>>
>>
>> On Jun 2, 2013, at 12:27 PM, Mark Striebeck <mark.striebeck@...> wrote:
>>
>>> Thanks for these great explanations Stan and Ron.
>>>
>>> Let me recap (to make sure that I understand it correct).
>>>
>>> sky glow is a bias that affects different colors differently, lets assume
>>> it adds (10, 1, 2) in red, blue, green
>>>
>>> my imaging train (mostly camera) introduces a color imbalance, let's assume
>>> it's red=1, blue=1.1, green=1.2 (i.e. the green signal is 1/1.1 times
>>> weaker then the red signal)
>>>
>>> Now, let's assume that two pixels in my image have the original colors (50,
>>> 50, 50) and (100, 100, 100)
>>>
>>> Because of sky glow, these pixels will be (60, 51, 52) and (110, 101, 102)
>>> when they enter my scope.
>>>
>>> My imaging train distorts them to (60, 46, 43) and (110, 92, 85)
>>>
>>> I can't remove the bias first as there is no constant addition/subtraction
>>> that would work for both pixels.
>>>
>>> Which means, I have to correct the color imbalance first (either by
>>> selecting different exposure times, or by selecting different weights when
>>> combining the 3 colors). And after that, I can remove the bias from the sky
>>> glow.
>>>
>>> Did I get this right?
>>>
>>> MarkS
>>>
>>>
>>> On Sun, Jun 2, 2013 at 11:39 AM, Ron Wodaski <yahoo@...> wrote:
>>>
>>>> I'll add my two cents to this. It's a topic that has been around for a
>>>> long time, and there are many ways to look at it. I have my own reference
>>>> points, and I think they are useful ones. There's a long discussion about
>>>> it in my first book with some visualizations that help show the difference;
>>>> here's a short version without the illustrations.
>>>>
>>>> I call the two different types of color problems color _bias_, and color
>>>> _imbalance_.
>>>>
>>>> Let's start with color bias. Any bias is simply an offset. It applies to
>>>> voltages and other things, as well as to color levels. So if there is a
>>>> bias in a color, it means that the _real_ values are offset by the same
>>>> number in all cases. So if one pixel has a true value of 100, a bias of 12
>>>> means that the pixel will contain a blue brightness value of 112 instead of
>>>> 100. Another pixel with a true value of 21 will contain the value 21+12, or
>>>> 33.
>>>>
>>>> To remove a blue bias, you subtract the same amount from the blue channel
>>>> of every pixel. The trick, of course, is figuring out what that amount is.
>>>>
>>>> So a bias is a uniform, unwanted signal that affects all pixels equally.
>>>>
>>>> A color imbalance occurs when different amounts of signal are recorded for
>>>> each channel. In this case, the effect on each pixel is proportional, not
>>>> fixed. For example, blue brightness might be 20% more intense than the
>>>> other channels. Using the same brightness values as in the previous
>>>> example, the pixel with a blue brightness value of 100 would have a
>>>> recorded value of 100*1.2, or 120. The increase in blue brightness for for
>>>> a pixel with a blue value of 21 would be 21*1.2, or 25.2.
>>>>
>>>> So you can't simply subtract a uniform value to correct a color imbalance,
>>>> you need to adjust the percentages of each color channel to achieve balance.
>>>>
>>>> So one key point is this: color _bias_ and color _imbalance_ require
>>>> different mathematical methods to be solved. That's important because it
>>>> establishes the need to address each individually. You can't properly
>>>> balance color if there is a bias; you can't remove a bias by color
>>>> balancing.
>>>>
>>>> (Not explained here, but you be able to see why on your own: if there is
>>>> even a very small color bias, changing the color balance will amplify that
>>>> bias. So you must remove color bias first, then balance color. It's also a
>>>> good idea to look at the color bias after a color balancing, just in case
>>>> there was any residual you missed.)
>>>>
>>>> There are good tools for each of these corrections. The trick is in
>>>> knowing how to tell which is which. Looking at the individual color
>>>> histograms is the best way to spot a color bias: the black point will be
>>>> different in each channel. (That is, the rise at the left side will occur
>>>> at different distances from the left margin.) The appearance of a color
>>>> bias is more subtle; the actual histogram curves will have different
>>>> proportions. (Note: an image with a lot of one color can mimic this, as
>>>> when you image a nebula that is heavily dominate by H-alpha emissions.)
>>>>
>>>> More to the point of your question, sky glow is 'sky color' - you can't
>>>> really separate things like airglow and light pollution; they are all
>>>> simply recorded during your exposure. On the other hand, once you learn to
>>>> remove bias and imbalance separately using whichever tool you prefer, you
>>>> will automatically correct for _all_ color issues correctly. The source is
>>>> not nearly as important as making sure the right math gets applied to the
>>>> right issues!
>>>>
>>>>
>>>>
>>>>
>>>> On Jun 2, 2013, at 10:29 AM, Mark Striebeck <mark.striebeck@...>
>>>> wrote:
>>>>
>>>>> Hi Stan,
>>>>>
>>>>> Thanks a lot for these instructions (I was just composing an email asking
>>>>> how to do this? :-)
>>>>>
>>>>> But why is it that sky glow affects star colors differently then sky
>>>> color?
>>>>> In my (naive) view, I thought of sky glow as a kind of filter that
>>>> distorts
>>>>> the color for everything equally in an image.
>>>>>
>>>>> Thanks
>>>>> MarkS
>>>>>
>>>>>
>>>>> On Sun, Jun 2, 2013 at 10:25 AM, Stan <stan_ccd@...> wrote:
>>>>>
>>>>>> **
>>>>>>
>>>>>>
>>>>>> Obviously the sky background color pollution was not handled and those
>>>>>> ratios are invalid.
>>>>>>
>>>>>> To calculate color/filter ratios, it is imperative to first subtract sky
>>>>>> bias levels from each component.
>>>>>>
>>>>>> To manually calculate:
>>>>>>
>>>>>> For each filtered image, measure the mode or median of nearby dark sky
>>>> (no
>>>>>> stars or nebula) and then measure the avg of a tight and uniform box
>>>>>> surrounding the calibration star (G2); subtract the background from the
>>>>>> star and use that for the ratio calculations.
>>>>>>
>>>>>> To calculate via CCDStack:
>>>>>>
>>>>>> Create a color image, open the "Adjust Color" form (if not already open)
>>>>>> and perform a "set background" (if not done already). Drag a tight
>>>>>> rectangle around the calibration star and press the "balance" button (be
>>>>>> sure the "factor" radio box is checked). The ratios are automatically
>>>>>> calculated and displayed. To normalize ratios to a particular color –
>>>>>> double-click the area next to the ratio display box for that color.
>>>>>> Help: Concepts, Color section)
>>>>>>
>>>>>> Stan
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> [Non-text portions of this message have been removed]
>>>>>
>>>>>
>>>>>
>>>>> ------------------------------------
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>> ------------------------------------
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>> [Non-text portions of this message have been removed]
>>>
>>>
>>>
>>> ------------------------------------
>>>
>>>
>>>
>>>
>>
>
>
>
>
> ------------------------------------
>
>
>
>
• Me too Ron. The gradients are greatly reduced since I left Seattle, specifically the Magnolia neighborhood. By removing gradients or flattening the images
Message 7 of 23 , Jun 4, 2013
Me too Ron. The gradients are greatly reduced since I left Seattle, specifically the Magnolia neighborhood.

By removing gradients or flattening the images up-front, I feel that a small sampled background area will be more accurate for the rest of the image. This should be better for color bias removal.

Cheers,
Bob

--- In ccd-newastro@yahoogroups.com, Ron Wodaski <yahoo@...> wrote:
>
> I'm not clear on what exactly you mean by "flatten the background." It could mean different things in different programs. I'm not immediately thinking of any horrors that would result from this, but my own tendency would be to correct gradients later on.
>
> OTOH, they could affect other calculations, so...not inclined to push you one way or the other without seeing examples.
>
> (Have not had to deal with strong gradients since I moved my imaging from Seattle area to New Mexico...so it's been a while.)
>
>
>
>
> On Jun 4, 2013, at 4:16 PM, Bob Franke <bfranke@...> wrote:
>
> > Ron, how's this?
> >
> > After calibrating the RGB images, flatten the background for each color channel.
> >
> > Then apply pixel math (addition or subtraction) to all pixels in each color channel to normalize the backgrounds. This sets the black point for each channel to the same level and effectively removes color bias.
> >
> > Then use your favorite tool, in my case eXcalibrator, to calculate the RGB factors for color balance. Use these RGB factors to create the color image.
> >
> > Finally, recheck the color bias. A small adjustment may be required to lineup the bottom of the three color histograms.
> >
> > Regards,
> > Bob
> >
> >
> > --- In ccd-newastro@yahoogroups.com, Ron Wodaski <yahoo@> wrote:
> >>
> >> First, it doesn't matter how they were altered progressively as they went through the atmosphere and into your scope. However that all happens (and it will vary night to night, even in the same night as various lights get turned on and off), it happens.
> >>
> >> What you can do is apply corrections. You _must_ remove bias first; trying to balance biased colors is literally impossible (since you are scaling the bias).
> >>
> >> (it's just like bias subtraction from darks: however the bias gets there, it has to be removed before you can scale the darks.)
> >>
> >> So you must remove the color bias, so you can scale the colors relative to each other.
> >>
> >> That's not just for color (or dark frames); that's how you handle a bias in any situation. Bias first (it's additive, therefore linear) and proportional (non-linear) changes second. Non-linear changes to bias create nothing but problems.
> >>
> >>
> >>
> >>
> >> On Jun 2, 2013, at 12:27 PM, Mark Striebeck <mark.striebeck@> wrote:
> >>
> >>> Thanks for these great explanations Stan and Ron.
> >>>
> >>> Let me recap (to make sure that I understand it correct).
> >>>
> >>> sky glow is a bias that affects different colors differently, lets assume
> >>> it adds (10, 1, 2) in red, blue, green
> >>>
> >>> my imaging train (mostly camera) introduces a color imbalance, let's assume
> >>> it's red=1, blue=1.1, green=1.2 (i.e. the green signal is 1/1.1 times
> >>> weaker then the red signal)
> >>>
> >>> Now, let's assume that two pixels in my image have the original colors (50,
> >>> 50, 50) and (100, 100, 100)
> >>>
> >>> Because of sky glow, these pixels will be (60, 51, 52) and (110, 101, 102)
> >>> when they enter my scope.
> >>>
> >>> My imaging train distorts them to (60, 46, 43) and (110, 92, 85)
> >>>
> >>> I can't remove the bias first as there is no constant addition/subtraction
> >>> that would work for both pixels.
> >>>
> >>> Which means, I have to correct the color imbalance first (either by
> >>> selecting different exposure times, or by selecting different weights when
> >>> combining the 3 colors). And after that, I can remove the bias from the sky
> >>> glow.
> >>>
> >>> Did I get this right?
> >>>
> >>> MarkS
> >>>
> >>>
> >>> On Sun, Jun 2, 2013 at 11:39 AM, Ron Wodaski <yahoo@> wrote:
> >>>
> >>>> I'll add my two cents to this. It's a topic that has been around for a
> >>>> long time, and there are many ways to look at it. I have my own reference
> >>>> points, and I think they are useful ones. There's a long discussion about
> >>>> it in my first book with some visualizations that help show the difference;
> >>>> here's a short version without the illustrations.
> >>>>
> >>>> I call the two different types of color problems color _bias_, and color
> >>>> _imbalance_.
> >>>>
> >>>> Let's start with color bias. Any bias is simply an offset. It applies to
> >>>> voltages and other things, as well as to color levels. So if there is a
> >>>> bias in a color, it means that the _real_ values are offset by the same
> >>>> number in all cases. So if one pixel has a true value of 100, a bias of 12
> >>>> means that the pixel will contain a blue brightness value of 112 instead of
> >>>> 100. Another pixel with a true value of 21 will contain the value 21+12, or
> >>>> 33.
> >>>>
> >>>> To remove a blue bias, you subtract the same amount from the blue channel
> >>>> of every pixel. The trick, of course, is figuring out what that amount is.
> >>>>
> >>>> So a bias is a uniform, unwanted signal that affects all pixels equally.
> >>>>
> >>>> A color imbalance occurs when different amounts of signal are recorded for
> >>>> each channel. In this case, the effect on each pixel is proportional, not
> >>>> fixed. For example, blue brightness might be 20% more intense than the
> >>>> other channels. Using the same brightness values as in the previous
> >>>> example, the pixel with a blue brightness value of 100 would have a
> >>>> recorded value of 100*1.2, or 120. The increase in blue brightness for for
> >>>> a pixel with a blue value of 21 would be 21*1.2, or 25.2.
> >>>>
> >>>> So you can't simply subtract a uniform value to correct a color imbalance,
> >>>> you need to adjust the percentages of each color channel to achieve balance.
> >>>>
> >>>> So one key point is this: color _bias_ and color _imbalance_ require
> >>>> different mathematical methods to be solved. That's important because it
> >>>> establishes the need to address each individually. You can't properly
> >>>> balance color if there is a bias; you can't remove a bias by color
> >>>> balancing.
> >>>>
> >>>> (Not explained here, but you be able to see why on your own: if there is
> >>>> even a very small color bias, changing the color balance will amplify that
> >>>> bias. So you must remove color bias first, then balance color. It's also a
> >>>> good idea to look at the color bias after a color balancing, just in case
> >>>> there was any residual you missed.)
> >>>>
> >>>> There are good tools for each of these corrections. The trick is in
> >>>> knowing how to tell which is which. Looking at the individual color
> >>>> histograms is the best way to spot a color bias: the black point will be
> >>>> different in each channel. (That is, the rise at the left side will occur
> >>>> at different distances from the left margin.) The appearance of a color
> >>>> bias is more subtle; the actual histogram curves will have different
> >>>> proportions. (Note: an image with a lot of one color can mimic this, as
> >>>> when you image a nebula that is heavily dominate by H-alpha emissions.)
> >>>>
> >>>> More to the point of your question, sky glow is 'sky color' - you can't
> >>>> really separate things like airglow and light pollution; they are all
> >>>> simply recorded during your exposure. On the other hand, once you learn to
> >>>> remove bias and imbalance separately using whichever tool you prefer, you
> >>>> will automatically correct for _all_ color issues correctly. The source is
> >>>> not nearly as important as making sure the right math gets applied to the
> >>>> right issues!
> >>>>
> >>>>
> >>>>
> >>>>
> >>>> On Jun 2, 2013, at 10:29 AM, Mark Striebeck <mark.striebeck@>
> >>>> wrote:
> >>>>
> >>>>> Hi Stan,
> >>>>>
> >>>>> Thanks a lot for these instructions (I was just composing an email asking
> >>>>> how to do this? :-)
> >>>>>
> >>>>> But why is it that sky glow affects star colors differently then sky
> >>>> color?
> >>>>> In my (naive) view, I thought of sky glow as a kind of filter that
> >>>> distorts
> >>>>> the color for everything equally in an image.
> >>>>>
> >>>>> Thanks
> >>>>> MarkS
> >>>>>
> >>>>>
> >>>>> On Sun, Jun 2, 2013 at 10:25 AM, Stan <stan_ccd@> wrote:
> >>>>>
> >>>>>> **
> >>>>>>
> >>>>>>
> >>>>>> Obviously the sky background color pollution was not handled and those
> >>>>>> ratios are invalid.
> >>>>>>
> >>>>>> To calculate color/filter ratios, it is imperative to first subtract sky
> >>>>>> bias levels from each component.
> >>>>>>
> >>>>>> To manually calculate:
> >>>>>>
> >>>>>> For each filtered image, measure the mode or median of nearby dark sky
> >>>> (no
> >>>>>> stars or nebula) and then measure the avg of a tight and uniform box
> >>>>>> surrounding the calibration star (G2); subtract the background from the
> >>>>>> star and use that for the ratio calculations.
> >>>>>>
> >>>>>> To calculate via CCDStack:
> >>>>>>
> >>>>>> Create a color image, open the "Adjust Color" form (if not already open)
> >>>>>> and perform a "set background" (if not done already). Drag a tight
> >>>>>> rectangle around the calibration star and press the "balance" button (be
> >>>>>> sure the "factor" radio box is checked). The ratios are automatically
> >>>>>> calculated and displayed. To normalize ratios to a particular color 
> >>>>>> double-click the area next to the ratio display box for that color.
> >>>>>> Help: Concepts, Color section)
> >>>>>>
> >>>>>> Stan
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>
> >>>>>
> >>>>> [Non-text portions of this message have been removed]
> >>>>>
> >>>>>
> >>>>>
> >>>>> ------------------------------------
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>
> >>>>
> >>>>
> >>>> ------------------------------------
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>
> >>>
> >>> [Non-text portions of this message have been removed]
> >>>
> >>>
> >>>
> >>> ------------------------------------
> >>>
> >>>
> >>>
> >>>
> >>
> >
> >
> >
> >
> > ------------------------------------
> >
> >
> >
> >
>
Your message has been successfully submitted and would be delivered to recipients shortly.