Quantcast
Channel: Adobe Community : Popular Discussions - DNG SDK
Viewing all 4036 articles
Browse latest View live

Creating a DNG from scratch.

$
0
0

Hi,

I'm trying to save camera raws(16 Bit Bayer pattern) I grab directly from an industrial camera in the DNG format.

By looking at http://fossies.org/dox/digikam-2.5.0/dngwriter_8cpp_source.html#l00188 - the only example I could find online - I have been able to create a file which Photoshop & co are able to read. However I had to do some guesswork. Specifically I had to specify a profile with the following lines:

 

prof->SetColorMatrix1((dng_matrix) matrix);

prof->SetCalibrationIlluminant1(lsD65);

negative->AddProfile(prof);

dng_vector camNeutral(identify.rawColors);

for (int i = 0; i < identify.rawColors; ++i)

{

    camNeutral[i] = 1.0/identify.cameraMult[i];

}

negative->SetCameraNeutral(camNeutral);

 

I don't have this information. Just adding the identity matrix produces a strange tint.

 

What is the simplest way of saying "the camera sensor is linear" and "I know nothing about the color temperature"?

 

I'm thankful for any help!


How can I tell DNG converter to grab NEW images ONLY?

$
0
0

I've just started taking RAW [CR2] images and learned to use DNG Converter to import them into Lightroom.  So far every time I convert a new batch of images, the program grabs previously converted CR2s also.  How can I set the converter program to grab ONLY the NEW images?

From Stage3Image() to sRGB color space

$
0
0

I get my image this way dng_image* image = (negative->Stage3Image()); I have to manimulate with it and then I want to covtert it to sRGB color space. I tryed to do gamma 2.2 and white balance with white point from camera, but colors are still different.

 

I think that I should use this matrix camera2RGB for conversion but I don't know how.

 

dng_camera_profile* profile = negative->CameraProfileToEmbed();

dng_color_spec spec(*negative,profile);

const dng_matrix camera2RGB = dng_space_sRGB::Get ().MatrixFromPCS () * spec.CameraToPCS ();

 

profile->HasColorMatrix1(); returns true

profile->HasColorMatrix2(); returns true

negative->HasCameraNeutral(); returns true

 

Sorry for my language skill

 

Thank you

Petr Kocich

SubIFD1 tags not updating

$
0
0

Hey,

 

I'm currently developing code to write raw camera image data to dng files (I'm doing some processing in between so I'm not using the DNG Converter exe). I have not been able to find any tutorial on the dng sdk, so my code is based partly on the dng_validate code and partly on incomplete code provided by others.

 

Anyway, my problem is that the dngs are not being written correctly. When I run dng_validate on the created dng, I get the following: "Error: Missing or invalid SamplesPerPixel (SubIFD 1)". However, when I set the SamplesPerPixel tag in SubIFD 1, the change is not reflected in the output of dng_validate when run on the created dng. Similarly, when I set the PhotometricInterpretation tag to CFA (32803), the output of dng_validate still shows it as being set to LinearRaw. My question is are there other SubIFD 1 tags that can have the effect of overwriting the above tags?

 

Thanks,

 

aubrey

Setting correct Bayer mosaic pattern using DNG SDK

$
0
0

Hey,


I'm having a problem generating DNG files from raw image files. The problem relates to the demosaicing parameters. I have a raw image from each of two different cameras (Cannon D200 and Panasonic Lumix). Using dcraw.exe (to display the EXIF info) I find that the Bayer filter pattern for each of these images is RGGB. I take this to mean RG/GB for row1/row2 of 2x2 pattern.


