Bayer images contains only one color channel information per pixel (each pixel is red or green or blue).
To get full-colored image from raw bayer data one need to
1) decode bayer (one component per pixe) data
2) do demosaic (de-bayer) so:
- apply white balance
- interpolate color data for missing color values
- convert to output color space
- do gamma correction.
In LibRaw this is made by this call sequence:
open_file() ; // read image metadata
unpack(); // decode bayer data
dcraw_process(); // white balance, color interpolation, color space conversion
dcraw_make_mem_image(); // gamma correction, image rotation, 3-component RGB bitmap creation
Bayer images contains only one color channel information per pixel (each pixel is red or green or blue).
To get full-colored image from raw bayer data one need to
1) decode bayer (one component per pixe) data
2) do demosaic (de-bayer) so:
- apply white balance
- interpolate color data for missing color values
- convert to output color space
- do gamma correction.
In LibRaw this is made by this call sequence:
open_file() ; // read image metadata
unpack(); // decode bayer data
dcraw_process(); // white balance, color interpolation, color space conversion
dcraw_make_mem_image(); // gamma correction, image rotation, 3-component RGB bitmap creation