debayering before star registration vs during conversion results in weird images

I understand the concept of debayering as late as possible, just before star alignment. But I have done this several times (convert but not debayer, subtract dark but not debayered, subtract bias but not debayered, use flats but not debayered) save de-bayered after pp just before star alignment, but always get weird, awful images before or after stacking. I debayer immediately and everything is nice. So what am I doing wrong?

Hi, the problem with descriptions like “always get weird” and “everything is nice” is that we don’t know what you are saying and we cannot help you.

Je vous demande pardon.
On the left is a single pp sub, where light/flat/dark/bias were debayered at the initial convert point before pp. The one at right is the same sub, with debayering checkbox done only at the end of pp just before star registration. The dark/bias/flat were never debayered even when stacking.

is it done with an official script, or manually? With what formula of calibration if manually?
Have you tried following the tutorials? This clearly is not supposed to be like that on the right, it’s either that the calibration files are bad, or the formula is wrong.

Manually, same formula as the debayered method that I’ve been using for 2 years with no issue, same flats/darks/bias for both cases. I figured the non-debayering method would be analogous, so why bother with a tutorial? Since something is not right, I will pursue due diligence and follow the tutorial.
Might be a few days before I get at it… thanks for your prompt replies!

1 Like

Here you are showing jpg of linear images. So for me it is normal to have weird image.
Please, share both images,but in FITS format, not jpg.

Will post fits if I first can’t get it working following the tutorial to the letter. Thanks, cheers, and fireballs!

Hi Alister, you know me :slight_smile: There is one difference that is not mentioned in your post. When shooting with a dslr & debayering in the conversion step a different debayer algo is used. It may be vng, ahd, etc. & yields a more natural color image. When you debayer fit files like pp_lights a different algo - rcd - is used with double the green. This is good so long as the calibration files are not debayered before preprocessing. I feel like your established workflow of debayering everything might have led to some or all of the calibration frames being debayered when they never should be.
If not that, perhaps the stacking algo for calibration frames. Normally average, rejection, with multiplicative normalization for flats, no normalization for bias & darks.
I have always used the prescribed delayed debayering method with total success. You have the ability to message me via RASC, pls feel free AFTER tomorrow if you are still having issues. Regards

It is not the reason. In fact, the debayer algorithm used does not influence that much the result.
Here, when you directly debayer RAW images this is LibRaw that is used. The library applies daylight coefficients to balance the color. While when you debayer FITS file, after calibration, no coefficient are applied.
In fact this behavior is removed from the current dev branch. No daylight are applied anymore.

Will contact you Gary, thanks! We might arrange a phone call or zoom, nice to have a local person at hand.
I reran the data, using the built in script and following the tutorial. Interestingly, when I did remove background gradient then color calibrate, it was not as good as doing color calibrate first, then background gradient removal. My first kick at the cat is that there is little difference with de-bayering everything first, but that might be for a suburban low ISO shot. Need to learn how to input background subtraction (for each sub) in the script before stacking.

Blush, operator error. The OSC processing script works very nicely. I must have copied incorrectly from one folder to another, and/or not paid attention to subtle differences in names with manual home directory changes. Sincere apologies for the distraction. Perhaps the moderator can just delete this thread?