Using the DNG SDK, I have written code to modify and then write the raw pixel values to a DNG file. I set the mosaic parameters using negative->fSetBayerMosic(phase), where phase is 0 for GRBG, 1 for RGGB, 2 for BGGR and 3 for GBRG. (As a side point I also set the fCFAPattern[][] values to the equivalent values, e.g. 01/12 for RGGB, but this doesn't seem to change the Bayer mosaic pattern in the DNG EXIF?). The problem is that when I view the DNGs, the DNG from the Panasonic is correctly displayed in Photoshop, but the DNG for the Canon image is clearly demosaiced incorrectly. By setting phase to 0, the Canon DNG image is demosaiced correctly (but not the Panasonic).


What is really confusing me is that by writing the same images to DNGs using libtiff, I set the Bayer pattern to RGGB as TIFFSetField (tif, TIFFTAG_CFAPATTERN, 4,"\0\001\001\002" ) and the DNG's for the images from both cameras are displayed correctly in Photoshop.


So even though dcraw says the Bayer pattern is RGGB for both camera images, using fSetBayerMosaic(1) only causes the Panasonic image to be correctly decoded. Is there some other parameter that can affect the demosaicing that occurs when building the DNG images? I'm taking the Bayer pattern value from the decoded raw image using libraw (imgdata.idata.filters parameter). Libraw is just an api for dcraw.


Also, can anyone explain to me the significance of the stage1, stage2 and stage3 images? Must all three be built to creat a valid DNG? I understand that demosaicing occurs when builing the stage3 image, and this is where I have been focussing my debugging time for the above problem. Does this make sense?


Hoping someone can help with this,


aubrey

DNG data production

$
0
0

I have a camera which delivers a data stream of pure pixel values. Pixels are 12 bit packed data.

There is no header in front of the data. Software like Irfan has no problem to open it.

What I search, is the possibility to convert these images to DNG.

As far as I understood, DNG Converter cannot read in pure pixel data.

Rather basic question:

$
0
0

I'm currently writing a lens correction and image optimization program that (if everything works as planned) will perform the following functions:

 

1. Removal of image blurring introduced by the lens, camera AA filter, diffraction, and RAW converter demosaic algorithm.

 

2. Correction of radial and longitudinal chromatic aberrations.

 

3. Correction of coma, spherical aberrations, and other similar distortions.

 

4. Correction of barrel, pincushion, and the most complex forms of mustache distortion.

 

5. Vignetting correction.

 

6. Stacking multiple DNG images for focus or exposure blending.

 

The biggest hassle I'm encountering right now is figuring out the DNG SDK. I've downloaded it and browsed through it, but there's a huge number of classes, and the object hierarchy and their intended usages aren't clear to me yet. I'm trying to figure out how to accomplish the following tasks:

 

1. Open a DNG file (preferably the demosaiced linear RGB flavor), and read the image and metadata (especially camera model, lens model, focal length, and aperture) into memory.

 

2. Once the image has been processed, write it to a new linear RGB DNG file that can be opened in any DNG-aware application, with all original tags and metadata correctly preserved.

 

All of the internal correction operations are done on linear RGB data in the camera's native color space, so that setting white balance, selection of color profile, etc. is unaffected by the image correction operation. The user will have the exact same color processing options, ability to select white balance, exposure adjustments, and output color space selection as when working with the original RAW(s).

 

All I care about is opening a linear RGB DNG file (already demosaiced, so I don't have to open that can of worms) processing the image data, and then saving to a new DNG file that is identical except for the actual image data. Where do I start?

Saving a DNG

$
0
0

Hello, i have opened up a DNG profile and gotten a bit of info out of it. The stream is open as readonly. I want to make 1 change to it, that is the camera profile name. So after i have done this, i want to save the DNG profile back out. I know it's some sort of combination of host, a writeable stream, a negative and a writer, but the writer takes a thumbnail which i dont have. Can anyone point me to simple sample code for saving my profile out. Just an open profile and save to another filename would be fine.

 

thx for the help.

 

AC


Newbie - getting started

$
0
0

Hi,

Hopefully someone can help me here.  I'm looking to place either simulated or camera raw output (and here I mean a matrix of 8 or 10 bit values without debayering) into a RAW format so that I can experiment with the debayering, white balance, colour profiles, linearization or LUTs that I need to shift my camera output into a useable image.  I was thinking about using the Adobe DNG format - but I'm struggling to understand where to start with this.

 

What I'd like to do to start with is simply create a DNG file with, say, a 10x10 image size, 8 bit data with a ramp profile: e.g.

0 20 40 60 80 100 120 140 160 180

0 20 40 60 80 100 120 140 160 180

.

.

.

0 20 40 60 80 100 120 140 160 180

 

I've been looking at using the dng_validate example and creating a new function:

 

static

 

dng_error_code dng_createsim (constchar *filenameOut)

{

 

 

}

 

After several attempts at this, I've sort of guessed that I need to access the data buffer in negative->Stage1Image(), but I've not succeeded in this.

 

Thanks for any help.

 

Simon

From dng_image to pixel buffer?

$
0
0

Various things of the DNG SDK return a dng_image. The stage1, stage2 and stage3 are an RGB image. And if you use dng_render, you also get a dng_image.

 

I'd like to get a buffer of pixels (with for example R, G, B values). However, I haven't found any way in the API to get such a buffer.

 

For example, dng_image has member functions to get its width and height, but nothing to get the pixel buffer or even the value of a single pixel.

 

And I experimented a bit with the "Get" method of dng_image, but if I don't put anything in fArea of the buffer parameter, I didn't manage to get anything interesting, while if define a rectangle there, the whole program corrupts and crashes a bit after using dng_image.Get.

 

So, basically, my question is: how can I get the pixel buffer from a dng_image?


This is for displaying it on a computer monitor BTW.

 

Unfortunately the dng_validate sample doesn't help me out, because they don't get any pixel values there, they just call an API method to convert the dng_image to a TIFF file, which doesn't help me at all because I need RGB pixels on a screen, not a TIFF file on a disk.

 

Thanks.

Compiling dng sdk with xmp 5.1.2

$
0
0

I was trying to compile the dng sdk 1.3 (windows visual studio 2008), and I am hitting a snag with the XMP SDK - when compiling dng_xmp_sdk.cpp I get a:

 

error C2039: 'AppendProperties' : is not a member of 'TXMPUtils<tStringObj>'

 

Looking in the XMP notes I see that indeed AppendProperties has been decrepated in XMP SDK 5.1.2..

 

I assume I should be using an older version of XMP, but I cannot find it on the adobe website(s). Does anyone know where to find that ? Or am I doing something else wrong...

monochrome dng

$
0
0

Hello,

 

I have been writing my own DNG headers to raw sensor grabs successfully for a while now. These have all been CFA sensors but now I have a monochrome sensor in the mix and I would like to save these as DNG as well. I have tried a variety of settings with the PhotometricInterpretation, CFAPattern, CFARepeatPatternDim tags and have had no success. Excluding the latter two tags will produce a greyscale image with dcraw but photoshop will not open these DNGs. I could just save these images as PNG but everything else is DNG and it just looks nice when everything is the same.

 

Any ideas on header tags for a monochrome DNG?

 

 

Thanks!

jt

Crash when creating a Lossless-jpeg compressed DNG

$
0
0

Hi all,

 

everything is in the title i guess. I work on a legacy system, using DNG SDK 1.1 (upgrading is not an option). The software was originally desgined under win, and is now ported to mac os X. When saving an image to a dng format, an exception is thrown during the lossless jpeg encoding. Do you have any idea of what it might be? What tests can I run?

 

thansk

S.

Get DNG Date Created from dng sdk

$
0
0

I have successfully compiled the dng sdk and the validate app and I wondered what is a simple way to just get the date created out?

The current DNG Profile Editor cannot interpret 7.1 raw settings

$
0
0

Hi,

 

I am frustrated that the DNG Profile Editor is not able to apply Lightroom's or Camera Raw's settings since the new Process 2012 has been in effect.

 

This SEVERLY limits the usefulness of the Profile Editor. And yes I know it is a beta.

 

However, are there no plans to release a compatible version?

 

 

Thanks,

Juan


DNG SDK cannot write files with floating point pixels?

$
0
0

I'm trying to create a DNG with 32 bit floating point pixels. The reason is to create a file which is not demosaiced but contains a large dynamic range. It goes well for the major part, but it fails in the linearization step (BuildStage2Image) when I'm generating a thumbnail. Looking into the code it seems like the floating point case is not handled, so it is easy to understand why it does not work.

 

Is this a bug in the SDK, or does not the DNG standard support floating point pixels?

 

(I'm using the latest release at time of writing, version 1.4)

 

Edit: I patched the SDK to support floating point pixels (like 4 lines of code), so it is quite simple to do. But not surprisingly it cannot be interpreted even by Lightroom.

DNG SDK thinks 0xFFFFFFFF is invalid white level for 32 bit integers

$
0
0

As discussed in another message the DNG SDK does not seem to be able to write floating point DNGs. Since I need higher dynamic range than a 16 bit sample I instead went for 32 bit integers.

 

This works, and I manage to create a file but when I run dng_validate on it it says the white level is invalid. The white level I have of course set to 0xFFFFFFFF to make use of the full 32 bit range. Looking into the code in dng_ifd.cpp where this test is made it seems like the default max white level is set to 65535.0 and the file's white level is compared against that, regardless if the sample type is 16 or 32 bit. This means that I can only make use of 16 bits of the 32 bit integer which seems kind of strange. Looking into the DNG spec I don't see anything there that forbids using the full 32 bit range of 32 bit samples. So this looks like a bug to me.

 

This is with version 1.4

 

the created file can be opened in Lightroom 4, so the only problem seems to be that dng_validate does not think its valid.

 

Message was edited by: torger76, removed clipping issue, that was a fault in my code.

converting RGB to DNG without affecting color profiles

$
0
0

Hi guys

 

I'm working with the DNG SDK in C++ for some time now.  I need to be able to take a raw RGB (not camera raw) and convert it into a dng file.  After playing arond with it for a few days, I realized creating the camera profile drastically affects the resulting dng image.

 

I can't seem to produce a dng file that was identical to the input source.  My picture appears very washed out and I end up using the adobe color profiler to try to bring the image back close to it's original color.

 

I'm trying to find a way to produce dng files without the need to affect the colors in any way, the resulting picture should be bit identical to that of the raw RGB input file.

 

I'm not even sure if I can do this considering the usage of the dng format.

 

 

UPDATE

I've realized that my program is loading the RGB buffer into the fData of the stage3 image object.  I have a feeling I need stages1 and 2 but i'm unsure if I need to and if so, then i will probaby need a source DNG to produce those stage1 and stage2 unless I can get stage1 or 2 from stage 3 (appears it works vice versa).

 

I'm able to do the reverse (DNG to RGB raw) by extracting the buffer from the stage3 render.  but in this case, all the metadata has been filled in by the input DNG. However, going from RGB to DNG, I don't have the metadata to fill into stage 1 and 2.

DNG/XMP AppendProperties/ApplyTemplate

$
0
0

I downloaded the latest DNG SDK (1.3) and XMP Toolkit SDK (CS6).  The DNG SDK expects "AppendProperties", while the XMP has replaced that with "ApplyTemplate".

 

I then tried an earlier version of the XMP Toolkit (4.4.2), but then multple Quicktime SDK linking problems arose.

 

Are there any DNG/XMP versions which are compatable, or method of converting the function?

 

Thanks.

Compression artifacts in validate dng output - proof attached

$
0
0

I have uploaded a zip file - out.dng is the output of validate dng.

 

https://dl.dropboxusercontent.com/u/9906333/dngs.zip

 

Look at the edges of the white chair - you will see classic jpeg compression artifacts.

Note that this is the default lossless jpeg conversion only.

I used the program as

 

dng_validate -dng out.dng <input>

 

I confirmed this with a build in Visual Studio using qDNGUseLibjpg=0

 

I would appreciate the admins looking at the provided examples.

Viewing all 4036 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>