Digital Outback Photo
- Photography using Digital SLRs

 

The Art of Raw Conversion #007

David Coffin's "dcraw"

Convert all Raw Files on any OS Platform

article by David Coffin (4/25/2003)

 

 
 
 
 

What is dcraw?

Quite simply, it's an ANSI C program to decode any raw image from any digital camera on any computer running any operating system. It is a unique and vital tool in the world of digital photography.

Thousands of people use dcraw without knowing it, as Bibble, BreezeBrowser, IrfanView, Conceiva, and the Adobe Camera Raw plugin all contain source code from dcraw. After six years and 1500 hours of unpaid labor, dcraw now supports fifty-eight cameras from seven different manufacturers, in only 2600 lines of C code.

dcraw fills a serious void left by camera makers, who refuse to release any documentation or source code describing their raw file formats. Even worse, many of these formats use secret algorithms to compress image data into an inscrutable pile of random ones and zeroes.

Without dcraw:

  • Raw photos can only be decoded in Windows or MacOS. Users of other operating systems are out of luck.
  • Windows programmers who write image viewers are at the mercy of buggy, poorly documented "developer kits". None of these kits allow direct manipulation of raw data.
  • There is no guarantee that archived raw photos will be readable five, ten, or a hundred years from now. Even today, some decoding software won't work beyond Windows 98, while Dell ships laptops that only run Windows XP.

dcraw follows the UNIX philosophy of "do one thing and do it well". I'm always eager to add new camera formats, but I rarely accept new features. dcraw has no user interface except command-line arguments, and it writes only three output formats.

dcraw.c is kept under strict revision control, with the full history available for download. Each new revision must be tested against my entire photo collection before the code is released.

Because of its clean design and free license, other programmers easily add the features they need, or cut and paste dcraw.c into their own software. Those who send a donation receive a CD-R containing sample photos from all supported cameras.

Running "dcraw" with no arguments shows this message:

        Raw Photo Decoder v4.64 with Lossless JPEG support
        by Dave Coffin (dcoffin@shore.net)
		 
        Usage: dcraw [options] file1 file2 ...
		
        Valid options:
        -i Identify the first file and exit
        -c Write to standard output
        -f Interpolate RGBG as four colors
        -g <num> Set gamma (0.8 by default, only for 24-bit output)
        -b <num> Set brightness (1.0 by default)
        -w Use camera white balance settings if possible
        -r <num> Set red multiplier (daylight = 1.0)
        -l <num> Set blue multiplier (daylight = 1.0)
        -2 Write 24-bit PPM (default)
        -3 Write 48-bit PSD (Adobe Photoshop)
        -4 Write 48-bit PPM

I recommend starting with "dcraw -w file", and experimenting with the other options later.

For GIMP users, I recently wrote a plugin to load raw files. With a few mouse clicks, it calls "dcraw -c", and pipes the output back into The GIMP.

 

 

 
 
 
 

For Comments post in our News Group

2000-2007 Digital Outback Photo