J MICHAEL SULLIVAN Photography

On Bayer Artifacts and RAW conversion

All Bayer-array digital cameras have an inherent weakness, namely that the use of a 2x2 array comprised of one red, one blue, and two green sensors to derive not ONE but FOUR output RGB pixels results in much faked data. It is not surprising that the sensor's algorithm for interpolating the missing pixels at times produces noticable patterns. These patterns are most noticable in even-toned areas of the data. In particular, the red and blue channels exhibit areas of blotchy patterns upon close inspection of un-doctored data. We shall call these noticable patterns "Bayer Artifacts". (Note: Foveon digital sensors do not exhibit such patterns as there is a one-to-one relationship between color sensor and output pixel). Perhaps a more accurate description of a Bayer Array sensor would have listed each 2x2 array as a single pixel. But marketing forces encouraged camera manufacturers to "pump up the numbers". It would not be unfair to say that the Canon 1DS is really just a 4 megapixel device.

In order to demonstrate the effect of such patterning, we need to capture an image where neither the lens nor the subject matter contribute to any noticable patterns themselves in the data. To achieve this requirement, we use an out-of-focus color target to provide pure unadulterated sensor data. The image was captured in RAW with a Canon 20d, custom white balance, 85mm lens, using studio lighting and a tripod (not that it mattered given the out-of-focus nature of the image).

Personal aside: I rarely use Adobe RAW conversion as I determined long ago that it did things to the data that I did not like. So in spite of all the available controls it provides, I have tended to avoid it, prefering instead the simpler Canon RAW conversion. As such, I am intimately familiar with Bayer Artifacts as the Canon RAW conversion does not attempt to eliminate them

For this test, two popular RAW conversion tools were used to convert from the native Canon RAW format to Adobe Photoshop format. Adobe RAW has achieved rave reviews as it is much more than just a conversion tool -- it significantly enhances the data in the following ways:

  • increases per channel contrast
  • reduces noise in all three channels
  • reduces Bayer artifacts
  • provides a small amount of sharpening

Digital images PROCESSED (my emphasis) by Adobe RAW look great, as indeed they should -- they have been enhanced greatly!!

Canon RAW is much simpler, as it only converts the data from one format to another and does not attempt to enhance the data like Adobe RAW does. As such, the Canon RAW conversion is much more "raw" (and a better representation of the original data captured by the sensor) than Adobe RAW.




Diagram 1: Canon RAW converted file of out-of-focus color chart using default settings


Diagram 2: Adobe RAW converted file of out-of-focus color chart using default settings

Not much can be seen from the two images above other than the Adobe one has more contrast. Note: the red boxes indicate the areas we will focus on for the remainder of this article. Keep this in mind: both images are derived FROM THE SAME FILE.

I chose a neutral grey region of the data to best demonstrate the concept of Bayer Artifacts. This region was copied and zoomed in Photoshop 400%. I took a screen capture of each channel at 400% so that one could readily see the true nature of the data delivered by Bayer array digital sensors. To make this patterning even more prominent, I use auto levels to increase the contrast in the enlarged channel screenshot.

Canon RAW

The following three images are using Canon RAW conversion.


Diagram 3: Screenshot @ 400% of Canon RAW red channel


Diagram 4: Screenshot @ 400% of Canon RAW green channel


Diagram 5: Screenshot @ 400% of Canon RAW blue channel

The un-enhanced Canon RAW data does not lie. What you see here is what is recorded by the sensor itself. One can draw some conclusions from the above (unenhanced) RAW data. As expected, both the red and blue channels exhibit noticable patterning. This visible patterning represents the Bayer Artifacts. This is not merely noise (although noise does contribute to it), rather, it is the inability of the sensor's interpolation algortithm to deal effectively with broad areas of smooth data (such as skies). It is thus not surprising that many people simply have never noticed this before as "noisy" images by and large mask such patterns. It is also not surprising that the green channel is the smoothest and exhibits the least amount of noise as there are twice as many green color sensors as there are red or blue when it comes to a Bayer array sensor. In short, Bayer Artifacts are most noticable in smooth areas of even tonality especially in the red and blue channels.

