Shutterbugs have found big power in understanding and manipulating digital photos in RAW formats. Linux lovers have the perfect tool for harnessing the RAW power in Digikam, via the built-in LibRaw. Want to claim the power for your own photo efforts? Read on and I'll show you how to tame RAW photos on Linux with Digikam.
Which Version of Digikam?
Choosing which version to use was the hardest part of writing this article — the excellent Digikam development team, led by Gilles Caulier, have been shoving releases out the door at an astonishing rate, and 2.0 beta4 was just released. The 1.x series is no longer supported as the Digikam team are working towards a stable 2.0 release, scheduled for June 2011. Debian Sid and Ubuntu 10.04 (Lucid) have version 1.2 , and Ubuntu 10.10 (Maverick) ships with 1.4. If you want the latest beta release without compiling from sources, you can use Phillip Johnsson's PPA (Personal Package Archive) repository for Maverick. Don't use this if you need a stable, reliable system.
I tried Fedora 14, which has Digikam 1.9, and had various misadventures, so after all that futzing with distros I went back to good old Debian Sid and Digikam 1.2. It works. Even if Digikam 2.0 makes drastic changes to the interface the principles and editing tasks are the same, so hitch up your pics and follow along!
Lower-end digital cameras support only JPG. Higher-priced cameras support JPG, RAW, and sometimes TIFF. This is an artificial distinction as lower-priced cameras can shoot RAW just like their more expensive siblings. When some brainiac figures out cool hacks, as with CHDK, the Canon Hack Development Kit for Canon point-and-shoot cameras, all kinds of advanced features are unlocked.
JPG is a lossy 8-bit file format. At 8 bits you have 256 brightness levels. The camera, which is really a little computer, manipulates the sensor data to create the photo: white balance, contrast, brightness, and color hue and saturation. Then it applies whatever compression level you have set. A higher compression ratio results in smaller file sizes, and that smaller size comes at a cost of throwing away information.
RAW files are minimally-processed sensor data. There isn't a single RAW file format, because all the camera vendors like to use their own special secret RAW formats. The big "secrets" are headers and image metadata such as date, exposure, and ISO settings. Most RAW files are based on the TIFF file format.
Most camera RAW files are saved at 12- or 14-bit depth; your cameral manual should tell you. (CHDK-supported cameras are usually 10 bits.) This is converted to a 16-bit file by your RAW converter, and then you have 65,536 brightness levels. Working in RAW gives you much greater dynamic range for editing, and more scope to rescue photos with exposure, noise, sharpness, or white balance problems.
So always shoot in RAW, right? No. File sizes are large, and on many cameras shooting RAW is slower. Casual snapshots, or photos taken under perfectly-controlled conditions don't need to be in RAW. There is no universally right choice and you must use what pleases you.
Manual or Automatic RAW Import
You can have RAW images imported automatically when you open a photo in the editing window, or do it manually. Configure this in Settings > Configure Digikam > Image Editor. Un-check the "Use Raw Import Tool to handle Raw images" box to make the image editor import RAW images automatically with your default settings. I fiddle with the settings a lot and can't settle on a decent default set, so I leave the box checked to give me more tweakability.
What All Those RAW Settings Mean
Now let's go to the RAW Decoding section and learn what all these strange-sounding settings mean.
First make sure that Demosaicing — 16-bit color depth is checked. Demosaicing is the process of translating data from the camera's sensor into detailed photos with many colors. Camera sensors are made up of pixels in the three primary colors red, green, and blue (RGB). If this is not checked it imports at 8 bits, and then you might as well just use JPGs.
On the Quality drop-down menu there are four choices: Bilinear, VNG, PPG, and AHD. What do these mean? That is a long story. The short story is Bilinear is the fastest and lowest-quality, and AHD is the slowest and highest-quality. However, it is not that cut-and-dried, and the best way to figure out which one gives the best results for you is to try all of them.
Interpolate RGB as Four Colors is occasionally useful. Most camera sensors use what is called a Bayer array. (Some Sigma and Sony cameras, to give two examples, do not use Bayer array sensors.) These have twice as many green pixels as yellow or blue pixels, because our eyes are more sensitive to green. Using more green pixels results in an image with less noise and finer details. Sometimes the rows of green pixels create a mesh effect with VNG, or a maze effect with AHD, or other undesirable artifacts. If this happens then check Interpolate RGB as Four Colors; otherwise leave it un-checked.
Do Not Stretch or Rotate Pixels is for Fuji Super CCD cameras. It tilts images 45 degrees, so that each output pixel corresponds to one raw pixel. It is also for cameras with non-square pixels. Leave it un-checked for everything else. How do you know if your camera has square pixels? Most digital cameras have square pixels. Square pixels make accurate aspect ratios and sizes, so 1024x768 is always 1024x768 whether it's a still camera, movie camera, or TV screen. The most common exceptions are the 480i and 576i digital video standards. On these a 100-pixel line appears as different lengths on different devices.
The Median setting controls how many times the median filter is applied to your picture. A median filter reduces noise without blurring the edges. Sometimes multiple passes produce a better result; trial and error will tell you.
Getting the white balance right makes your colors render correctly. You've seen indoor photos that looked yellow from incandescent lighting, or bluish from fluorescent lights. Your camera will probably have white balance settings, so a good default is Camera. If you shot the wrong white balance then one way to fix it is right here, by using the Manual setting. White balance is characterized as being cool or warm; a bluish cast is cool, while a yellowish/reddish cast is warm. This is expressed in Kelvin temperatures. Colors 5,000K and higher are warm, and lower are cool. You can easily see this in action in Digikam using the T(K) slider.
The Green slider is actually a Green/Magenta slider, which is another tool for correcting white balance.
The Highlights choices — Solid White, Unclip, Bend, Rebuild, are all different ways of repairing blown highlights, which are overexposed portions of your images. Try Rebuild or Blend first; sometimes they do a pretty good job. Unclip gives them a pinkish hue. Solid White makes them plain white and doesn't try to fix them, and it makes the smallest changes to your photo.
The Level slider is for the Rebuild tool. Low values emphasize whites, and higher values are for colors.
Auto Brightness is just what is says, an automatic brightness leveler. For more control un-check this.
Many digital cameras have noise reduction. You have more control in Digikam, so try turning it off in your camera and using Digikam instead. The default Threshold value is 100; lower values apply less noise reduction, higher values apply more.
Enable Chromatic Aberration Correction is fast and easy when you already know the red and blue correction values for your lenses. Often this is available at the manufacturer's Web site.
This is a big and important topic for another day — the short story is Digikam has tools for precise and correct color rendering.
Saving RAW Files
You don't want to save your RAW files in the same way as other files. RAW files should always be preserved unchanged; they are your source files so you don't want to mess them up. When you are finished editing a RAW photo file, save it as a TIFF file for highest quality. Then this TIFF is your master file for exporting to lower-quality formats, or editing further.