It sounds like your camera uses a Bayer filter to produce color images. This means that in front of each pixel on the sensor, there's a color filter—either red (R), green (G), or blue (B). For example, if your camera's Bayer pattern is RGGB, in the first row, you'd have pixels arranged as RGRGRG..., and in the second row as GBGBGB... and so on. When you perform 2x2 binning, you're essentially averaging the values of pixels with different colors, which results in a monochrome (grey) image.

To capture color images, you should avoid using binning. After capturing the image without binning, you'll need to debayer the image to reconstruct the full color. Debayering is the process of interpolating the Bayer matrix to produce a color image. This should give you color images similar to those you obtain when using libcamera directly on the Raspberry Pi.

Read More...