This is a read-only archive. Find the latest Linux articles, documentation, and answers at the new Linux.com!

Linux.com

Feature

Processing RAW image files on Linux

By Nathan Willis on August 08, 2006 (8:00:00 AM)

Share    Print    Comments   

The easiest way to sound like a professional when you talk about photography these days is to grumble about the deficiencies of RAW file converters. The ability to save pictures in RAW format rather than JPEG or TIFF is what distinguishes a "pro level" camera from a consumer device. But rather than mentioning your camera's specs outright, the shrewd move is the heavy sigh followed by lamentations about your tireless search for the perfect software to properly manipulate your beautiful work. Let's take a look at how to do it using Linux and open source.

For starters, it is important to understand just what is meant by the term "RAW image file." Despite how the term is generally used (in the singular), RAW does not designate a file format. Rather, it is an umbrella term describing multiple file formats controlled by multiple hardware manufacturers. It is generally seen in capital letters, a convention probably meant to distinguish the term from the generic adjective raw, meaning "not yet edited."

That said, RAW does refer to image file formats not yet processed. The RAW formats are supposed to contain unaltered data from the camera's CMOS sensor. In reality, there is always a small bit of processing done in-camera, to remove dead pixels and so on. But the RAW formats do contain high bit-depth readings, uncompressed, and not yet remapped for white point compensation or other alterations eventually performed to tweak the image for display.

The idea is that interactive software can help users perform all these tweaks, taking advantage of adjustable algorithms to reduce noise and recover data from washed-out or underexposed areas (turns out we humans are better at that sort of stuff than our machines). In addition to adjustments themselves, there are multiple, competing algorithms for converting RAW to standard RGB, and there is no consensus on which is best. Capturing in RAW lets you experiment and try them all.

Every perfectionist knows you should always preserve the original and makes changes on a copy. Since the RAW file represents the original as seen by the camera, any camera that saves photos to its flash memory only in JPEG or TIFF format is discarding the original and handing the user an inferior, degraded copy.

File under fire

The RAW formats themselves are specific to digital camera manufacturers. Canon's current format uses the extension .cr2, a successor to the preceding generation's .crw. Nikon uses .nef, Minolta .mrw, Fuji .raf, Pentax .pef, Olympus .orf, Hasselblad .3fr. Although most are based internally on a variation of the hyper-extensible TIFF, all are proprietary and subject to change with each new camera model, and most are officially undocumented.

There are two RAW formats not produced by camera manufacturers. Foveon's .x3f was created by chip maker Foveon for its special image sensors, found in cameras manufactured by Sigma and Polaroid. In 2004, software giant Adobe announced it was launching a new RAW format called .dng that would serve as an umbrella format for all of the others. The company produced a free DNG Converter application, but as of today DNG has not taken over. Many see the DNG move as a blatant attempt to take over the RAW format market by a jealous software house not currently a player -- and for most digital SLR owners, since DNG is not the format their cameras actually capture in, it is nothing more than another (unnecessary) intermediate format.

OpenRAW

Many photographers find the glut of undocumented, proprietary, and incompatible RAW formats a royal inconvenience. The OpenRAW project is an initiative to persuade camera manufacturers to publicly release full specifications for their formats, easing the jobs of photographer and image editor application programmer alike.

Freedom road

Fortunately, no special procedure is necessary to import RAW files from your digital camera in Linux. As long as your camera model is supported (newer models will experience some delay), you can import images through software such as the gPhoto suite.

Gtkam is the interactive front-end for gPhoto's background library workhorse libgphoto2, and is simple enough to use. You connect your camera with a USB cable, launch Gtkam, and the application will bring up a browseable list of the images on board. An alternative to Gtkam is command-line tool named gphoto2. KDE supports libgphoto2 as a kio slave, and there is even a FUSE implementation of libgphoto2 to let you mount your camera directly into your filesystem.

However you get your images off the camera and onto the Linux PC, the real work is converting them to a file format usable in image editors like the GIMP, CinePaint, and Photoshop. Here the major player is a free software project called dcraw, which is a small and fast RAW file converter that supports most major camera manufacturers' formats. Developer Dave Coffin puts his own time into supporting new camera models as they come out, and implements changes to the formats as the manufacturers update their own tools and firmware.

Dcraw can be used from the command line, but for a friendlier user experience, check out UFRaw, a GUI tool that uses dcraw for image import, but offers the user a wide array of adjustment tools. UFRaw can be launched as a standalone program, a GIMP plugin, or run non-interactively as a batch processor. It is GPL-licensed and probably available via your Linux distribution's package management system. If not, you can download sources and compile it for yourself; dependencies include the GIMP and libgimp for basic functionality, and LittleCMS and libEXIF for enhanced features.

Using UFRaw to extract the perfect image from your RAW files is an often subjective process that depends on a multitude of factors. UFRaw contains essential RAW workflow features such as color management, exposure control, white balance correction, multiple interpolation algorithms, and fine control over individual channels.

When called from within the GIMP, the completed import is opened as a GIMP file -- meaning that it is limited to the 8-bit color depth of the GIMP itself. As a standalone app, UFRaw can save to 8-bit or 16-bit PPM, 8-bit or 16-bit TIFF, or JPEG.

