Raw to dng converter in non-KDE environment

Hello, my name is Dario and I have this strange hobby that is to complicate my life with strange needs.
Lately I met dng format, which offers some honest benefits, especially in the future portability, compared to .cr2.
Currently the only program that can convert a cr2 to a dng in a Linux environment is DngConverter, part of Digikam, part of the KDE suite.
Obviously I use, with great satisfaction, XFCE and I have serious problems to install half DE for one plugin of one program.
Straight to the point: is there a software that allows me to convert cr2 to dng?
It could be from terminal, GUI not needed.
I know Adobe Dng Converter via Wine, but something native?
Thank you all and sorry for my horrible english :slight_smile:

1 Like

I asked the darktable crew about this, and their response was: don’t.

The problem is that there is a possibility of data loss during the conversion process, with little to no practical gains for doing so. EXIF is one place of possible corruption as well.

http://redmine.darktable.org/issues/9453#note-1
http://redmine.darktable.org/issues/10434#note-4

I think the general feeling is to ask what possible gains there might be from adding this conversion step (and to weigh it against the possible cons).
We already have libraries to read the CR2 files fine (I think? I’m not a Canon shooter - someone correct me if I’m wrong). If something changes in the future for CR2 files, you are not going to lose the ability to open your existing files with the existing libraries.

With that being said, I’m not sure of the easiest way to install only a portion required to fire up digikam. Doesn’t that get handled by your package manager w/o having to install a large portion of KDE?

I have to agree with Pat. DNG is useful for backward compatibility with older software that doesn’t support new cameras, but it should not ever be used for forward compatibility with future software.

Thanks for your reply, @patdavid.
I understand the point in the darktable’s crew reply.
Some benefits from DNG vs RAW - Which One is Better and Why

  • No need to be worried about proprietary camera RAW formats – once a RAW file in converted to DNG, it will work with any software that can read the DNG format.
  • DNG files are generally smaller than RAW files and can be made even smaller if minimal or no JPEG Preview is stored within the file.
  • Changes to images can be written directly into DNG files without having to create separate sidecar XMP files to store this data. This simplifies file management.
  • DNG files are capable of storing full original RAW files and these RAW files can be later be manually extracted, if needed.
  • Adobe provides many ways to automatically convert RAW images to DNG format in such programs as Lightroom.
  • Unlike RAW files, the DNG format includes checksum information in the file to detect and prevent file corruption.
  • Adobe continues to work on the DNG format, enhancing it year after year and adding more functionality and features

And also

  • Compatibility – it doesn’t matter what camera I use today or tomorrow, my files are preserved in one highly-compatible format that is here to stay.
  • Simplicity – all changes are written into the same file and I do not have to worry about having one separate file per
    image just to store my post-processing settings.
  • Size – that 15-20% of extra space does make a difference when you have tens of thousands of pictures. Why should I waste space by storing information in RAW files that I do not need?

Someone could see some of this point as cons.
But obviously, a cr2 non corrupted photo is better than a dng corrupted photo.

For dng converter: yes, through digikam and KDE is the only way to install it.
I use archlinux with pacman.
But I think that other distro and other package manager behave in the same way, for this particular software.

Thanks for your opinion @CarVac. Another point to NOT use dng :wink:

1 Like

HDRMerge reads raw files and writes dng files (in floating point). Though it’s designed to merge two or more raw files into one dng file it also works with a single raw file. File size of dng file is bigger than file size of original raw file (because of floating point dng). According to the website of the author it should be able to execute it from terminal, but I didn’t try that yet. I used it several times to merge files and also tested that it works wit a single file, but I used the gui. Also be aware that your processing software has to be able to read floating point dng format.

2 Likes

Thank you for your suggestion.
I’ll give it a try.

Normally a DNG is more little than the correspondent cr2 (10%-15%), but there are 2 way to create a dng file: with or without the incorporated cr2.
Probably HDRmerge incorporate the original file.

AFAIK HDRMerge converts the original raw file(s) to dng lossless raw floating point format. So I would say, yes, it incorporates the original undemosaiced data of the file but converted to floating point. I just checked the difference in filesize. For a file of my D700 original size (NEF) is 14510 KB. Converted with HDRMerge to 16-bit float DNG it is 14963 KB. So that shouldn’t be a show-stopper

1 Like

Yes, not a big deal.
By the way, for me, the show-stopper is this:

But I want to experiment a little, so I’ll give HDRmerge a possibility

Yes, that can be a problem (or not). For example, some days ago I detected that RawTherapee didn’t show the MakerNotes and Lens information for DNG files created by HDRMerge from my NEF files. I thought it would be a bug in HDRMerge, but it turned out that it was a bug in RawTherapee (which I fixed then).
I also agree about the ‘little to no practical gains for doing so’ !

1 Like

To add to this, (in case you didn’t see the link for HDRMerge on the software page):smile:

