top of page

Vadzo Varsity Technical Resource

What is a Bayer Filter?

What is a Bayer Filter?

A Bayer filter is a color filter array (CFA) placed on top of the image sensor pixels. It allows each pixel to capture only one specific color of light:

  • Red

  • Green

  • Blue

This filter is arranged in a repeating pattern across the sensor surface.

Common Bayer Pattern (RGGB)

The most common Bayer arrangement is RGGB:

Meaning:

  • 1 Red pixel

  • 2 Green pixels

  • 1 Blue pixel

Green pixels are more because the human eye is more sensitive to green light and brightness details.

Why is Bayer Filter Needed?

Without a Bayer filter:

  • Sensor captures only grayscale image

  • No color information available


With Bayer filter:

  • Each pixel captures one color

  • Full color image can be reconstructed later


So, the Bayer filter enables color imaging using a single sensor.


What is RAW Bayer Data?

RAW Bayer data is the original unprocessed data captured directly from the sensor before any color processing or image enhancement.

It is called "RAW" because:

  • No color conversion yet

  • No compression

  • No white balance                                  

  • No sharpening

  • No noise reduction


It is the pure sensor output.



Important Concept

Each pixel in RAW Bayer stores only one-color value, not full RGB.

Example:

  • Red pixel - stores only red intensity

  • Green pixel - stores only green intensity

  • Blue pixel - stores only blue intensity


So RAW Bayer is not a full-color image. It is a mosaic of single-color intensity values.


How Data is Stored in RAW Bayer Format

In a digital camera sensor, light falling on each pixel is converted into an electrical signal. This electrical signal is analog in nature because light intensity varies continuously. To store and process this information inside a digital system such as a camera processor or computer, the analog signal must be converted into digital form. This conversion is done by a component inside the sensor called the ADC (Analog-to-Digital Converter). The ADC measures the strength of the signal from each pixel and converts it into a numerical value. This numerical value represents how bright the light was on that pixel.

In a Bayer sensor, each pixel does not capture full color information. Instead, each pixel captures only one-color intensity based on the color filter placed on top of it red, green, or blue. So, when the ADC converts the signal into digital form, it stores only one intensity value per pixel. This value represents the brightness of that specific color at that pixel location. These digital values together form what is known as RAW Bayer data, which is the original unprocessed output of the camera sensor.

Common Bit Depths in RAW Bayer

The number of bits used to store each pixel value is called the bit depth. Bit depth determines how many different intensity levels can be represented for each pixel. In RAW Bayer sensors, common bit depths include 8-bit, 10-bit, 12-bit, 14-bit, and 16-bit. Each bit depth defines how many brightness levels a pixel can store.

An 8-bit pixel can store 2⁸ = 256 intensity levels, with values ranging from 0 to 255. A 10-bit pixel can store 2¹⁰ = 1024 levels, ranging from 0 to 1023. A 12-bit pixel stores 4096 levels, and a 14-bit pixel stores 16384 levels. In some systems, data may be stored in a 16-bit container for easier processing, even if the sensor itself outputs only 10-bit or 12-bit data.

Why Higher Bit Depth is Important

Higher bit depth means that the sensor can represent finer differences in brightness. This improves the dynamic range, which is the ability of the camera to capture both very dark and very bright areas in the same image. With more intensity levels available, the camera can capture smoother transitions between light and dark regions without losing detail.

For example, in low-light conditions or high-contrast scenes, a higher bit-depth sensor can preserve more shadow and highlight detail compared to an 8-bit sensor. This results in better image quality and more accurate colour reproduction after image processing. Higher bit depth is especially important in professional imaging, machine vision, and scientific applications where precise intensity information is required.


RAW Bayer Storage Formats

RAW8 Format

RAW8 is the simplest Bayer storage format where each pixel value is stored using 8 bits (1 byte). Since each pixel in a Bayer sensor represents only one color intensity (red, green, or blue), RAW8 stores that intensity value directly in a single byte. The intensity range for RAW8 is from 0 to 255, providing 256 possible brightness levels per pixel. This format is easy to process and requires less storage and bandwidth, but it offers limited dynamic range and lower image quality compared to higher bit-depth formats. RAW8 is commonly used in basic imaging applications where storage efficiency and speed are more important than high image precision. 

RAW10 Format

