I had a very exciting day (astrophotographically speaking), as I managed today to color-calibrate my Canon R6 when shooting with a light pollution filter (Optolong L-Pro). I thought I would get a very poor result as the filter throws away almost half of the spectrum. I was reading a lot that these filters distort the colors too much to be useful for true broadband photography.
And, yet, when following the practices discussed in this thread to create a custom color correction matrix, I was able to achieve incredible color.
I present the results, followed by detailed steps, in case others want to use these methods.
I used Canon R6 with EF 24-70mm lens, Optolong L-Pro, and captured the X-Rite Colorchecker Passport with a "full spectrum" bulb (4400K CCT).
Original colorchecker image, rendered using the "regular" R6 matrices and D50 white balance (error ΔΕ=11.82) :
Same image after correcting the white balance per channel gains [2.30 1 1.30], but keeping the regular R6 CCM (ΔΕ=6.19):
And after correcting with both WB gains and the new, optimized CCM (ΔΕ=2.49):
The last result, even though it has the filter, looks visually indistinguishable from the one without using a filter at all!
The steps I followed (high level) were:
- Capture the colorchecker image
- Create reference image for profiling (I used Rawtherapee)
- Generate color correction matrix and WB gains (I used dcamprof)
- Apply CCM/WB to original image (I used Pixinsight)
In an astro photo, I would apply the WB gains at the very start (before debayering) and the CCM at the last linear processing step.
In more detail:
1. Install Rawtherapee, DCamProf, and Argyll.
2. Capture the colorchecker image using this guidance (I also captured flats using the white back of the colorchecker passport but they did not meaningfully improved the results)
3. Open the RAW file in Rawtherapee, wengot to color management tab, scroll down and hit "Save reference image" without any WB. This saved a linear image as 16bit tif, R6_REF.tif .
I found that this type of image did not work when opening it for profiling in Lumariver in macOS. In seems the OS applies a default sRGB tone response curve, which throws away Lumariver's expected linear data. This was not an issue if the image was assigned a linear profile first, or processed in command line).
4. Generate intermediate ti3 file (this holds the RGB values of the captured colorchecker patches and the reference ones for the particular target shot):
scanin -p -v -dipn \
R6_REF.tif \
/Applications/Argyll_V3.3.0/ref/ColorCheckerHalfPassport.cht \
/Applications/Argyll_V3.3.0/ref/ColorCheckerHalfPassport.cie
I am running this from the directory that the reference file is stored, but I need to point to the target chart files that come with Argyll.
5. Use DCamProf to solve for the optimal white balance and forward matrix (that's the core of the operation):
dcamprof make-profile \
-g /Applications/dcamprof/data-examples/cc24-layout.json \
-i D50 \
R6_REF.ti3 \
R6_profile.json
-g points to the location of the layout used, -i specifies the illuminant used (mine was close to D50), and the json file stores the results. I note the WB gains and forward matrix values displayed on the screen.
6. Optionally, create an ICC profile for the camera system:
dcamprof make-icc \
-n R6 \
-L \
R6_profile.json \
R6.icc
-L forces a linear, matrix only profile. I consider this step optional as I sometimes prefer to multiply with the matrix values manually.
7. Open the RAW image in the astro software (I used Pixinsight). White balance, Debayer, then either i) assign linear sRGB profile (I use this one), multiply with the ForwardMatrix (to take the data to XYZ D50), then multiply with the standard XYZD50 to XYZD65 CAT matrix and XYZ to sRGB matrices, or ii) assign the icc profile created earlier.
In the above, I also use the linear sRGB profile as my working profile.
8. Finally, convert the profile to the standard gamma sRGB, then save the image with that profile embedded.
Phew!
PS: In Pixinsight, the following code in Pixelmath (RGB/k single expression) will apply WB per channel gains to a RGGB CFA:
iif( x()%2==0 && y()%2==0,
$T * Rgain,
iif( x()%2==1 && y()%2==0,
$T * Ggain,
iif( x()%2==0 && y()%2==1,
$T * Ggain,
$T * Bgain)))
Where Rgain, Ggain, Bgain are the WB gains.
Post-debayer WB is instead applied per channel using the equations:
$T[0]*Rgain
$T[1]*Ggain
$T[2]*Bgain
Edited by timaras, 08 June 2025 - 04:36 PM.