On Fri, Jun 16, 2006 at 09:47:29PM -0400, Igor Roshchin wrote: [much snipped] > Converter from RAW does what is called demosaicing, by > mixing values from the mosaic to assign values to the pixel in between. > While the description below might not be exact, I think it is presents > a picture that is easy to understand. If you were to put the mosaic > described above on a square-ruled paper (matrix), then we can put > "pixels" P on the nodes (corners of the squares): > > R_G_R_G > _P_P_P_ > G_B_G_B > _P_P_P_ > R_G_R_G > _P_P_P_ > G_B_G_B > > In the demosaicing process, essentiall the value of each pixel "P" > is assigned based on the values of the four surrounding sensor sites. > While in a small image above it looks like you have fewer "P"'s than > R's, G's, and B's altogether, but when you have a large matrix, > the difference in number is negligible (in the scenario described > here it would be ~ 5000 pixels for a ~2000x3000 matrix which is ~0.1%, > but in reality it could be a bit more (no pun intended), depending on > the implementation)
Not only is this over-simplified; it's wrong. Most de-mosaicing algorithms put the pixel centres coincident with the sensor sites, rather than in between. They don't replace an actual sensor value; they interpolate missing components, often using rather more than just the four neighbouring pixels. Because they use values from one or more rows or columns of neighbouring pixels is one reason why the 'full' image size (3008 x 2008 in this case) is smaller than the actual sensor dimensions (3040 x 2024). > It is this demosaicing process when the white balance, sharpness, gamma > correction, ISO values, etc are being used in the conversion. Again, incorrect. The ISO value is generally used to control the gain of an analog amplifier during the actual data readout from the sensor before the conversion to digital values. As such, the sensor values in the RAW file have already had ISO scaling. In fact in some cameras (although not in the Pentax models) the white balance is also applied in the analog domain. Furthermore, sharpening at this stage is only done in certain converters; while Adobe Camera Raw can apply sharpening (and image re-sizing) during RAW conversion, many converters do no such processing, leaving that for editing. > Since the process of demosaicing is fully mathematically reversible, Not necessarily. While a simple averaging scheme is (close to) reversible, subject only to there being not quite enough data values to uniquely determine the outermost pixel values, there are several other demosaicing algorithms that are not reversible. > I think this rather simple documents explains some of these issues > in more detail: > http://www.adobe.com/digitalimag/pdfs/understanding_digitalrawcapture.pdf > > I hope I didn't cause too much confusion, and my explanation was > helpful to somebody. > > Igor -- PDML Pentax-Discuss Mail List [email protected] http://pdml.net/mailman/listinfo/pdml_pdml.net

