Filters in colour cameras (CMOS or CCD)
Colour cameras have an array of red, green & blue (RGB) filters in front of the pixels in the detector
So the raw data of an image of stars would really look like this:
Missing colours at each pixel are interpolated from neighbours
Also there is an infra-red blocking filter in DSLRs
The single red pixel here is defective - another story - see my web site, www.grelf.net