Friday, July 20, 2012

Improvement of Nomacs Raw Loader

The RAW image data we get from digital cameras are the values taken from the cameras sensor. This image is mosaiced: every pixel has just one of the three colors: red, green, blue. The pixels form a pattern that is called color filter array. The most common of them is the Bayer filter which is composed of two green pixels on one diagonal and of one red and one blue pixel on the other diagonal. Bellow picture shows a small part of the Bayer filter.

 In order to create an image that represents what a human eye would see we need to process the RAW data. There are a few essential steps that we need to do:

1. Normalization of RAW data: the RAW image needs to be normalized depending on the black point of the used digital camera and its dynamic range.

2. Demosaicing: for each uni-colored pixel we need to find the other two colors of this pixels. This is done by using the interpolation that is based on the type of the color filter array.

3. White balance: The demosaiced image is very green. To remove this effect we multiply each image RGB channel with a constant. The three constants are based on the photographed scene illuminant and they differ for each digital camera.  

4. Color correction: The colors of the white balanced picture are still not right. We need to do another transformation that converts colors from the camera color space to a standardized color space such as sRGB or AdobeRGB. This is done by multiplying pixels RGB values with a so called color matrix.

5. Gamma correction: the human visual response to the light is nonlinear. On the other hand the digital camera response is linear. The process of changing the linear data to nonlinear data is called applying gamma correction.

The previous version of Nomacs RAW Loader had a little different sequence of this changes and it was missing one correction: the color correction. After changing this the improvements are clearly visible. Bottom image shows the difference between previous and modified RAW Loader.

So when we postprocess a RAW image we need to be careful that we make all needed corrections. Missing one completely changes  how the processed image looks.

No comments:

Post a Comment