androidpixeldng

Retrieving Pixels from a DNG file within Android


I am currently working on an HDR application that requires the use of Camera2 to be able to customize HDR settings.

I have developed a customized algorithm to retrieve certain data from Raw DNG images and I would like to implement it on Android.

I am unfortunately not an expert in Java/Android, so I taught myself how to code. Using other formats, I have usually worked with bitmaps to retrieve pixel data. ( which was relatively an easy task concerning the existing methods )

Concerning DNG files, I have found no documentation showing me how to retrieve the pixels data. I thought of bufferizing the image, however the DNG file format contains many information other than pixels and I'm afraid I am unable to find an extraction strategy using bufferstream. (I just want to store the pixels inside an array)

Anyone has an idea ? Would highly appreciate some tips.

Best regards


Solution

  • Camera2 does not produce DNGs directly - it produces plain RAW buffers, which you can then save to a DNG via DngCreator.

    Are you operating on the initial RAW buffers, or saving DNGs and then loading them back?

    In general, DNGs are not full baked images, so quite a bit of code is needed to render them completely - see for example Adobe's DNG SDK.