FIXME **This page is not fully translated, yet. Please help completing the translation.**\\ // (remove this paragraph once the translation is finished) // ====Basic Color Processing==== Digital cameras can capture color images, but the color processing in a camera is a highly complex and crucial process.\\ Manufacturers typically do not disclose the details of this process, but the basic concepts remain the same. When a camera captures a real-world scene, how does it reproduce the image as seen by the human eye?\\ **1. RAW ---- The Original Image Captured by the Camera**\\ The vast majority of color image sensors use a Bayer pattern, which employs red, green, and blue color filters. Therefore, each pixel can detect only one color, "seeing" either red, green, or blue. Since green is the most important color for luminance information, two pixels are used for green, one for blue, and one for red. |{{ http://ydadmin.rdbuy.com.cn/ueditor/php/upload/image/20230802/1690954260613666.png }}| ^ Figure 1: The sensor signal does not contain full color information; each pixel represents only one color ^ |{{ http://ydadmin.rdbuy.com.cn/ueditor/php/upload/image/20230802/1690954284239573.png }}| ^ Figure 2: Detail of the image above. Each pixel detects only one color. The image is still "mosaicked" ^ **2. Demosaicing**\\ To obtain the red, green, and blue information for each pixel, a crucial step in demosaicing is to interpolate the missing information. This directly affects image quality, which is why many manufacturers do not disclose the details of their algorithms. Different color filters result in different light sensitivities and relatively low signal strengths, so noise levels can vary significantly. During the demosaicing process, noise spreads among adjacent pixels, and the noise in different color channels becomes correlated. |{{ http://ydadmin.rdbuy.com.cn/ueditor/php/upload/image/20230802/1690954316714824.png }}| ^ Figure 3: Information from one pixel is used to determine the color information of adjacent pixels ^ |{{ http://ydadmin.rdbuy.com.cn/ueditor/php/upload/image/20230802/1690954486106539.png }}| ^ Figure 4: After demosaicing, each pixel has a red, green, and blue value, so the original image becomes a full-color image ^ **3. White Balance**\\ In digital cameras, the sensitivities of different color channels vary. To obtain accurate colors that match human vision, the camera controls the gain of each channel differently. After white balance processing, neutral areas in the image appear neutral, and the values for red, green, and blue are nearly identical.\\ |{{ http://ydadmin.rdbuy.com.cn/ueditor/php/upload/image/20230802/1690954518777840.png }}| ^ Figure 5: After adjusting the gain of all channels, the image appears neutral ^ **4. Color Correction Matrix (CCM)**\\ Every camera has its own spectral sensitivity, resulting in a specific RGB output for each camera. To achieve consistent results across all cameras, the camera's RGB values must be converted into a standard, well-defined color space, which in most cases is sRGB, but can be any other color space. To convert values from RGB_camera to sRGB, a 3x3 color correction matrix (CCM) must be applied to the data.\\ |{{ http://ydadmin.rdbuy.com.cn/ueditor/php/upload/image/20230802/1690954548932696.png }}| ^ Figure 6: After applying the CCM, colors are converted into a well-defined color space (sRGB) ^ **5. Gamma**\\ Whether inspecting dark or bright areas in the image, up to this step, the image data remains linear. Therefore, doubling the light intensity doubles the values in the image. To achieve correct representation on output devices, a gamma function is typically applied to the image. This curve is applied in the final stage of image processing, because from this point on, the image data becomes non-linear, beginning to approximate the image as perceived by the human eye.\\ | {{ http://ydadmin.rdbuy.com.cn/ueditor/php/upload/image/20230802/1690954575477073.png }} | ^ Figure 7: Upon completion, the RAW image is converted into an sRGB image ^