RAW10 stores each pixel using 10 bits per pixel, allowing intensity values from 0 to 1023. Since standard memory storage is byte-based (8 bits), RAW10 uses packed storage to save space efficiently. Typically, four pixels (4 × 10 bits = 40 bits) are stored in five bytes. The first four bytes contain the lower 8 bits of each pixel, and the fifth byte stores the remaining upper 2 bits of all four pixels combined. RAW10 provides better dynamic range and image detail than RAW8 and is widely used in embedded cameras, mobile cameras, and machine vision systems where a balance between image quality and bandwidth is required.

RAW12 Format

RAW12 uses 12 bits per pixel, providing intensity values from 0 to 4095 and offering significantly higher dynamic range and precision. Like RAW10, RAW12 also uses packed storage to optimize memory usage. Typically, two pixels (2 × 12 bits = 24 bits) are stored in three bytes. RAW12 captures finer brightness variations and improved image detail, making it suitable for applications that require better image quality, such as industrial inspection, medical imaging, and high-end embedded vision systems. Although it requires more bandwidth and storage than RAW8 and RAW10, the improved image quality makes it a preferred choice in many professional camera systems.

RAW16 Format

RAW16 stores pixel values in a 16-bit container, even if the sensor output is only 10-bit or 12-bit. In this format, each pixel occupies two bytes in memory, making storage straightforward and easy to process without complex bit packing. The extra bits are often unused or padded with zeros, but using a 16-bit container simplifies software processing and alignment. RAW16 provides very high dynamic range and is commonly used in scientific imaging, high-end industrial cameras, and applications where maximum precision and easy data handling are more important than storage efficiency. However, it consumes more memory and bandwidth compared to packed formats like RAW10 and RAW12. 


Why RAW Bayer is Important

RAW Bayer data is extremely important in modern digital camera systems because it represents the pure, unprocessed output directly from the image sensor. When a camera sensor captures light through the Bayer color filter, each pixel records only the intensity of a single color (red, green, or blue). This original information is stored as RAW Bayer data before any processing such as color correction, white balance, compression, sharpening, or noise reduction is applied. Since it contains the complete and untouched sensor information, RAW Bayer data preserves the maximum possible image detail and dynamic range, making it highly valuable for image processing and computer vision applications.

One of the primary reasons RAW Bayer is important is that it provides maximum image quality and flexibility. When an image is processed inside a camera and converted into formats such as JPEG or H.264, several processing steps are applied automatically, including compression and color enhancement. These processes permanently alter or discard some of the original sensor data. In contrast, RAW Bayer retains the full sensor output without any modification, allowing engineers or developers to perform custom image processing based on their application requirements. This flexibility is critical in applications such as machine vision, embedded systems, scientific imaging, and medical imaging, where precise image analysis is required.

Another important aspect of RAW Bayer data is that it allows complete control over image processing algorithms. Since the data is unprocessed, developers can apply their own algorithms for demosaicing, white balance, noise reduction, gamma correction, and color correction. This level of control is especially useful in industrial and embedded vision applications where default camera processing may not be suitable. For example, in automatic license plate recognition (ALPR), barcode detection, or AI-based vision systems, engineers often prefer RAW Bayer data because it allows them to optimize image quality for detection accuracy rather than visual appearance.

RAW Bayer data is also essential because it is the starting point of the Image Signal Processing (ISP) pipeline. Before an image can be displayed or encoded into video formats, several processing steps must occur. These steps typically include black level correction, gain adjustment, demosaicing, color correction, gamma correction, and conversion to RGB or YUV format. All these processes rely on the original RAW Bayer data. Without RAW Bayer input, the ISP would not have the necessary information to reconstruct a high-quality color image. Therefore, RAW Bayer serves as the foundational data for all subsequent image processing operations in a camera system.

In addition, RAW Bayer data plays a significant role in advanced imaging and research applications. Many high-end cameras, industrial cameras, and embedded vision systems provide RAW Bayer output so that developers and researchers can perform detailed image analysis and enhancement. Since RAW Bayer preserves the full bit depth of the sensor (such as 10-bit, 12-bit, or 14-bit), it offers better dynamic range and more accurate intensity information compared to compressed image formats. This makes it particularly useful in low-light imaging, HDR imaging, and AI-based vision processing.

Feature

Bayer Sensor

Mono Sensor

Color image

Yes

No

Light sensitivity

Lower

Higher

Used in

Normal cameras

Industrial/ALPR

Processing needed

Demosaic required

No demosaic


Related Articles

Related Article Title

04th Jan 2026

Related Article Title

05th Jan 2026

Related Article Title

06th Jan 2026

Contact Us

bottom of page