Tony, you have provided a nice summary of demosaicing, but I take exception to your statements regarding gamma. When gamma encoding is accomplished, one applies a 1/2.2 power function to the data. When the image is output to the screen, a 2.2 power function is applied, undoing the 1/2.2 transform and restoring linearity.
Hi Bill,
While correct, it's important to also point out that many image manipulations, e.g. in Photoshop, are performed on gamma pre-compensated TIFF/JPEG input. That can result in color shifts when brightness and/or contrast are changed, because the linear relationship between R, G and B is 'broken' if the workingspace gamma is not linear.
But, for the OP, that's all after Raw conversion, which is a process based on linear (or linearized) gamma Raw data (usually in Bayer CFA format before it's demosaiced). After blackpoint subtraction, white balancing, and demosaicing, the postprocessing can begin (including the application of gamma pre-compensation).
Some Raw converters can also compensate for e.g. Chromatic Aberrations, before demosaicing, which will improve resolution because the RGB channels will be demosaiced while in registration/aligned.
Cheers,
Bart