📘 Image Format Comparison Manual

Bayer RAW vs RGB24


1. Overview

This section provides a comparative overview of two commonly used image formats: Bayer RAW and RGB24. Understanding their structure, advantages, and use cases is essential for image processing, computer vision, and camera system integration.


2. Bayer RAW Image

🔷 What is Bayer RAW?

A Bayer RAW image is a type of raw image format captured directly from the image sensor. It contains unprocessed pixel data arranged according to the Bayer filter mosaic, a color filter array (CFA) used to separate light into red, green, and blue components.

🔹 Characteristics:

  • Single-channel image: Each pixel contains data for only one color (R, G, or B).
  • Mosaic pattern (typically RGGB, GRBG, etc.)
  • Requires demosaicing to reconstruct full-color images.
  • Offers maximum flexibility for post-processing (white balance, noise reduction, etc.)
  • Smaller file size compared to fully processed formats.

🔹 Bayer Pattern Example (2x2 block):

R G  
G B

3. RGB24 Image

🔷 What is RGB24?

An RGB24 image is a fully processed, true-color image format where each pixel contains three 8-bit channels: Red, Green, and Blue. It is the standard format used in most displays and image files (e.g., PNG, BMP).

🔹 Characteristics:

  • Three-channel image: Each pixel has full RGB color data.
  • Image is ready for display with no further processing required.
  • Larger file size compared to Bayer RAW.
  • Less flexible for advanced post-processing.

🔹 Memory layout per pixel:

  • 3 bytes per pixel (1 byte each for R, G, B)
  • Linear array: [R][G][B][R][G][B]...

4. Side-by-Side Comparison Table

Feature Bayer RAW Image RGB24 Image
Color Channels per Pixel 1 (R, G, or B) 3 (R + G + B)
File Size Smaller Larger
Post-Processing Needed Yes (demosaicing, etc.) No (ready to use)
Flexibility High Low
Common Use Case Camera sensor output Display, editing
Processing Speed Slower (needs conversion) Faster (already processed)

5. Use Case Summary

Use Case Recommended Format
Camera Sensor Output Bayer RAW
Real-Time Display RGB24
Image Editing Pipeline Bayer RAW
Final Output Image RGB24

6. Visual Representation

Bayer RAW (Simulated):

[ R ][ G ]  
[ G ][ B ]

RGB24 (Example per pixel):

[255, 0, 0]   → Red  
[0, 255, 0]   → Green  
[0, 0, 255]   → Blue

7. Conclusion

  • Bayer RAW is ideal for scenarios requiring high dynamic range, custom processing, or low-bandwidth transmission.
  • RGB24 is perfect for display-ready applications and systems with limited processing capabilities.

Understanding these formats allows developers and engineers to make informed decisions based on performance, quality, and application requirements.