A Small RAW Decoder Comparison

(dcraw, dcraw_ahd, Bibble)

This page is ancient history

Today's digital photography world is quite different than what it was in 2005 when this comparison was performed. This page has no relevance today, but is left lingering on the Internet just for fun.

Introduction

Many digital cameras can output the unprocessed raw image data coming from the sensor. CCD/CMOS sensors only record one color for each pixel and the real color for a given pixel has to be interpolated from the surrounding pixels. This process is called demosaicing and there are many different algorithms for doing it. Most, if not all, raw processing software authors claim their algorithm is the most advanced in the market and provides the highest quality output possible.

I'm mostly interested in Dave Coffin's marvelous dcraw because it's open source, clean ANSI C and can easily be integrated into any kind of raw workflow. The main reason I bought Bibble was the fact that at the time it seemed to provide the highest quality output I could get on Linux (and it still excels in highlight recovery). Dcraw provides notably sharper images with more details, but at the cost of introducing color artifacts.

Dcraw uses the Variable Number of Gradients Method for demosaicing. Anyone who owns a sharp lens and has used dcraw knows that this algorithm produces clearly visible (shown below) color artifacts that probably could, to some extend, be automatically removed in the post processing. Fortunately, an algorithm exists which produces just as detailed an image with practically no color problems. This algorithm is called Adaptive homogeneity-directed demosaicing algorithm (AHD) and is invented by Keigo Hirakawa and Thomas W. Parks. The algorithm is explained in [1] and [2]. An algorithm without a practical implementation is useless, and here Paul Lee enters the picture with his excellent implementation of AHD for dcraw, dcraw_ahd.

The Comparison

The following software was used.

The command line for dcraw and dcraw_ahd was

dcraw -2 -w -c original.nef | convert - dcraw.tif

For Bibble the default settings were used too and sharpening was turned off. The color balance between Bibble and dcraw with default settings seems to be close enough, so no fine-tuning was done. Bibble has three levels for color artifact reduction: Standard, Strong, Strongest. It seems the setting doesn't affect at all the sharpness of the image but only the colors. The samples below include two version from Bibble, one with fringe reduction set to Standard and one for Strongest.

Dcraw produces 10 pixels wider and taller images than Bibble (which in turn produces larger images than the JPEGs on Nikon D70) so the images generated with dcraw(_ahd) were cropped using mogrify.

mogrify -crop 3028x2002+5+5 dcraw.tif

Then the four .tif images were chopped to a series of 642x428 images.

for i in *.tif; do convert -crop 642x428 -quality 90 $i img/`basename $i .tif`.jpg ; done

Results

Move the mouse cursor over the image to change it. Use the menus to select which image is shown when mouse is not on the image (Mouse out) and which is shown when mouse is on the image (Mouse over). There are 6 different images to compare and the image can be selected from the, you guessed it, Image menu.

If the Javascript doesn't work for you, please take a look at the image directory. They are the very same images you'd see below. You still need a way to flip them very easily to see the small differences, however.

Image:

Mouse out:       Mouse over:

Some notes of the images:

Conclusions

My main motivation for writing this was to show that with the new demosaicing algorithm written by Paul Lee, dcraw_ahd shows superior sharpness and detail without color artifacts compared to Bibble which I've used to date. The color artifacts of dcraw have really been a show stopper for me, and as was already stated, this image is not a worst case scenario for dcraw.

Bibble's highlight recovery works very well, and when used properly, can be used to extend a bit the narrow dynamic range of todays digital cameras. Frankly, we're talking of only about a half stop or so here, but it's still better than losing it.

Dave Coffin and Paul Lee have done a great job, and dcraw is finally producing really high quality output that I've seen previously only with commercial raw decoding software, which are, interestingly enough, often based on the original dcraw for reading the raw files, but with improved demosaicing algorithm.

It should also be noted that the images here are 1:1 crops so the differences are quite small after all and aren't visible in small prints. In medium sized prints they start to show up, and in large prints they really matter.

Contact

Please don't hesitate to contact me for corrections and positive or negative comments. Also if you know a really bad-ass raw conversion software that produces better output than dcraw, please use it to convert the original.nef to TIFF or good quality JPEG without sharpening or other heavy processing, and send me the URL in email. Please don't send the file as an email attachment.

Sakari Tanhua <stanhua@cc.hut.fi>
2005-08-01

Valid CSS!   Valid HTML 4.01!