DJI Mavic, Air and Mini Drones
Friendly, Helpful & Knowledgeable Community
Join Us Now

M3 DNGs and JPGs are not the same size-unable to align layers

jephoto

Well-Known Member
Joined
Oct 26, 2022
Messages
397
Reactions
145
Age
69
Location
Chicago, IL, USA
The title doesn't explain it all. I'm mostly a still shooter. and 99.9% of the time I shoot raw. For rather Raw+ JPG - but normally toss the JPGs and only use the raw.
But I'm working on a technique to get streaming light trails from cars or any moving lights, doing multiple exposures and blending a bunch of files all shot at 0.8/sec (1.25sec in camera) with 1 master frame.
You use timed exposures- JPGs - 2 sec interval and 1 single image for the overall and load a bunch of them into 1 Photoshop file as layers, change the Blending mode to Lighten to highlight the light trails, hide with a mask, then use 1 single exposure as a master for the scene and paint in the light trails on the mask. You get this: And its pretty cool.

But I found an interesting glitch. I wanted to use the DNG for the master overall image. But when you turn off the Lighten mode layer to reveal the DNG layer, the two images don't match up- even after Aligning all the layers.
The DNG layer has a slightly different shape. I've been beating my head on this for a couple of days because I couldn't get alignment of all my layers, and just now figured out that the DNGs out of camera are 5272 x 3948 pixels and the JPGs - even on the same image - are 5280 x 3956 pixels. WTF...????

For the image I included here I ended up using JPGs for all layers and it looks great. But I really wanted the flexibility of the RAW file for the overall scene.
Anyone have thoughts or ideas on this. Also occurs to me that if I change the output res not he raw file to match the long side, it may then match up. I will try this now.
 

Attachments

  • DJI_0767-Edit_MichAve_dusk_1500px-Web.jpg
    1.9 MB · Views: 43
Holy Crap. Still doesn't work. Even when I adjust the output file on the DNG to 5280 pixels, it still doesn't match. Nor does it if I try to force it and change both dimensions I can get the width to 5280, but height is 3954 - 2 pixels off.
Again I say.. WTF??
 
just now figured out that the DNGs out of camera are 5272 x 3948 pixels and the JPGs - even on the same image - are 5280 x 3956 pixels. WTF...????
There has always been this minor difference in pixel dimensions between dng and jpg files with DJI cameras.
 
There has always been this minor difference in pixel dimensions between dng and jpg files with DJI cameras.
As I said- 99.99% of the time I just use the DNGs. Never knew there was a difference. Makes it hard to combine & use the JPGs and DNGs together. At lest for this application.
Can the Mavic 3 shoot RAW in 2 sec. intervals? Or only 5sec?
 
This happens with othere cameras as well. For example the Leica M240 has the same "problem", and I have also seen it on some of my cameras. It has several causes, depending how the manufacterers have implemented the image processing. Demosaicing, interpolation and JPG-compression algorithms are key points here. It is quite common, and not only in cameras from DJI.
 
This happens with othere cameras as well. For example the Leica M240 has the same "problem", and I have also seen it on some of my cameras. It has several causes, depending how the manufacterers have implemented the image processing. Demosaicing, interpolation and JPG-compression algorithms are key points here. It is quite common, and not only in cameras from DJI.
Thanks. Good to know. It's rare (obviously) that I'd ever want to use them both as aligned layers. Now I know to to even try. Either all JPG or all RAW....
 
The JPG processing in cameras has been including geometry distortion corrections for quite a while now, so yeah not surprising.
You'd think there'd be a way to match the corrections in Lightroom, but I haven't figured it out yet. Annoying...
 
Most cameras perform a bunch of image manipulations when making jpegs. They are making what they consider the most appealing finished image for the average viewer, including distortion corrections and color adjustments. Shooting side by side with Nikon and Canon still camera jpegs the different interpretations are quite obvious.

Before digital, the film manufactures would do the same thing with their films. Kodak, Agfa, and Fugi all had unique looks.
 
Unique looks in color & contrast are way different than different dimensions and proportions for the same image.

When we open the DNGs in Lightroom or Photoshop the Lens Profile says "Built in", but obviously something isn't translating.
 
Last edited:
Awesome photo!
 
….When we open the DNGs in Lightroom or Photoshop the Lens Profile says "Built in", but obviously something isn't translating.
Does the Lens Profile identify the Mavic 3 as the source of the image?

Another approach that would take some time and effort would be to construct/print a large grid target, or find a suitable target in the wild, and build your own Lens Profile which matches the DNG to the geometry of the JPG. Probably through a trial-and-error, successive approximation approach.

This is speculation - I’ve not done it! In theory you may be able to match the DJI internal distortion processing… There may have to be a slight crop as well.
 