But don't let its complexity discourage you from getting started! UFRaw can import and convert your RAW files even if you don't know what white balance means or what RGB stands for. The histograms and adjustment curves are intuitive and provide live feedback in the preview window. You can play with the settings and observe the results -- in fact, that is the only way to gain experience.

But wait, there's more!

Although I have more experience with UFRaw, I should also mention a similar open source project, Rawstudio, which also builds on the functionality of dcraw. Rawstudio is a newer project (launched earlier this year), but it offers many of the same features as UFRaw. As yet Rawstudio is still young, and new releases are available only as source code tarballs.

In addition to free software tools, there are proprietary options available for Linux as well. Bibble Labs produces Bibble Lite and Bibble Pro tools for Linux, Mac OS X, and Windows PCs. Bibble is a highly regarded RAW converter on the other two platforms; it is routinely compared to the high-priced Aperture and Photoshop tools. It is shareware, with the two versions priced at $70 and $130 respectively. A no-cost but closed source alternative is LightZone, a Java application produced by Light Crafts. Finally, Google's Picasa supports RAW files, but of course its image-editing features are slim.

The big question in choosing a tool is which RAW converter produces the best images. Well, there is no end to that argument. The software houses are (naturally) biased, and the proprietary software photographers fill page upon page with discussions after poring over the details of every update to the major commercial RAW importers, without reaching a consensus. Each application is better than its competition in some area, but there is no be-all and end-all, hence the constant hemming and hawing of the professional photographers.

Dcraw and its derivatives produce results as good as what you will see on Macs and Windows boxes. On Linux, we have fewer native RAW choices, but we do have choices. Aren't you glad you, too, can hang your head and bemoan the neverending search for good RAW file support?

Share    Print    Comments   

Comments

on Processing RAW image files on Linux

Note: Comments are owned by the poster. We are not responsible for their content.

Bah

Posted by: Anonymous Coward on August 09, 2006 02:44 AM
The biggest problem still is the damn 8-bit limitation on The Gimp and other image processing programs. You just can't do lossless postprocessing without more bits.

The Gimp also has issues with workflow. The pro programs lets you adjust step three of a ten-step process when you realize that you have made a mistake, without having to painfully redo the next six...

#

Re:Bah

Posted by: Anonymous Coward on August 09, 2006 11:55 PM

As someone else already mentioned, Krita is 16 bit, and it also has lots of color spaces (CMYK, L*a*b*, LMS Conespace, and 4 RGB spaces up to 32 bit float.



It has a ways to go, and it will benefit from optimizations, but it is capable.



Another non-oss choice is Pixel, which is a Photoshop-alike cross-platform app.


<a href="http://www.kanzelsberger.com/pixel/?page_id=12" title="kanzelsberger.com">http://www.kanzelsberger.com/pixel/?page_id=12</a kanzelsberger.com>

#

Cinepaint

Posted by: Anonymous Coward on August 10, 2006 11:21 AM
Cinepaint (previously "Film Gimp") is based on Gimp and can handle 16 and 32 bit images.

#

Krita (from Koffice) supports RAW files too

Posted by: Anonymous Coward on August 09, 2006 05:26 AM
And it allows for 16bits processing. Though it is probably less mature than the GIMP.

Another contestant to consider<nobr> <wbr></nobr>;)

#

Other options for simple conversions

Posted by: Anonymous Coward on August 09, 2006 06:17 AM
F-Spot also handles many RAW formats, and it offers some basic photo management as well. It doesn't offer much in the way of options for conversion, but it's better than nothing. It also offers enough management tools to make for easy and simple creation of photo discs and web pages, or publication to some photo sites (like Flickr), when you're short on time and just want to get a bunch of photos of the kids' latest event online for the grandparents.

#

To chime in with all this,

Posted by: Anonymous Coward on August 09, 2006 11:25 AM
Digikam will soon support RAW files, too.

#

Re:To chime in with all this,

Posted by: Anonymous Coward on August 10, 2006 05:48 AM
Some support is already there: CRW works fine, possibly other formats, too.

#

Yeah- Author left out best program!

Posted by: Anonymous Coward on December 11, 2006 03:10 PM
How could he write this whole article and not mention Digikam!!!?! Hello, welcome to earth you are clear to land.

#

Raw therapee

Posted by: Anonymous Coward on August 09, 2006 03:07 PM
Raw therapee <a href="http://www.rawtherapee.com/" title="rawtherapee.com">http://www.rawtherapee.com/</a rawtherapee.com> have also a linux version. It's really good.

#

Processing RAW image files on Linux

Posted by: Anonymous [ip: 87.221.12.117] on November 24, 2007 03:20 PM
Hello,

My name is Tomás and I use UFraw with Gimp for process my RAW images files on Linux. I have written two articles in spanish language that explain how to use Gimp and UFRaw to obtain similar result that if we used a software with 16bits support:

http://senabre.myphotos.cc/articulos/2007_01_07_cuarto_oscuro_digital_II_tratamiento_por_zonas_a_16bits_con_UFRaw_y_Gimp.html
http://senabre.myphotos.cc/articulos/2006_11_08_fotografia_dital_compuesta_II_hugin.html

Basically, I open the same RAW several times with different UFraw-plugin adjust.

Sorry but my english is very poor.

Tomás

#

This story has been archived. Comments can no longer be posted.



 
Tableless layout Validate XHTML 1.0 Strict Validate CSS Powered by Xaraya