DNG recover edges?

Some cameras, such as the Ricoh GR III allow in-camera crops that output DNGs. The DNGs appear cropped but actually contain the full image data. Lightroom has a plugin that will ‘recover edges’ to create a new DNG at the full size.

Is there a way to do this with darktable, or would anyone know how to program it?

Thanks
Lee

Hi & welcome!

Not currently.

I’m sure people here will help figure it out. You should probably post some samples. Do you know anything further about this feature?

Hmmm, If you don’t mind, post a DNG for us to consider.

I am returning to this thread of mine. Here is an example - shot with the in-camera square format but the full 3:2 image should be available within the DNG. If this helps I can also upload an example DNG shot with an in-camera crop to 35mm (full FOV is 28mm). Some way to ‘uncrop’ or display full DNG would be great. I am not able to compile code but am happy to test out any DMGs provided on my Mac. Thanks. Lee

R0001360.DNG (27.9 MB)

Here’s some Adobe notes on their plugin (which no longer works in LR on Catalina!):

Lee

@lsdphoto: I’m nor sure this will be of any help to you but RawTherapee opens the DNG you made available in all its 3:2 glory. Here’s the down-scaled, unedited version that came out of RT:

darktable, I tested it on the latest development version, shows the squared crop.

If you are a darktable person you could maybe use RawTherapee to export the DNG as 16 (32?) bit floating TIF (the above one, 16 bit float, would be +/- 115Mb), import that in darktable and edit away.

Not ideal, but it might help you until (if?) darktable is able to handle this.

1 Like

Thanks for the tip, I will give it a try. So, the DNG must have some metadata that describes the coordinates for the in-camera crop. DT is acting on this and RT is not and just taking the full data. I guess the ideal place for DT to offer an option for this is in the crop module, though maybe a preferences tick box for ‘full DNG or in-camera crop’ might be possible?

Lee

DT takes the DefaultCropSize and DefaultCropOrigin tags from the dng file and takes them as the image area to be used.

If there is a DefaultUserCrop area defined DT will default to that region is you enable the crop module.

You could also use the complete “active area” of the sensor to be used for our image, that’s what RT does roughly.

You can do the same in dt by using a hidden option in the rawprepare module …

Mentioning that and not telling us how we can enable it just plain evil :rofl:

Ok, i know i am a bad guy :slight_smile:

In the .config/darktable directory you open darktablerc, that’s the file holding the config data. Search for plugins/darkroom/rawprepare/allow_editing_crop, set it to TRUE and start dt, the “raw back/white point” module will show 4 new sliders defining the crop.

Before doing so, a few reminders:

  1. This should be thought of as a debugging tool, not so for creative purposes.
  2. The width and height naming should be understood as crop at right & lower border
  3. You have to expect that the lens correction is not correct any more as sensor might now be out of centre. So the lensfun data (distortion and ca correction) are not calculated for that sensor and are not correct any more.
  4. This is strictly not meant to be copy & pasted or to be included in styles. Why? a) sensor size is not checked for being valid any more and b) black/white point correction might be totally different. Even if you do this for images from the same camera!
4 Likes

Thanks for this. I have enabled this option and I now see the 4 new sliders. The DNGs in question are from a Ricoh GR III and the full size images all have values for these sliders of (68,40,44,24). If I set these values for my ‘zoomed-in’ crops, I then see the full uncropped DNG without any black borders to the image.

So, this works a treat! I can even make a preset with these values but, of course, the values of the other sliders (black levels and white point) do vary a little, so a preset is only of limited use. In my case, with these values set, lens correction seems to work OK - not that I ever know how accurate that is anyway!

Nonetheless, for the relatively rare times that I want to see the full un-cropped images, this seems to be a useful option.

So, thanks very much!!

Lee

1 Like

Right, if you are using crops for full size images the lens thing should be ok here. (the camera would do dirty tricks :slight_smile:

Could you cheat and doctor the metadata in a copy. So copy the file to filename_uncropped and have a batch to add the correct numbers to the metadata…would that fool DT??

I don’t know whether exiv2 or exiftool can modify the tags. But don’t raise issues like “dt can’t read file …” after something went wrong. :slight_smile:

You could try to set DefaultCrop & friends to sensor defaults and write new tags DefaultUserCrop to whatever you want as hints where the crop module should start… take care

I just thought it you could set it that it might be a work around as all you are doing is setting it back to the full image. Seems like if DT is reading that and following it from the in camera crop it would follow it correctly if you reset it to the full image…on a copy of course and as an experiment…

I did come across this in a forum so maybe it can be done

So the only solution appears to be:

  1. Install Exiftool (Free)
  2. Open Terminal and navigate to the directory containing the image(s):
  3. For a single image called BD3A6291.CR2 with dimensions of 5760 x 3840 execute:exiftool BD3A6291.CR2 -AspectFrame=“0 0 0 0” -DefaultCropOrigin="" -DefaultCropSize="" -CroppedImageWidth=“5760” -CroppedImageHeight=“3840”

Share

This syntax works it seems with exiftool…It automatically renames your file to filename_original and then modifies a copy…

exiftool R0001360.dng -AspectFrame=“0 0 0 0” -DefaultCropOrigin=“” -DefaultCropSize=“” -CroppedImageWidth=“6112” -CroppedImageHeight=“4064”

Looks like you can use *.dng to do this as a batch…I just use the image size reported and that seems to work but maybe you would need to tweak it based on the active size settings…so another way to do it and this should be a full reset so that lens corrections etc works no??

image

1 Like