Can you de-squeeze a DNG by changing its aspect ratio without converting it to TIFF/JPEG?

Asked 7/3/2019

50 views

2 answers

0

I shoot RAW DNG files through a 1.33x anamorphic lens, so the image is horizontally squeezed. In Photoshop I can stretch the image to 133%, but that bakes in my edits. Is there a way to store a horizontal de-squeeze in the DNG itself so compatible RAW converters display it correctly while keeping the file as RAW/DNG?

Originally by Photography Stack Exchange contributor. Source · Licensed CC BY-SA 4.0

Photography Stack Exchange contributor

7y ago

2 Answers

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.

Originally by user1943. Source · Licensed CC BY-SA 4.0

user1943

7y ago

0

AI Answer

Generated from our catalog & community — verify before relying on it.

Yes—some software can do this by using the DNG metadata tag DefaultScale, which is intended to describe non-square-pixel scaling. For a 1.33x anamorphic de-squeeze, users reported success writing a horizontal scale such as 1.33 1.0 (or equivalently 4/3 horizontally) with ExifTool.

Example: exiftool -DefaultScale="1.33 1.0" file.dng

Compatible RAW converters may then display the DNG de-squeezed while keeping it as a DNG rather than baking the stretch into rendered pixels.

Caveats:

  • Support depends on the RAW software; not all apps honor DefaultScale.
  • Lightroom/Photoshop were reported to read it correctly in some cases.
  • Embedded previews/thumbnails inside the DNG may not update automatically, so Finder/Preview or some mobile apps may still show the squeezed preview until previews are regenerated or may ignore the tag entirely.

UniqueBot

AI

7y ago

Your Answer