Color calibration of non-stellar images with an external white reference

esordini

Member
Hello everyone,
PixInsight offers very effective tools to calibrate colors of deep-sky images, such as SPCC and others. "Typical" astronomical images have stars, which make a terrific color reference.

However, problems come up when the images to be color calibrated do not contain stars, such as - in the case at hand - raw frames from last solar eclipse which I managed to observe and image in Arkansas.

I would need some tool to color calibrate images using an external white reference, e.g., a photo of a white sheet of paper taken in bright sunlight with the same camera (Canon 90D DSLR). This is a good white reference, but how to use it in PixInsight? How can I "tell" PI the sheet of paper is true white and use it as a white reference to get the colors of my raw frames right?

Any help much appreciated.
Thanks in advance
Emmanuele
 
Last edited:
You could capture the white paper, apply linear fit and note the fitting equation for each channel.

Then use these equations in PixelMath and apply it to a image container.

However, this uses both additive and multiplicative correction, I am not quite sure whether this is suitable for your case.

As an alternative, you could do either multiplicative or additive color correction only with PixelMath and then apply that to the same image container.

Does this help?

CS Gerrit
 
In a recent post on another channel I rather forgot the issue of bias offset. If you are going to work on raw images you must remember to subtract the bias before performing any multiplicative colour balance.
 
You could capture the white paper, apply linear fit and note the fitting equation for each channel.

Then use these equations in PixelMath and apply it to a image container.

However, this uses both additive and multiplicative correction, I am not quite sure whether this is suitable for your case.

As an alternative, you could do either multiplicative or additive color correction only with PixelMath and then apply that to the same image container.

Does this help?

CS Gerrit
In a recent post on another channel I rather forgot the issue of bias offset. If you are going to work on raw images you must remember to subtract the bias before performing any multiplicative colour balance.
Thank you for your tips but LinearFit doesn't do the trick because the two images are too different in content and signal levels. LinearFit on a debayered eclipse image using the white sheet as a reference will basically erase any trace of the sun and its corona. I was aware of the bias subtraction problem so I used a bias-subtracted shot of the white sheet as a reference but to no avail.

Then I switched to ColorCalibration using the picture as the white sheet as a reference. Plain or bias-subtracted, makes no difference. Bummer.

Guess I'll have to use some other software which I don't think I'm allowed to mention here. Generally speaking PixInsight is indeed a very powerful application but sometimes makes some trivial tasks really complex (or impossible).

Thanks anyway.
Emmanuele
 
Last edited:
Exactly how are you downloading and preprocessing your images? For "ordinary" astrophotography you would be downloading raw CFA images, performing dark and flat calibration, and debayering before doing any colour calibration. If you are not doing this (e.g. for eclipse images), it is important to make sure that you are at least removing bias offset before debayering. Could you upload a couple of sample images (including a "white reference" image).
 
My concern is that:
  • If you download a raw CFA file you may miss out the essential bias subtraction before debayering;
  • If you download a pre-debayered image you may find it hard to find out what else has been done to it; it should not have been debayered without bias subtraction, but does it have camera white balance applied (and if so, is that the white balance you want); does it have any non-linear processing applied (lots of modern cameras do sophisticated in-camera processing for colour images).
In general, you will have more control with a raw download, but you then take responsibility for all the subsequent processing.
 
Last edited:
I would need some tool to color calibrate images using an external white reference, e.g., a photo of a white sheet of paper taken in bright sunlight with the same camera (Canon 90D DSLR). This is a good white reference, but how to use it in PixInsight? How can I "tell" PI the sheet of paper is true white and use it as a white reference to get the colors of my raw frames right?
Apparently you are familiar with the 'Custom white balance' function of your camera that is treated in the camera manual. In order to use this white balance, call 'RAW Format Preferences' (Format Explorer, double click on 'RAW'), enable option 'Camera white balance' and disable option 'No black point correction'.

