I scanned a black & white negative. Can I turn it into a positive in PhotoShop?
I scanned a black & white negative. Can I turn it into a positive in PS?
How to export raw data from DNG?
Hello
I want export Bayer data from my DNG file. I am reading DNG SDK, the dng_validate can parse my DNG file ,there are four lossless jpg in the file. But I can't find the rule to make a RAW data file.
ConstPixel can get a buffer, but can't preview the buffer in Photoshop.
Is there any explain about the order of RGGB in the ConstPixel, or and document specifies how to convert the four planes jpg to a bayer raw data?
Thanks
Creating a DNG from scratch.
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!
Transparency examples in DNG (SDK 1.4)
Hi All, I am new on this forum. I just started to assess the possibilities of DNG (and its SDK) for my photo processing pipeline. Being able to add (semi-) transparent pixels to sets of photos is one of my requirements, and since DNG SDK v1.4 this seems supported. Also, I was wondering how these transparent are pixels would be treated when popular end-user tools such as LightRoom and Adobe Camera Raw are used to further post-process the resulting DNGs.
I searched this forum and skimmed the DNG SDK source code, but effectively I haven't been able to generate results.
Does anyone have pointers here to:
- Sample DNG file(s) with transparent layer ?
- Code snippets for adding/accessing (an existing image as) a layer in an existing DNG file ?
DNG_SDK and VS2013
Really painful to build but in the end possible (had to build XMP* libraries separately, I didn't merge the projects) , is there a way to submit patches or is Adobe looking into this issue to re-release the XMP* kit and the DNG_sdk kit updated for the latest versions of Visual Studio ?
It has been 2 years since the last release.
How to import a real raw CFA image into a DNG ?
Hello everybody, I have searched this discussion forum and the net as good as I could, but unfortunately I was not able to find a way
to import properly an absolute raw CFA image generated by an image sensor with Bayer pattern into DNG file.
Not to mention on how to import a monochrome raw image .
I have read the documentation that comes with the SDK but it's really lacking, basically totally missing any concept description or, God forbid,
having some simple examples to help somebody start. The dng_validate example is another complex beast and it seems that the documentation spends
more time in describing various command line switches than talking about the architecture and the process of building a DNG image.
Actually, I wasn't able to find any clear explanation of the architecture of this complex software project, nor any sensful explanation about the classes hierarchy .
If this things exists somewhere I would be greatfull if somebody could kindly point me to them but I'm not holding my breath.
Anyway, if somebody has a working piece of code detailing on how to import a CFA blob into a DNG ( only stage 1 is needed but pointers/examples for other stages are
appreciated as well ) and it could share it I will be very, very gratefull.
I'm just an engineer working on vegetable/fruit sorting machines but I don't need a complete hand holding but just a starting point, I really don't know where to start and what is the
class that have to be instantiated to start filling it with data.
Any help is appreciated and please excuse the spelling/grammar, English is not my native language.
Cheers,
M.D.
DNG Converter source: who to ask
Hi,
I do not know if Adobe people are actually reading the forums (but one can always hope). I am currently researching the possibility of raw conversion on Unix operating systems (BSD, Linux, Solaris and the like). The only solution currently in existance is called 'dcraw', and well... it's quite limited in its scope, and ugly (both from an engineering point of view *and* from a user's perspective).
It would be nice if Adobe could be persuaded to provide access to their DNG converter sources, so that one can at least try and produce a non-Windows port of it. Together with the DNG SDK, this could be a very powerful combination. Judging from a short look at it, at least the SDK should not be completely impossible to port to a another platform (of course, licensing issues would have to be clarified, but that's another issue). At the moment, the main problem remains: who to ask?
Regards,
Robert
White balance
Hello,
Is there any posible to read vector (rgb or hsv) witch is used for white balancing? In fact I mean light temperature witch was measured by camera. My project is based on dng_validate.exe. Images use this format negative->HasCameraNeutral() == true.
I don't know why there are two temperatures. I need only one
profile->CalibrationTemperature1();
profile->CalibrationTemperature2();
Thank you
Petr Kocich
From Stage3Image() to sRGB color space
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
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
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
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.
raw image size > 2.147 Gb?
Hello,
Is there a dng specification raw image size limit? I would like to save huge raw images. We changed the kMaxImageSide from 65000 to 300000. I know the dng's which are bigger then 65000 per size can't be opened in other dng readers. But also if you just have a raw image 30000x30000 it can be bigger then 2.147Gb. It's depends on bits per pixels. For now we have images like 7500 x 60000, but soon we want to save raw images like 7500 x 314169 or better 7500 x 628328. That means for the first image we have raw image data like 4.4Gb and for the other 8.8Gb. Of course this is just possible on a 64bit system.
Is there any plan to support huge raw images (64bit dng sdk)? If so when will you release it?
Best regards,
Marius
Rather basic question:
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?
Newbie - getting started
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?
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
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
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
How to build dng_validate in VisualC++ 2010 [Question]
Hello all, I loaded the project solution coming with the current source into my Microsoft Visual C++ 2010 IDE and hit BUILD having prepared everything as in the README - I even replaced XMP 5.1.2 with 4.4.2 version in one trial as found here in the forum, but then the error messages got even worst - the build always stucks.
I even put everything dng_sdk and XMP-SDK as siblings (as recommended) in the root folder to avoid too long path errors, but all didn't help...
Side note: Would it be possible to generate a Makefile to be used with another IDE too (something like CodeLite, which imports MS project solution files at least, tried it, set all ENV variables as in vcvars32.bat but then it stucked on the build profiles - VALIDATE_DEBUG etc. - and could not find the .obj files it had generated though, so now I tried with one MSVC++ 2010 IDE instance available for me).
Cheers, hoping for help
Daniel
Enable multithreading in DNG SDK
Hi all,
I have to process very fast a large amount of DNG files (couple of thousands) and I have to do this on a regular basis. The processing is a simple conversion to TIF, white balance, and all other parameters are left default. The output is RGB 8 bit per pixel. I have tried libraw but it gets to 2.5 seconds per image and it is a bit slow.
Currently I get the following results from dng_validate:
Raw image read time: 0.064 sec
Linearization time: 0.020 sec
Interpolate time: 0.273 sec
Render time: 0.541 sec
This is about 1 second per file.
Is it possible to use multiple threads when calling render.Render()? It would be great to reduce the time to 0.3/0.2 seconds for this/
Are we talking about features that are not documented/flags to pass when compiling the library/complete re-write since the library was not designed with this in mind?
I poked through the code and found that there is some threading in the code:
void dng_area_task::Perform (dng_area_task &task,
const dng_rect &area,
dng_memory_allocator *allocator,
dng_abort_sniffer *sniffer)
{
dng_point tileSize (task.FindTileSize (area));
task.Start (1, tileSize, allocator, sniffer);
task.ProcessOnThread (0, area, tileSize, sniffer);
task.Finish (1);
}
but it seems that regardless how many threads they are, the tasks are perfromed single threaded.
thank you,
Calin