The magazine of the Melbourne PC User Group
Understanding RAW Data From Cameras
Lawrie Weston |
|
|
Roll up you sleeves and follow Lawrie Weston on a ride into parts where few
venture to travel |
Whereas JPEG (*.jpg), Bitmap (.bmp) & TIFF (*.tif ) are types of image files,
RAW is not an image file, it is a data file. You don't actually open and view a
RAW file, you process it into an image file. Likewise, you cannot take a raster
file such as TIFF, and convert it to, or save it as a RAW file. RAW is just what
it says; the raw, unprocessed data captured by a digital camera's sensors.
|
Lawrie writes, "This article does not purport to be a scientific paper. The
single objective is to provide the amateur photographer and the interested lay
person with a general understanding of the RAW data that is used to create
digital images." |
However, in this article I will use the term as if it were a file, because the
data can be copied, moved and deleted.
Before we can understand RAW data, or why there are different types, and how
they are used, first we must become familiar with how digital images are created
by a camera's image sensors.
Image Sensors
Image sensors collect visual information from the light entering through the
camera lens and they save it as RAW data that can then be converted into image
information. This information can then be manipulated, stored and later
reproduced for viewing.
With RAW files, the sensor information is stored and can then be converted at a
time convenient to the User.
Figure 1 shows the basic construction of an image sensor. We will not be
covering Foveon technology for purposes of simplification.
It must be pointed out that these sensors are very small and there are lots of
them. The micro lens on each sensor is not to be confused with the Objective
(Image-forming) Lens of the camera.
The light-sensing device, (CCD or CMOS in this example) is really a greyscale
device and relies on a filter to give it a colour reference. It is worth noting
that the bit-depth of most sensors is 12-bit. When a camera processes the
incoming data and creates an image, (say) either a TIFF or JPEG prior to
storage, only 8-bitdepth is used; the extra information is discarded. When the
sensor information is stored as RAW data, the 12-bit-depth colour space is
retained.
Sensor Layouts
Sensors are laid out patterns which vary with the manufacturer. The most common
CCD & CMOS based digitisers use some type of a "Bayer" pattern.
Figure 2 shows two different sensor layouts. Although the layout of a "normal"
CCD is much the same as the layout of pixels, it must be said that the
similarity ends at that point.
Depending on bit-depth, a pixel can be any shade of any colour up to 3 x 216 (RGB)
individual colours in the case of "16-bit" colour, while a sensor is limited to
one colour and usually 212 shades.
Since the imaging device itself is a greyscale device, it is recording 4096
shades of the light passed by its coloured filter.
Therefore, the raw image information of a picture depends on the number of
sensors, how they are laid out, what colour they represent (ie. the filter
colour of the sensor) and the value of light recorded by the (CCD) device. Not
the number of Megapixels of the imaging device.
You may have noticed that there are different types of RAW information. Why are
there differences in RAW information?
There certainly are differences in names, to begin with. For example, Nikon call
theirs "nef", while Canon call theirs "crw" and Pentax call theirs "pef". There
is different "RAW" for almost every brand of digital camera. In fact sometimes
the RAW is different in different models from the same camera maker.
To some extent this is the natural result of camera manufacturers using
different layouts for the sensors. The most common being a "Bayer" pattern grid;
Fuji use Super CCD and Sigma use "Foveon".
Since we have differences in Sensor design, we can now see that there must also
be differences in RAW information.
Does This Cause Any Problems?
Until there is a standardised sensor-chip design, and some makers seem to be
settling for a standard of 8 Mp, the problem exists that some time in the
future, there may be RAW files that you are unable to open in some future
editing software. For this reason it would be wise to keep any software that
currently will open your RAW files. It would also be a good idea to store TIFF
versions in the highest quality for which you can afford the space. For example
I save all my best images as 16-bit TIFF, uncompressed, on data DVDs.
The variation in proprietary RAW formats is a cause of much concern to users of
the RAW format.
"As the use of RAW image files increases, imaging professionals and devoted
amateurs are faced with a proliferation of proprietary RAW formats, often
different for each successive camera model from each camera manufacturer. The
absence of a robust, common standard for RAW image file formats has resulted in
significant disruptions in digital image workflow and limitations in the choice
of software tools"
OpenRAW.Org 2006 RAW Survey, Calvin Jones & Juergen Specht.
Cameras that do not have the facility to store the RAW data, will process it
in-camera either as a level of JPEG or as a TIFF or BMP file before saving the
final image on a memory card.
Figure 3 shows a standard sensor layout using red, green and blue filters in
what is known as a "Bayer" pattern.
The RAW information from neighbouring sensor sites is interpolated into pixels
information by an appropriate formula.
How We Get The Colour Information
Visible light comprises 3 primary colours, Red Green and Blue. In the previous
illustration, we see that one each of red and blue filtered sensors and two
green filtered sensors make up a block of four sensors, which provide
information of the average colour falling on those four sensors.
Why More Green Sensors than Red and Blue?
Our eyes are most sensitive to the differences in shades of green to determine
the sharpness of an image. Also the green channel is used to obtain "Luminance"
(brightness) values in an image.
How Many Colours?
Depending on the bit-depth, the colour black would be described as 000000 (H)
for 8-bit colour, or 000000000000 (H) for 16-bit colour.
Staying with 8-bit colour, full red would be described as FF0000 (H), full green
as OOFFOO (H) and full blue as 0000FF (H).
Yellow would be described as FFFFOO (H) and 50% grey 080808 (H)
That said, some manufacturers use a grid with the subtractive colours Cyan,
Magenta and Yellow, but also with a green sensor.
Either way, a normal RGB "Bayer" RAW (un-processed) image can account for 2 x
2'2(4096) shades of grey for each colour.
After interpolation this would then become 28(256) or 2'6(65,536) shades of each
colour depending on the bit-depth chosen.
Note: 8-bit colour is what was formerly referred to as "True-colour" or 24-bit
because there are 3 colours, each of 8-bit depth. These terms are no longer
commonly used.
A Four Sensor Example
Looking at a group of Sensors as illustrated in Figure 5, we see that sensors A
and D register the value of colour passed by the green filters of group ABCD,
likewise Sensor B records the value of colour passed by the blue filter and
Sensor C records the value passed by the red filter. From that raw information
we can create a colour value for a pixel of the size of the ABCD block. We could
also create 4 smaller pixels of the same value.
At this point I will draw your attention to the fact that these four sensors do
not live in isolation. They have other sensors around them. Thus all the sensors
described above have an association with other adjacent sensors, which would
come into calculation. Therefore, the smaller pixel generated at site A, need
not be the same colour as the one generated at site D.
This illustration holds only for a "Bayer" pattern "Normal" sensor layout. If
you look again at the "Super CCD" illustration in Figure 2 you will see that the
sensors are not laid out neatly in rows and columns. Also, Figure 4 shows that
not all sensor layouts are RGB.
Suffice to say that the RAW information of an image contains all the information
recorded by the sensors and is not a digital image until after interpolation.
RAW File Sizes
Since the RAW data hasn't been processed into pixel information, the file sizes
are usually smaller than a TIFF file. Therefore, if your camera can record RAW
data, you will hold more images on your memory card than if you use TIFF or BMP,
while keeping 12-bit
colour detail. However, they are considerably larger than JPEG files.
Opening RAW Images
Cameras that come with the RAW format will also have software that converts RAW
image data to a raster file, which can then be manipulated by image-editing
Software.
The two major methods of RAW image conversion listed in the OpenRAW.Org 2006 RAW
Survey as having the best quality and the best workflow were
- The camera-makers software and
- Adobe Camera RAW.
Together they account for 67% in the "best quality" response and 63% of the
"best workflow" response. The remaining responses were spread over the remaining
seven options.
We will quickly review the two major methods.
Camera Makers Software
Canon's "Raw Image Converter 2" is illustrated in Figure 6, below. The RAW
images to be converted are added to the top box of the lower image, where the
various parameters are set.
The upper image shows the file save options:
- JPEG with compression ratio setting
- TIFF 8 bit / channel
- TIFF 16 bit / channel
The only pre-processing option in this converter is a Sharpness setting. Other
camera manufacturers and perhaps later versions of the Camera Maker's Software
will probably give more pre-processing options.
Adobe Camera RAW
This was the highest rated RAW processing option from the 2006 RAW Survey.
Fortunately, you don't need to spend a fortune purchasing Adobe Photoshop CS2,
as it is also available in Photoshop Elements 3 & 4, which can be bought for
around $150.
I will be using this latter version in the following description.
In Figure 7 we see the Camera RAW opening window. Before interpolation is done,
there are several pre-processing options.
These will be applied as the RAW image is processed to, in this case, a
Photoshop format (*.psd).
The following options are available:
- White balance adjustment
- Colour temperature and tint
- Exposure
- Shadow detail
- Brightness & Contrast
- Saturation
Also at the bottom left, is the option to open as a 8-bit or 16-bit image.
In Figure 8 the colours have been changed manually prior to opening these
adjustments will be applied to the RAW information during interpolation.
Figure 9 shows the detail adjustments to be applied during digitising.
The amount of pre-digitising adjustment in Adobe camera RAW places it as the
highest rated option in the 2006 RAW survey.
Finally it must be noted that there are other options for opening RAW images not
covered here and some other products such as Capture One and the recently
released Pixmantec Raw Shooter essentials bundled with Corel X3 Graphics suite,
could also be worth having a close look.
Reprinted from the July 2006 issue of PC Update, the magazine of Melbourne PC User Group, Australia
|