DNGs that DJI produces contain lens distortion information (opcodes) that Adobe Camera RAW will automatically apply (that's what "Built in" means in LR and afaik you cannot turn it off). It will also happen in PanoVolo, because we use Adobe DNG SDK to process DNGs, so our results are the same as Camera RAW/Lightroom.

When DJI saves their JPEG they apply their own corrections, but they are not the same as the ones Camera RAW applies - the algorithms are not guaranteed to work the same. Hence the geometric and size mismatch. It seems there really no reliable path to mix and match DNG and JPEG images, unless we have a full clarity on how DJI bakes their JPEGs.
 
  • Like
Reactions: sar104
DNGs that DJI produces contain lens distortion information (opcodes) that Adobe Camera RAW will automatically apply (that's what "Built in" means in LR and afaik you cannot turn it off). It will also happen in PanoVolo, because we use Adobe DNG SDK to process DNGs, so our results are the same as Camera RAW/Lightroom.

When DJI saves their JPEG they apply their own corrections, but they are not the same as the ones Camera RAW applies - the algorithms are not guaranteed to work the same. Hence the geometric and size mismatch. It seems there really no reliable path to mix and match DNG and JPEG images, unless we have a full clarity on how DJI bakes their JPEGs.
Perhaps you've not seen the Lens Corrections panel in Light Room and Photoshop/ACR?

You most certainly can turn it on and off, make further adjustments or custom adjustments, select a different profile, create a new profile using the Lens Profile Creator, etc.

See attached images!

My understanding is that the lens/camera type is part of the exif metadata, but that lens corrections are not part of the data in the file. With the exif on the lens/camera type the Adobe products look for a match in their database.

To the OP, making further adjustments to your DNGs and selecting "Constrain Crop" *may* lead to a better or perfect match to your JPGs. It would take some back and forth, and would certainly be easier with matching images of a regular grid-like image.

1701712775118.png
1701712792422.png
1701712802554.png
 
This is what LR shows for DJI DNGs:

View attachment 170750

You can apply another, manual profile on top of the built-in one, but there is no way to turn the built in one off. If you know the way, pls share.
Hmm, that's not good!

My example was for a Canon DSLR with a .CR2 Raw file. That adobe is treating DNGs differently with baked in conversion is not great, IMO. (mostly I'm on the video side with drone work)

OK, back to the OP, adding a Manual correction on top of the pre-baked correction may or may not get what you want...
 
The title doesn't explain it all. I'm mostly a still shooter. and 99.9% of the time I shoot raw. For rather Raw+ JPG - but normally toss the JPGs and only use the raw.
But I'm working on a technique to get streaming light trails from cars or any moving lights, doing multiple exposures and blending a bunch of files all shot at 0.8/sec (1.25sec in camera) with 1 master frame.
You use timed exposures- JPGs - 2 sec interval and 1 single image for the overall and load a bunch of them into 1 Photoshop file as layers, change the Blending mode to Lighten to highlight the light trails, hide with a mask, then use 1 single exposure as a master for the scene and paint in the light trails on the mask. You get this: And its pretty cool.

But I found an interesting glitch. I wanted to use the DNG for the master overall image. But when you turn off the Lighten mode layer to reveal the DNG layer, the two images don't match up- even after Aligning all the layers.
The DNG layer has a slightly different shape. I've been beating my head on this for a couple of days because I couldn't get alignment of all my layers, and just now figured out that the DNGs out of camera are 5272 x 3948 pixels and the JPGs - even on the same image - are 5280 x 3956 pixels. WTF...????

For the image I included here I ended up using JPGs for all layers and it looks great. But I really wanted the flexibility of the RAW file for the overall scene.
Anyone have thoughts or ideas on this. Also occurs to me that if I change the output res not he raw file to match the long side, it may then match up. I will try this now.
Have you tried long exposure in raw, taking multiple pics that can be blended? Mavic 3 great for long exposure photography. Just starting to learn about it. I want to get into making really cool prints.
 
DNGs that DJI produces contain lens distortion information (opcodes) that Adobe Camera RAW will automatically apply (that's what "Built in" means in LR and afaik you cannot turn it off). It will also happen in PanoVolo, because we use Adobe DNG SDK to process DNGs, so our results are the same as Camera RAW/Lightroom.

When DJI saves their JPEG they apply their own corrections, but they are not the same as the ones Camera RAW applies - the algorithms are not guaranteed to work the same. Hence the geometric and size mismatch. It seems there really no reliable path to mix and match DNG and JPEG images, unless we have a full clarity on how DJI bakes their JPEGs.
That's weird, because I find the M3 RAW images from the 12mm camera need about an 11 in the distortion correction slider.
 
Lycus Tech Mavic Air 3 Case

DJI Drone Deals

New Threads

Forum statistics

Threads
131,130
Messages
1,560,127
Members
160,100
Latest member
PilotOne