Our discussion has collapsed into a semantic one, it seems... :-(
I guess "file structure" was the wrong term. As you correctly described (above), the Channel Mode shows the 4 pixels in each "block". I think that is quite different than what PS shows, which is after Bayer De-mosaicing.
correct. but it's not completely different -- in principle it's doing the same thing, and only displaying that particular channel. it's just doing it
before bayer interpolation has been applied, whereas photoshop does it
after . however, it's still decoding the color information, which is not actually contained within the raw file itself.
That seems patently incorrect. If the RAW file didn't contain color information, then there would be no possibility of rendering it to a RGB version (w/o just making up random colors!). My contention is that
every color image format, including all the versions of RAW, encode color by position within the file format. There are (at least) two ways to do this, that I can think of...
- Locate all the similar color values together...like have an area that contains only the red photosite data and another that contains only the green photosite data. These would probably be called the "red block" and the "green block". Each one would have identical structure, representing the X-Y sensor dimensions. The header of the file would probably contain 1) index values to the start of each color block and 2) a value representing the size of each block.
- Locate all photosite data elements exactly as received from the sensor. This will be in strings of RGRGRGRGRGRGRGRGR... and GBGBGBGBGBGBGBGBG... Each row of this data represents a physical row of photosites. Again, the header will have values that tell a reading application where all this is located and how big it is.
In both these, the color information is a location, either which block or which row/odd-even value.
In RGB files, the color information is
still encoded by position. Each 24-bit or 32-bit or 48-bit word has the colors in R-G-B order. By knowing this order and the size of the word, applications can access each color "channel" separately or use all three to blend a color at that position in the image.
Not B&W as much as mono-chromatic. Each of the 4 photosites in a "block" has a colored filter on it, so each "represents" a specific part of the visible spectrum. That wavelength info is not conveyed in the photosite data, but it's elsewhere. That you decide to visualize that channel data as a B&W (which is a common method) doesn't change the fact that each photosite position, within the Bayer "block" represents a specific color. Bayer de-mosaicing doesn't magically "add" color...it just makes SWAGs about what other color values would have been, if the photosite was poly-chromatic.
correct. however, it's important to note that it doesn't record this data as
color . it records it as shades of gray, in 8-16 bits, depending on your camera. it is the bayer interpolation algorithm that applies the color.
Again, this is terribly semantic. In an RGB file, the word that has the 3 color values is just like the three shades of grey that you think is in a RAW file. There is no difference.
As an overly simple example, let's take 4 photosites in an RGGB array and record their "RAW" data:
R G
G B
6 4
2 8
The RAW data is 6,4,2,8...the color code is R,G,G,B.
Let's surround these 4 photosites with 12 zero photosites (because in order to perform matrix operations, we must have
some data there. Now the 4X4 array looks like:
0 0 0 0
0 6 4 0
0 2 8 0
0 0 0 0
The code for this data is:
B G B G
G R G R
B G B G
G R G R
We can demosaic this data and generate four RGB words by scanning a 3X3 window over it:
6/3/2, 3/4/4, 3/2/4, 1.5/2/8
Thus, in this overly simple demosaicing scheme, the 2X2 matrix becomes:
6/3/2 | 3/4/4
3/2/4 | 1.5/2/8
Each of those values, such as "6" are what you call "shades of grey". If you and I didn't know that the
first value in each grouping represented "red", we would not be able to tell by looking at the value itself!
--
Charlie Davis
Nikon 5700, Sony R1, Nikon D50, Nikon D300
HomePage:
http://www.1derful.info
“...photography for and of itself – photographs taken
from the world as it is – are misunderstood as a
collection of random observations and lucky moments...
Paul Graham