Thanks Barry - I'll take a look at it.
I put some effort into converting SMaL RAW images into DNG a while back, but I got frustrated and stopped. I intend to revisit this challenge sometime.
I ran into a few issues:
a) I didn't have a copy of Photoshop to work with. I was hoping that this would give me feedback about what was wrong in the DNG files I generated.
b) I downloaded several image viewers which claimed to support DNG, but I could never make a DNG file that one of these viewers would actually read. This may have been an 8-bit/16-bit issue (see next point).
c) DCRAW software reads DNG files - but only those which have 16-bit samples... The DNG docs talk about 8-bit, 12-bit and 16-bit sample data, but the guy who wrote DCRAW said that only 16-bit data exists in DNG files. SMaL RAW files have 8-bit samples - so, I may have to upconvert to 16-bit data in order to make a readable DNG file. This sorta sucks since it means I have to double the size of the data...
I suppose my main problem was that I couldn't find any software which would report a decent error when it tried to read a DNG file that I wrote. Now I understand that most users couldn't do anything with a detailed error message about why the DNG file they were reading wasn't good - but for development it meant I couldn't get any feedback about why my files didn't load. The viewers either crashed or loaded a scrambled image from my files.
If you download the pv2raw_100.zip - the v1.00 release of SMaL RAW decoding code - then you'll find my DNG conversion attempt code included there in a subdirectory. I mentioned that in the release notes, but I'm not sure anyone ever noticed...
Barry Pearson- 04-21-2006
I suppose my main problem was that I couldn't find any software which would report a decent error when it tried to read a DNG file that I wrote. Now I understand that most users couldn't do anything with a detailed error message about why the DNG file they were reading wasn't good - but for development it meant I couldn't get any feedback about why my files didn't load. The viewers either crashed or loaded a scrambled image from my files.
I'll just speak for the Windows version of the DNG SDK. (I guess the Mac version has similar features).
In the ZIP file (about 14 MB - there is a LOT of stuff!) there are 2 files that are worth a look as a stand-alone tool:
dng_validate.exe
dng_validate.pdf
This is a DOS-like tool with various diagnostic options for DNG files. (The PDF describes its command line interface). Among other things, it will report errors, but it can give a lot of other things too. (For example, it has various options to output various forms of the image data to TIFF files).
I have found it useful to call it as:
dng_validate -v adngfile.dng > atextfile.txt
This runs through all of the parameters in the DNG file ("adngfile.dng" here) and outputs several KB of reasonably-well interpreted lines to the text file ("atextfile.txt" here).
The SDK actually has the C++ source for dng_validate.exe. In fact, the DNG part of the SDK is all C++ source - not libraries. (The rest of the SDK is an SDK for XMP, which does have libraries). There is source to read DNG files, source to write them, source to generate thumbnails, etc. Plus source for JPEG lossless compression. (My coding days stopped at "C", but I think this is pretty comprehensive stuff. Adobe really want people to generate DNG files!)
sailpix- 04-21-2006
Ya... I downloaded the SDK and unzipped it last night. I haven't been able to dig in yet, but I did notice "dng_validate.exe" right away - sounds like just what I need to move forward.
Of course, since I posted my code on the 'net, anyone could take my attempt and move it forward without waiting for me... :wink:
My attempt at getting DNG to work a year ago also showed me that DNG didn't have a lot of "popular" support yet - consumer favorites like IrfanView and Picasa weren't touching it at the time. I'm not sure how much the Photoshop crowd (who use DNG) and the PV2 crowd intersect - nobody spoke up as being interested back then. So, an undefined audience also slowed me from finishing this tool.
But - now that I have Photoshop and the handy new SDK, maybe I can get DNG to work.
brite_eye- 04-21-2006
Just for sailpix -
I'll provide a camcorder key-catch if you reach DNG success in less than a month (you have until May 21). :twisted:
If you are really fast you may be able to sell code to Pure Digital for Target cameras. Of course the preferred implementation would be in firmware on a PV2.
sailpix- 04-21-2006
I'm thinking that PD wouldn't want to have DNG written by the firmware. Two reasons: a) DNG data is uncompressed and b) DNG will require upconvert to 16-bit samples for compatibility with some DNG-reading software...
The combination of not compressing and upconverting each sample to 16-bit is (I think) about a 4X size increase for the picture data - that won't fly in a device which must use it's limited flash memory efficiently.
DNG seems to be a good format for use once the pix hit your hard drive - where bytes are cheaper.
Barry Pearson- 04-22-2006
My attempt at getting DNG to work a year ago also showed me that DNG didn't have a lot of "popular" support yet - consumer favorites like IrfanView and Picasa weren't touching it at the time.
A year ago, fewer that 25 non-Adobe products supported DNG in some way. Now the number is at least 100. (Still not Picasa!) Here are lists:
http://www.barry.pearson.name/articles/dng/products_y1.htmhttp://www.barry.pearson.name/articles/dng/products_y2.htm
In response to another post: DNG can use JPEG lossless compression. This can make a DNG file less than half the size of an uncompressed raw file, depending on other factors as well.
sailpix- 05-01-2006
Ok... I'm nearing done with a SMaL RAW ==> DNG converter.
This will be a command line tool for converting RAW to DNG. I've got it running using Windows API calls, but I'm gonna convert to generic CRT I/O where possible.
The DNG SDK was most helpful - especially the dng_validate tool which quickly showed me where I was writing out junk. I was actually very close. 8)
Is anyone interested who can help me -*test*-('") out a pre-release version? Of course, for this to be any fun you'll need an app (Photoshop, IrfanView, etc.) that can read DNG files.
brite_eye- 05-02-2006
Post a link or send direct to my email.
I only have irfanview.
Forumer™ is Voted #1 Free Forum Hosting provider
Build your own community today with the largest message board hosting company.