digiKam

Professional Photo Management with the Power of Open Source

digiKam has a new tool to convert RAW camera files to DNG…

by digiKam

Yes! a DNG converter for Linux...

For a long time, many people asked me to implement a RAW camera image converter to Digital NeGative (DNG). Why should one support DNG under Linux? To improve interoperability with other photo-management programs such as Adobe tools, and to improve Digital Asset Management (DAM), as Gerhard Kulzer discusses in this nice tutorial and in particular in Part 2.

I have already talked about DNG in another ticket. My first viewpoint about DNG SDK from Adobe has been wrong: missing tutorials, weird API documentation, wrong source code licence, etc... But after having found this nice web site from Barry Pearson which provides a huge collection of papers about DNG, I had a second look at the DNG SDK.

My first problem with DNG is to be able to extract un-demosaiced RAW image data to pass to DNG sdk. Here, dcraw cannot help really. By chance, after the port of libkdcraw to LibRaw, I have found an easy way to extract these data, plus lots of relevant meta-information, fully suitable for the DNG SDK. I would like to Alex Tutubalin from LibRaw for pointing this out.

After few weeks of studying the DNG SDK code to learn the API and the code from this little application dedicated to convert Canon Powershoot RAW files to DNG, I have finally found the way to write the first RAW to DNG converter for Linux, which support a lots of major RAW camera formats, as NEF, CR2, MRW, PAF, etc...

A DNG codec has been written around the DNG SDK and a command line tool to perform unit-tests. After a lots of conversions tests using official Adobe DNG converter and my program, a new kipi-plugin is born... See below for a screenshot of this tool in action...

dngconverterkde4

The tool transfers RAW data to DNG, creates a JPEG preview and a thumbnail, sets a lots of TIFF-EP/DNG tags with original raw files metadata, does a backup of all Exif metadata and makernotes, and creates a set of XMP tags, accordingly. The generated is a valid DNG file, which is checked by Adobe DNGValidate tool...

The plan for the future is to improve the DNG tags creation following special makernotes entries, to support new RAW file formats, and to add a new option to backup the original RAW file within the DNG.

To conclude: DNG SDK is not perfect, but not too bad. I hope that Adobe will publish a future version using a real open source license such as BSD (ie, in the same way as the XMP SDK is published).