Page 1 of 1

TIFF to DNG conversion?

Posted: 2014-08-05T07:10:09-07:00
by crowtato
I'm looking for a way to convert TIFFs to linear DNGs in ImageMagick/dcraw (for archival purposes--it saves a lot of space).

So far, Lightroom and Photoshop (and maybe DxO) seem like the only things that can convert non-raw images to DNG, so just wondering if anyone here has been able to do that with dcraw or something else? (...e.g., with Adobe's dng_validate.exe or maybe a brilliant mod in their DNG SDK? wishful thinking?)

If that's familiar territory for anyone, I'm all ears...Thanks for any wisdom!

Re: TIFF to DNG conversion?

Posted: 2014-08-05T07:46:57-07:00
by snibgo
Neither IM or dcraw can write DNG. Nor Gimp. Nor any other open-source software that I'm aware of.

Re: TIFF to DNG conversion?

Posted: 2014-08-05T14:41:39-07:00
by crowtato
Bummer! Thanks anyway, snibgo.

If something does come along, would love to hear about it. maybe even CinemaDNG-conversion tools-in-development, just in case there's overlap in the video-world...

(otherwise, randomly came across a pretty thorough list here: http://www.barrypearson.co.uk/articles/ ... converters ...but it's been frozen as of 2011)

Re: TIFF to DNG conversion?

Posted: 2018-02-25T10:00:24-07:00
by starfry
Is this still the case in 2018 ?

(I hope it's ok to bump an old qestion but this is exactly what I wanted to ask...)

Re: TIFF to DNG conversion?

Posted: 2018-02-25T10:11:58-07:00
by snibgo
No problem re-asking an old question. Sorry, but my answer is unchanged.

You might like to ask the question at https://discuss.pixls.us/ . Many folk there have more knowledge than me about developments in open-source image processing, and may know something useful, or the question might spur someone into action.

Re: TIFF to DNG conversion?

Posted: 2018-02-25T13:13:49-07:00
by starfry
Thanks for the reply :) I only discovered that forum the other day as it happens, I'll have to sign up there and see if I can get more info.

I've been trying to line things up for a scanning workflow which archives to linear DNG but hit so many roadblocks that I feel it might be not worth the bother, but instead stick with linear TIFFs. DNG seems to be so inconsistently supported that I am starting to struggle to see its purpose.

Re: TIFF to DNG conversion?

Posted: 2018-02-25T13:57:16-07:00
by snibgo
In my view, DNG is or was potentially useful as a vendor-neutral raw file format, ie Bayer images from cameras. If takeup had been better, it might also have encouraged vendors like Nikon and Canon to move away from proprietary formats. (Yeah, I know, fat chance.)

Some Adobe software can convert proprietary raw to DNG. I forget the name. It is free (as in free beer) but closed source. I don't know if it captures all the details from the proprietary raw. (If it doesn't, it's useless.)

Re: TIFF to DNG conversion?

Posted: 2018-02-25T14:05:53-07:00
by Bonzo
As far as I can remember there are a few DNG converters around when I was looking five or so years ago. I believe there is also a DNG API but I could not understand how to implement it.

DNG is being touted by Adobe as they say DNG will stay whereas proprietary RAW formats may die.

There is one good thing about DNG files and that is you can add meta data. You can force meta data into RAW formats but most of them were not designed to accept it; which seems stupid to me.

EDIT: Adobe DNG Software Development Kit (SDK)

Re: TIFF to DNG conversion?

Posted: 2018-03-01T02:29:33-07:00
by starfry
Just in case anyone really wants to do this... there is a way to convert TIFF to DNG (and, also DNG to TIFF but there are other ways to do that).

If you have the professional edition of VueScan then you can "scan" a file (a TIFF or DNG) and save the resulting scan as either a TIFF or a DNG. So... you can "scan" a TIFF and save raw DNG.

VueScan is not free software, unfortunately.

Re: TIFF to DNG conversion?

Posted: 2018-03-05T13:01:46-07:00
by crowtato
Thanks for updates, starfry & co!
For a few archival workflows restricted to using linear DNG, I've been sticking with Lightroom for batch converting TIFF --> DNG.

If Lightroom [or VueScan] doesn't fit your bill, though, here are a couple other things that also turned up:

- Sandy/Alexander McGuffog's 'toDNG' might be worth a look ( https://sites.google.com/site/todngsite/ ). It's mac-only, but built specifically for converting bitmap/jpg/tiff to dng, and Sandy was pretty responsive to some questions a few years ago.

- The forum snigbo recommended looks promising -- from this thread ( https://discuss.pixls.us/t/zeronoise-li ... ow/3022/18 --> http://rawpedia.rawtherapee.com/Film_Si ... entity_DNG ), here might be a promising exiftool command that partly converts a TIFF to a DNG (or at least rewrites a TIFF's metadata to make it walk/talk like a DNG...but not quite a valid DNG):

Code: Select all

     
     exiftool -DNGVersion=1.4.0.0 -PhotometricInterpretation='Linear Raw' image_to_dng.tif
     mv -v image_to_dng.tif shinyNewDNG.dng  # or your preferred method to change the file's extension to ".dng"
...The output DNG I got from that seemed ok at first (previewed ok in windows file browser), but no luck opening it in Lr or Ps nor was there a major filesize difference between it and the tif-input. I'd be kinda surprised if exiftool alone could do more than edit the metadata (since that's its main purpose) -- but if the main/key difference between Linear DNG & TIFF is in the metadata/file header, maybe not an insignificant piece.

From there, maybe just [ha] a matter of figuring out the right imagemagick commands &/or fiddling with the right pieces of the DNG-SDK to accomplish a similar kind of lossless compression as whatever Lightroom does--maybe VueScan, too?

& for info-purposes: Lightroom [losslessly] cuts the filesize of a TIF in half when converting it to a linear DNG. On average a ~30MB TIF (8bit, no layers) goes down to a 15MB linear DNG (no JPG preview, no lossy compression). Am keen to understand how/why, if anyone has details...

Re: TIFF to DNG conversion?

Posted: 2018-03-06T03:25:56-07:00
by snibgo
crowtato wrote:On average a ~30MB TIF (8bit, no layers) goes down to a 15MB linear DNG (no JPG preview, no lossy compression). Am keen to understand how/why, if anyone has details...
I have no specific details (I don't use Lightroom), but I advise caution. The compression may be due to the posterization effect of linearizing at 8-bit.

The 8-bit input has values 0-255. Assuming gamma=2.2, then linearising means that the bottom (shadow) 15 values all become zero. The bottom 52 values become crammed into just 8 values. Overall, the 256 possible input values are reduced to 184 possible output values. This posterization will be visually evident if you ever de-linearize the image.

Of course for some purposes this posterization may not matter.