Images debayered in PixInsight have pink stars?

I posted this on the PI forum, but not sure if it’s an image capture, or image processing issue.

Doing some testing with my 5DII at home (light pollution and near full moon) before I get to a dark site next weekend. Using Sequence Generator Pro for image capture, and have set it to capture single image (CFA fits). I used ISO 1600 and 5min subs. The raw subs are pretty overexposed backgrounds as per the attached image with no STF applied, and before debayering.

Using BPP and ticking the CFA option, the output debayered images have a blue background and the stars are pink. See attached image. I am pretty sure I’ve used all the correct bayer pattern settings (RGGB, VNG etc). Tried all other combinations and all wrong.

Any ideas on the cause and cure? Capture CR2 raw files instead?

Is this using an auto screen stretch (STF) in PI?

If so, try un-linking the channels (chain icon in the STF dialog).

This might not be it (I am not seeing this with some of my old 60Da .cr2 images) but having the channels linked can sometimes have weird color effects. Of course, my files were not taken with SGP and I sold my 60Da as it does not give results on a par with my STT-8300 so unfortunately can’t test it.


I am not sure. We actually use PI to test our DSLR FITS files. Before we release, we make sure that PI can successfully debayer SGPro FITS output from DSLR cameras.

1 Like

Are you shooting with a light pollution filter? Did you try some of the other debayer options?

Those images are not stretched with any kind of STF.
No filters (LP or otherwise). I tried all 4 debayer pattern options. RGGB is the correct one.

I did some more testing last night with reduced exposure times. Still pink stars where saturated. It looks like the R and B are near saturation, but the G isn’t - perhaps due to 2 pixels vs 1 in the bayer pattern? When I say pink, it must be slightly magenta.

I would have expected “saturation” to be white no matter what.

I’m just thinking there must be a pedestal issue or something?

Was it nonlinear histogram transformed then? It should come into
PI with an almost black background and stay displayed that way until
some sort of stretch is done. That is why I suspected an STF as the
screen grab showed a non-black background.

It may have nothing to do with PI, but that made me wonder if any
other manipulations had been done as normally one can’t even tell
what sort of color one has w/o some sort of stretch as pretty much
everything is black w/o a some sort of stretch.

Thanks for sticking with me. There has been no touching of the files other than calibration. No stretching, no nothing.

Not sure if this input will help any, but the more info the better.
I use both a Nikon D5200 and Nikon D600, fits images from SGP.
I checked one image from an M16 set of 12 taken at iso 6400, 60 sec, very dark site, no moon.
Unstretched image has black background, white stars, no visible nebulosity. Stretching gives light grey background, white stars, some nebulosity.
Applying Debayer with RGGB, VNG, unstretched image gives black background, white stars, no visible nebulosity. Stretching gives green background, white stars, some nebulosity.
However, when I run the set of 12 images through the BatchPreprocessing script, the resulting debayered stacked image has a strong orange background when stretched. Curious.
After applying only the DynamicBackgroundExtraction, the orange background is converted to black, and I have a nice normal image of M16.
Suggest you try the BatchPreprocessing script with a set of your images. Might take care of your problem.

Have you tried other debayer patterns? They can sometimes vary depending on
whether you have overscan areas.

1 Like

Try using color calibration.

Agreed, CC works very well. Just be sure to unlink channels if you are using auto screen stretch to evaluate.

In debayer routine/ Bayer/mosaic pattern use GRBG not RGGB. Not GBRG like in my picture :smile:
Is gonna work.

Did anyone figure this out eventually? I am dealing with it now with my 6D.


i don’t think this is necessarily specific to pixinsight… i have seen this with CR2 files generated by the camera or BYE, etc. it’s probably related to the bayer matrix/double green pixels in the bayer matrix as speculated above.

one thing to do is use shorter exposures to recover the star cores and use the HDRComposition process to merge them together with the longer exposures.

another thing to try is the script called Repaired HSV Saturation which might be able to infill the saturated pixels. there’s a thread on the PI forum announcing the script and showing some results.


You say, “perhaps due to 2 pixels vs 1 in the bayer pattern” in an earlier post. Are you trying to bin a CFA camera? I don’t think you can do that. Just a thought.


Hi Rob,
I save in FITS format in SGP. This is just not something that I want to try to live with. And using short exposures as a work around is not a reasonable long term solution. This issue makes the image impossible to get any kind of normal appearance, and it is a brand new problem. I have been using this 6D and Pixinsight for a year now with no problems at all, and all of a sudden my colours are bizarre with a bright blue sky with bright pink stars. This is not just a matter of minor adjustments. Something is seriously wrong here, since Pixinsight and this particular 6D always got along great. I’ll try posting at the Pixinsight forum.

edit: One more strange thing. The images with the weird colours open in Pixinsight looking like they have already been stretched. Usually they are very dark until I use STF to see them. Not these images. They are bright blue and pink. And when I open an older image taken with the same 6D, it opens fine in Pixinsight with no weird colours, and requiring STF to see as usual. That kind of tells me the problem is not Pixinsight, but the image data. Something has changed, and I don’t know what.

edit: The images with the weird colours seemed to have been permanently stretched. Resetting the STF does not return the image to a dark linear appearance.


For what it’s worth, I had to change my debayering matrix when I adopted SGP.

You may want to do your integration without using the batch processing script. There is a great tutorial on YouTube. When you do the integration step by step you can see where things go wrong.


Thanks Robert,
I do use the batch processing script, and have been comfortable with my Pixinsight work flow and results with this 6D until this latest image.


This is a long shot, but I am grasping at straws now. During a frame and focus run while getting set up to get these problem images last night, I checked the box temporarily to show me a JPG preview of the images. I did uncheck this, and it of course should have only affected frame and focus images, not the main images. But since my images seem to have been permanently stretched somehow, I thought perhaps there could be some connection.

Here’s a link to a screenshot showing an image before and after debayer. The blue image cannot be reset to linear with the STF, but seems to be permanently stretched, and I have no idea why.
edit: The undebayered image in the screenshot also cannot be reset with the STF, but also seems to be permanently stretched.


Okay, now I see that the images are permanently stretched right from the start, even before any calibrating. I have no idea how this happens.