Here’s a link to HDRMerge.

1 Like

There are practical gains of converting to DNG, you listed them. There is always a risk of corruption regardless what you do, as long as you do something, even when just copying a file. ADC is mature enough to do its job well, without corruption. I feel that, this being 2015, there is far more FUD regarding it than is warranted.
I convert my Pentax K10D PEFs to DNG using it mainly to:

  • enjoy better lossless compression,
  • smaller, medium-sized thumbnails,
  • more accurate thumbnails, more representative of the raw file,
  • smaller resulting file sizes.

As for your question, probably just using wine+ADC would require fewest deps.
http://rawpedia.rawtherapee.com/How_to_convert_raw_formats_to_DNG

2 Likes

Thanks for your reply :smile:

Dario, as someone else has already pointed out, there is nor real need to fear for any existing raw format to become unreadable in future. The fact the DNG conversion only works one way means that you may be losing some hinting or other details specific to you camera’s raw format which would not be correctly translated. Example in case is shadow/highlight protection setting in-camera which is lost after conversion.

You can, at any given time in the future, concert your CR2 into a DNG for processing it. You wil never, ever, be able to convert DNGs back into any of the proprietary formats (CR2, CRW. PEF, NEF, ORF etc.)

The rest of the reasons you listed are FUD (fear, uncertainty and doubt) spread by Adobe itself.

My comments on those “reasons” below
-No need to be worried about proprietary camera RAW formats – once a RAW file in converted to DNG, it will work with any software that can read the DNG format.

The only software having issues converting existing raw formats is Adobe’s software - intentional obsolescence, you might call it. If you dump it and work with any of the other great raw converters out there, you will be able to read your CR2’s literally forever, thanks to Dave Coffin’s dcraw as well as the Libraw libraries.

-DNG files are generally smaller than RAW files and can be made even smaller if minimal or no JPEG Preview is stored within the file.

Why in heaven’s name would you want to remove the jpeg preview from your raw file. From fast on-screen viewing to matching colors, it has a use. Removing it to save a few lousy cheap magabytes is plain dumb.

-Changes to images can be written directly into DNG files without having to create separate sidecar XMP files to store this data. This simplifies file management.

Your raw files are your negatives. Why anyone would risk repeatedly writing directly to raw files is beyond me. The risk of file corruption is just crazy.

-DNG files are capable of storing full original RAW files and these RAW files can be later be manually extracted, if needed.

A lie. DNG stores the original raw data but not the whole raw file. Why would we have DNG if that were true? Think that one thru and see it does not compute.

-Adobe provides many ways to automatically convert RAW images to DNG format in such programs as Lightroom.

Yes, and Microsoft has your best interests at mind as well. How this would make an argument for anything at all, I cannot see…

-Unlike RAW files, the DNG format includes checksum information in the file to detect and prevent file corruption.

Which is probably only required because one normally does not write to a raw file repeatedly, but for DNG this has been made into an “advantage”???

-Adobe continues to work on the DNG format, enhancing it year after year and adding more functionality and features

So do camera manufacturers, on their own raw formats, all the time. Example would be Pentax with the pixel-shift raws on the latest K-3 II DSLR (which is destroyed by DNG conversion by the way)

-Compatibility – it doesn’t matter what camera I use today or tomorrow, my files are preserved in one highly-compatible format that is here to stay.

Compatibility - every proprietary raw format existing today will be handled by loads of software for the foreseeable future and beyond so all of them are “here to stay”. I have not seen a raw converter having dropped formats yet. Most even still convert raw files generated by a firmware-hack on the 2003 Casio compacts!

-Simplicity – all changes are written into the same file and I do not have to worry about having one separate file per image just to store my post-processing settings.

I find that the one huge red flag which would cause me NOT to use DNG under any circumstance anyway. Why one would need to store “post processing settings” in a raw file anyway is beyond me.

-Size – that 15-20% of extra space does make a difference when you have tens of thousands of pictures. Why should I waste space by storing information in RAW files that I do not need?

Wait, wasn’t the argument for DNG before that they were smaller (if you yank out the jpeg previews anway). The second statement is the one that really scares the heck out of me. You cannot know today how important an image may become to you in future and they suggest ditching it because you do not “need it”?

4 Likes

Thank you for your reply.
You was absolutely clear and I appreciate that.
You have a lot of good point.

I’m probably going to buy a Pentax K-3 II soon, with its pixel shift feature which results in a RAW file containing four exposures. I use DarkTable in Linux, and as far as I know that won’t deal with the “shifted” result. Does anyone know how I can go from the camera’s RAW file (PEF/DNG) to something that DarkTable can use? (Would this be a valid use case for HDRMerge? Maybe not as that seems to be for combining separate RAWs into one.)

Otherwise, is there other open source software on Linux that can take advantage of Pentax’s pixel shifted RAWs?

darktable would probably import them like a regular file.