5

I am shooting raw DNGs through an anamorphic lens that squeezes my image by a factor of 1.33 in the horizontal direction. I can easily correct the aspect ratio by opening the image in Photoshop and stretching it horizontally by 133%, but then I have to bake-in all of my choices about colour and exposure adjustments.

Is there a way to change the aspect ratio of a raw photo (by stretching rather than cropping it) while leaving it in its original DNG format?

8

The DNG spec contains a tag DefaultScale:

DefaultScale is required for cameras with non-square pixels. It specifies the default scale factors for each direction to convert the image to square pixels. Typically these factors are selected to approximately preserve total pixel count.

The situation with your anamorphic lens is effectively this: the photosite on the sensor may actually be square, but due to the lens's compression effectively actually represents a rectangle. So, in theory, setting this value should tell RAW converters to stretch the result. Specifically, if you set DefaultScaleH to 4/3, I think this should indicate what you want. (Note that Exif supports a "rational" data type for fractions, rather than floating point.)

However, this will require support in whatever software you are using.

User @derQuestions confirms that Lightroom and Photoshop both handle this correctly.

Unfortunately, I just tried this on a sample file with RawTherapee and darktable, and both of these seemed to ignore the value. However, I then broke out the venerable (and unfortunately far less powerful) UFRaw and that does work — the file was stretched as expected.

| improve this answer | |
2

I got a DNG image from iOS. I ran exiftool on it like this:

exiftool -DefaultScale="4.0 3.0" IMG_9270.dng

When opened in OS X's Lightroom or Photoshop it is de-squeezed properly. It is important to note that the preview image doesn't get updated with this tag adding approach. I am unsure how to force thumbnail and preview to be re-generated. (There is a way in Lightroom but I am not sure how to from the command line or any other programatic way.) OS X's Preview and Finder will not register the tag addition and update the preview.

It looks like this image is read properly on iOS's Lightroom. However it looks like all other iOS programs ignore the tag or are just using the jpeg info in the DNG to edit it.

This technique is super useful for dealing with anamorphic lenses like Moondog or Moment, but you have to use a pure Adobe processing pipeline for it to help.

Someone should file a ticket to Apple to get them to support the DefaultScale tag in their raw processing pipeline.

| improve this answer | |
  • What happens when you export a JPEG from Lightroom (or Photoshop) using a "de-squeezed" DNG? – mattdm Jan 6 at 13:06
  • Just tested in Lightroom and the JPEG generated from the DNG file is de-sqeezed properly. – derQuestions Jan 6 at 15:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.