How can I convert headerless 16-bit GRBG sensor data to Adobe DNG?
Asked 1/6/2011
6 views
2 answers
0
I have raw files from an Aptina sensor stored as headerless 16-bit Bayer data in a GRBG pattern with a .raw extension. Standard raw converters don’t recognize them. Is there a tool that can convert this kind of proprietary Bayer data to DNG, or would I need to write my own converter? If I do it myself, where can I find the DNG file format specification and SDK, and what extra metadata is required beyond the Bayer pixel values?
Originally by Photography Stack Exchange contributor. Source · Licensed CC BY-SA 4.0
Photography Stack Exchange contributor
15y ago
2 Answers
9
DNG files are based on the TIFF/EP standard, ISO 12234-2, (they're essentially bitmaps with extra metadata) so if you start out with an appropriate TIFF I/O library that will get you part way, but you'll need to fill in the extra data required by DNG, which could be tricky.
Raw converters need to know more than just the pixel intensities. Other relevant information includes pixel shape and orientation, or the properties of the dyes (just knowing they go GRBG is not enough, you may need to know the precise shade (or more accurately the frequency response) of each dye to create the colour representation as this varies between manufacturers). I think DNGs handle this by means of an embedded "camera profile".
edit:
There's an open source photo management application called digiKam which can write DNG files, so your best bet would probably be to look through their source and try and rip out the DNG encoding functions.
Originally by user1375. Source · Licensed CC BY-SA 4.0
user1375
15y ago
0
Generated from our catalog & community — verify before relying on it.
There’s no guarantee a generic converter will handle a headerless Aptina Bayer dump directly. DNG is based on TIFF/EP (ISO 12234-2), so in principle you can create one yourself, but you need more than the raw pixel values.
Besides the 16-bit GRBG sample data, a usable DNG typically needs metadata such as image dimensions, orientation/pixel geometry, black/white levels, and color information describing the sensor’s filter responses. Knowing only “GRBG” is not enough for accurate color; DNG commonly uses an embedded camera profile or equivalent calibration data.
Adobe publishes the DNG specification and provides a DNG SDK, so that’s the main place to start if you want to write a converter. A TIFF library can help with the container structure, since DNG is essentially TIFF/EP plus required raw-specific tags and metadata.
If you need sensor-specific details, Aptina’s documentation may provide what’s needed, though some information may require access through their documentation program or NDA.
So: yes, conversion is possible, but without the sensor metadata/profile, the result may open yet still produce poor or inaccurate color.
Recommended products
UniqueBot
AI15y ago
Your Answer
Related Questions
Does converting a camera RAW file to DNG perform irreversible demosaicing?
How can I modify RAW pixel data and save it back to DNG while preserving metadata?
How can I open Sony RX100 RAW files in Photoshop CS2 on Mac OS X 10.6?
How can I open RAW files in Photoshop CS2 using DNG Converter or Camera Raw?
Will converting Sony ARW files to DNG lose metadata or useful maker notes?