It is important to understand that *ALL* Bayer sensors exhibit this feature and that the data above are not CAUSED by the Canon RAW conversion, but rather truthfully represent what the sensor is storing as data.

Adobe RAW

Adobe RAW attempts to eliminate these Bayer Artifacts as their presence clearly degrades image quality (however, it should be noted that these patterns are REALLY THERE IN THE DATA -- the sensor itself cannot capture data faithfully since it has only one red or blue sensor per every FOUR pixels and must guess what the missing data should be). Thus, Adobe (and others such as Noise Ninja, see below) have created clever algorithms to deal with these blotches effectively. This can readily be seen in the Adobe RAW processing of the original Canon RAW file:


Diagram 6: Screenshot @ 400% of Adobe RAW red channel


Diagram 7: Screenshot @ 400% of Adobe RAW green channel


Diagram 8: Screenshot @ 400% of Adobe RAW blue channel

The patterns have disappeared -- poof!! Some very strong processing has gone on here. What is clearly different with this data set is that the Adobe processing sacrifices some green channel resolution in exchange for significant reduction in noise and Bayer Artifacts in the red and blue channels. The appearance of greater "noise" in the green channel as compared to the Canon RAW green channel is likely from the touch of sharpening that Adobe RAW is purported to do as part of its enhancement feature list. Most users welcome this enhancement as it clearly makes the image look better. However the result is an image that has LOST detail!!! -- hence the need to sharpen the output to make up for it.

The above comparisons should leave no doubt that images processed by Adobe RAW are greatly enhanced from the original data. Most photographers would say that this results in an improvement, and with that it is hard to argue. However, whenever a comparison of one digital file to another is done in press or online (for example, the recent Luminous Landscape feature comparing drum scanned film to a Canon 1Ds), it is critical that Adobe RAW *NOT* be used since it effectively "improves" the data by increasing contrast, reduction of noise and artifacts, and slight sharpening. It is no wonder that Michael Reichman of Luminous landscape came to the following (erroneous) conclusion: that the 1Ds is almost as sharp as 4x5 drum-scanned film.

Noise Ninja

One last note. Just to demonstrate *how* Adobe RAW conversion enhances data, we will use post processing on the Canon RAW data to approximate what Adobe RAW is doing during its conversion/enhancement routine. Below are three channel images of the Canon RAW data after it had been post-processed with the Noise Ninja plugin for Adobe Photoshop.


Diagram 9: Screenshot @ 400% of Canon RAW + Noise Ninja red channel


Diagram 10: Screenshot @ 400% of Canon RAW + Noise Ninja green channel


Diagram 11: Screenshot @ 400% of Canon RAW + Noise Ninja blue channel

As you can see, using Noise Ninja has eliminated most of the Bayer Artifacts as well, approximating the over-all effect of the Adobe RAW conversion. (it should be noted that Noise Ninja RADICALLY attempts to eliminate all noise, hence the "softer" look of the data. Clearly Adobe RAW is not as heavy-handed). The conclusion we can draw is this: That Adobe RAW processes and enhances the original RAW data in much the same way as Noise Ninja does.

Summary

Comparing a digital image that has been enhanced and processed by Adobe RAW to another un-enhanced digital image (such as a drum scan or direct output of a BetterLight digital back) is a patently flawed methodology and represents not just an apples-to-oranges comparision, but unfairly benefits the image that was enhanced at the expense of the image that was not enhanced to the same degree. In short, it is a misleading comparison (although to be fair, it is not necessarily DELIBERATELY misleading). Unfortunately, most magazines and online pubications use Adobe RAW as part of their comparison methodology as it is a defacto standard. However, their conclusions that "digital is almost as sharp as large-format film" are simply untrue and unfounded. In particular, film data (regardless of resolution) will be superior in smooth regions of image data as well as dark regions where digital sensors exhibit significant noise and patterning.




OTHER ONLINE SOURCES RELATED TO THIS ARTICLE

  • BetterLight: The Rest of the Picture



  • © 2006 J Michael Sullivan, all rights reserved.

    www.jmichaelsullivan.com