In WBPP (from v2.5.10, see https://pixinsight.com/forum/index.php?threads/pixinsight-1-8-9-2-released.21228/ ) there is the global option 'Preserve white balance' for CFA data.

I cannot check whether these settings result in acceptable colors because my Canon EOS 600D is modified (filter exchanged).

Bernd
 
Apparently you are familiar with the 'Custom white balance' function of your camera that is treated in the camera manual. In order to use this white balance, call 'RAW Format Preferences' (Format Explorer, double click on 'RAW'), enable option 'Camera white balance' and disable option 'No black point correction'.

In WBPP (from v2.5.10, see https://pixinsight.com/forum/index.php?threads/pixinsight-1-8-9-2-released.21228/ ) there is the global option 'Preserve white balance' for CFA data.
While this is one way forward, it assumes that you selected an appropriate white balance when you captured your images (which would almost certainly not be the WB you use for normal terrestrial photography, and may have issues if you used anything other than an ND filter during capture). Downloading raw data and doing the whole processing yourself may be a bit more involved, but will give you full control of the process.
 
As far as a "white reference" is concerned, there is no purer white reference than the sun. Photographing a sheet of white paper is just photographing the sunlight scattered off it.
[A slight over-simplification: sunlight is of course modified by the atmosphere. But a direct photograph during eclipse capture is probably as good as you need.]
 
Photographers use grey cards (18% grey) and color checkers for color calibration. If you own a camera bag, its interior may be grey. That's done in purpose by its manufacturers in order to be used as an approximate white balance reference. BTW most of the cheap printer/photocopier A4 sheets on my desk have a cold/blue tint compared to my sketch pad's sheets.
 
Photographers use grey cards (18% grey) and color checkers for color calibration.
True, but these are only as useful as the light source that is illuminating them. The sun is a white reference without requiring any such illuminant. If you are photographing the sun (as is true when photographing an eclipse) you are photographing a white reference - you don't need anything else.
 
Exactly how are you downloading and preprocessing your images? For "ordinary" astrophotography you would be downloading raw CFA images, performing dark and flat calibration, and debayering before doing any colour calibration. If you are not doing this (e.g. for eclipse images), it is important to make sure that you are at least removing bias offset before debayering. Could you upload a couple of sample images (including a "white reference" image).
Hi Fred,
thank you for your patience. The workflow is as follows:
  1. PI's raw format conversion options (in the "format explorer" view) are set to "Pure raw"
  2. WBPP on all eclipse raws. Calibrating with biases, flats+flat darks, no light darks.
  3. Using a bias-subtracted white reference.
This procedure makes the corona pink in the saturated area, but more or less gray in the unsaturated area.

Where can I upload my images? They are really hefty, I don't think the forum upload feature is going to accept anything that size (32.5 megapixels yield 130-Mb 32-bit FITS/XISF CFA images and 390-Mb 32-bit RGB images).

Thanks,
Emmanuele
 
Last edited:
Apparently you are familiar with the 'Custom white balance' function of your camera that is treated in the camera manual. In order to use this white balance, call 'RAW Format Preferences' (Format Explorer, double click on 'RAW'), enable option 'Camera white balance' and disable option 'No black point correction'.

In WBPP (from v2.5.10, see https://pixinsight.com/forum/index.php?threads/pixinsight-1-8-9-2-released.21228/ ) there is the global option 'Preserve white balance' for CFA data.

I cannot check whether these settings result in acceptable colors because my Canon EOS 600D is modified (filter exchanged).
You mean I should be using my camera's built-in white balance settings? All raw eclipse frames were shot with the white balance set to "AWB". The camera is a stock one, no baader filters.

When opened in a "traditional" image manipulation program such as Photoshop, my original CR3 raws look perfectly normal, with the saturated part of the corona being pure white, which is what one would expect.

Thanks
Emmanuele
 
This procedure makes the corona pink in the saturated area, but more or less gray in the unsaturated area.

When opened in a "traditional" image manipulation program such as Photoshop, my original CR3 raws look perfectly normal, with the saturated part of the corona being pure white, which is what one would expect.

Thanks
Emmanuele

the problem is that these DSLR files have 14-bit data, and PI loads them into 16-bit integers with the top 2 bits set to 0. this means that the saturated value is 16383, instead of 65535. therefore, saturated channels don't appear to be saturated at all in the 16-bit space, and you get these weird colors when one or two channels are saturated and the other(s) are not.

to avoid this problem, i think you need to rescale your data but ideally this would be done before calibration. the problem with that is that you need to also scale your darks and bias files as well before calibration. the process is really simple, you just need to multiply each file by 4.

your other programs are almost certainly doing this scaling behind the scenes.

PI can also be configured to rescale the data when it's opened, but then you have to take care that any process opening the file has its format hints set properly to do this. in other words, changing the RAW file handler alone won't do it if there are format hints that override the RAW file settings.

if you rescale after full calibration with flats, it's not as simple, because the flat division will arbitrarily change the data. i guess you could find the maximum pixel value in each channel of each calibrated light and then compute a scaling factor so that that pixel has the value 1.0. seems like a lot of work though...

rob
 
All raw eclipse frames were shot with the white balance set to "AWB".
In this case (camera set to "AWB") my suggestion is not feasible.

I really doubt that image calibration is needed for images of the sun, so I would treat them like daylight images. Try to set in RAW Format Preferences (these are my default settings for daylight images):

Demosaiced RGB

- Section Output Options: ALL options disabled,
- Section Interpolation: DCB, DCB iterations: 3, DCB refinement enabled, FBDD noise reduction: 2, camera white balance enabled.

It's worth a try, it costs nothing.

Bernd

Edit:
Sorry, I forgot an important step: application of the sRGB conversion Matrix. The property PCL:sRGBConversionMatrix contains the camera-specific coefficients (see View Explorer):
PCL:sRGBConversionMatrix {{r0,g0,b0},{r1,g1,b1},{r2,g2,b2}}

After loading a proprietary raw file with the above settings, apply the following PixelMath expression to the image:
R: r0*$T[0] + g0*$T[1] + b0*$T[2]
G: r1*$T[0] + g1*$T[1] + b1*$T[2]
B: r2*$T[0] + g2*$T[1] + b2*$T[2]
Therafter, usually an appropriate gamma correction has to be applied (PixelMath: $T^(1/gamma)) in order to attenuate contrast. Suitable gamma values are in the range of 1.05 to 1.80, depending on exposure.

Bernd
 
Last edited:
well, my eclipse images from 2017 definitely needed flat correction. it really depends on your optical train.
 
Back
Top