I asked Lee Peterson, since he's on various panels and is involved in next-gen chips. Here's what he said:
-----Original Message-----
Sent: Friday, January 30, 2004 10:05 AM
Subject: Answer
The Canon EOS-1D and some Kodak cameras compress their raw data
with lossless JPEG. Not all cameras do this.
All RGB cameras use one of these Bayer grids:
0x16161616: 0x61616161: 0x49494949: 0x94949494:
0 1 2 3 4 5 0 1 2 3 4 5 0 1 2 3 4 5 0 1 2 3 4 5
0 B G B G B G 0 G R G R G R 0 G B G B G B 0 R G R G R G
1 G R G R G R 1 B G B G B G 1 R G R G R G 1 G B G B G B
2 B G B G B G 2 G R G R G R 2 G B G B G B 2 R G R G R G
3 G R G R G R 3 B G B G B G 3 R G R G R G 3 G B G B G B
The Bayer grid is the way the color pixels are laid out on the chip. Sony has introduced a 4 color grid in their new 828 camera.
Here is a sample of the code for Canon's raw conversion:
void canon_600_load_raw()
{
uchar data[1120], *dp;
ushort pixel[896], *pix;
int irow, orow, col;
for (irow=orow=0; irow < height; irow++)
{
fread (data, 1120, 1, ifp);
for (dp=data, pix=pixel; dp < data+1120; dp+=10, pix+=8)
{
pix[0] = (dp[0] << 2) + (dp[1] >> 6 );
pix[1] = (dp[2] << 2) + (dp[1] >> 4 & 3);
pix[2] = (dp[3] << 2) + (dp[1] >> 2 & 3);
pix[3] = (dp[4] << 2) + (dp[1] & 3);
pix[4] = (dp[5] << 2) + (dp[9] & 3);
pix[5] = (dp[6] << 2) + (dp[9] >> 2 & 3);
pix[6] = (dp[7] << 2) + (dp[9] >> 4 & 3);
pix[7] = (dp[8] << 2) + (dp[9] >> 6 );
}
for (col=0; col < width; col++)
image[orow*width+col][FC(orow,col)] = pixel[col] << 4;
for (col=width; col < 896; col++)
black += pixel[col];
if ((orow+=2) > height)
orow = 1;
}
black = ((INT64) black << 4) / ((896 - width) * height); }
The potential gamut of the the CCD or CMOS chip is determined by the voltage across the chip and the size of the pixels and amount of light striking the pixel through a filter. The more a pixel is excited the higher the potential gamut. (Larger signal) Try this: Shoot two images, one over exposed and the other under exposed. Then check the file size. You will notice that the over exposed file is larger in size. It has a higher chip potential gamut and more information is on the chip and in the file. The problem with over exposure is if surge voltage is exceeded the chip will "Flair" where each pixel cannot define detail. Post production software can process a curve with more information when it has more information to work with. A Jpeg file has eliminated 25% of the information from the highlight exposure so it can make the file smaller. Thus, sRGB processed file has less information and the gamut has been sacrificed.
The gamut of a raw file of what electronic "0s" & "1s" is collected on a chip has no relationship to RGB other than the Bayer collective. Color and RGB only come from the final processing software. The color gamut of RGB is greater with more information than a sRGB file.
A tiff file retains all the information of the processed file. A Jpeg file will reduce the file storage size by eliminating a large chunk of highlight information.
Lee Peterson
Marine Camera Distributors
01-29-04
Translation: there is no relationship between the gamut of a raw file to RGB of any kind. They come only from software (which we knew, before). So I guess it's up to the interpretation. For example, if a raw image contains certain low values and high values along a specific axis, the software can decide to extend, contract, or clip the range depending on whether the target gamut is wide enough. You have to profile your camera and raw converter software to get "real" accurate colors.
I am not sure this answers the question, though, which is really -- what values of color can the camera capture and write to its RAW file, and what values do they take on in the representation?