11

I noticed it for the first time when I took an image with the camera set for RAW+JPG mode. Because, I could see the 2 images side by side. The distortion is low enough that if I just looked at the RAW image, I would not notice it. But looking at it next to the JPEG , it is clear something is off.

  • Is this normal for RAW images? Does this happen just because RAW does not correct the image in any way while the JPEG does?

  • What is the best way to deal with it? Do I just have to eyeball it to figure out how much lens correction I have to use in lightroom?

  • Will the amount of distortion be exactly the same for every RAW image I will take with that camera + lens combo? Or does it depend on focal length, exposure parameters and other factors that might differ per image?

I am hoping the distortion is the same for a camera+lens combo as then it would be so much easier to correct for it. I could then figure out how much / what kind of correction to use once and apply the same correction to every image.

EDIT : I use Nikon D5600, with nikon AF-P DX nikkor 18-55mm 3.5:5.6G VR lens. I use Adobe DNG converter to convert the NEF files into DNG format which i then use in Lightroom

8
  • @Tetsujin I had tried View NX-i . But , NEF files do not work in LR ( or atleast my older version of LR.) SO, i use Adobe dng converter to convert the nef files into DNG and then use those DNG files in LR. But i will try NX-i once more and give it a shot. When you say NX-i does this automatically, what do you mean ? Do you mean using NX-i to convert NEF files into TIFF files, or do you mean when you extract NEF files from camera using NXi, it automatically edits the NEF files and lens corrects the images ? Jun 28 at 17:06
  • @Tetsujin I had tried using TIFF , but i realised it does not conserve all the info in the raw NEF file. Which is why i had to use the DNG converter. Using DNG format conserves all the info of the raw NEF file Jun 28 at 17:30
  • 1
    @Tetsujin " Whatever leaves NX-i as tiff arrives at Adobe unmolested " I am not so sure about this. I specifically tried converting NEF to TIFF ( using NXi) and using TIFF in LR vs converting NEF to DNG and using DNG in LR. In DNG, i was able to recover back some clouds from the highlights on a bright overexposed sky, but i was not able to do that with TIFF. This is why i concluded that TIFF does not leave the raw file unmolested Jun 28 at 17:39
  • 2
    @Tetsujin It depends on what your requirements and priorities are and what your constraints are. For my situation, that is the best workflow i have been able to figure out till now. For your situation, it is possible, it does not work best. That is not very surprising, different things work for different people Jun 28 at 18:45
  • 2
    That's more or less the definition of the image being raw sensor readout Jun 30 at 6:34
22

Is this normal for RAW images?

Yes, it is normal.

Based on my experience with Canon cameras with different lenses, the RAW image remains uncorrected w.r.t. to the corresponding JPEG.
This means that the following corrections set in camera are not applied (and can be applied separately in a RAW conversion program):

  • Colour corrections with picture profiles.
  • White balance corrections.
  • Noise "corrections", i.e. denoising.
  • Lens corrections

Sometimes RAW conversion programs of camera manufacturers (e.g. Nikon ViewNX or Canon Digital Photo Professional) read from the RAW photo file what corrections were set in the camera and apply these corrections (non-destructively) on the RAW file. This often results in an image that matches, or closely approximates, the camera JPEG.

Note that you never see the RAW image, it's always an interpretation of the RAW image by the conversion software (Lightroom in your case). Here is an excellent question about unprocessed RAW photos.

How to best deal with the lack of correction in RAW images?

Use the Lightroom Lens Corrections panel.

You don't need to eyeball it if you used a lens that is supported by Lightroom's lens correction module.

Assuming the lens is supported, you can select all photos taken with that lens and apply the appropriate lens correction profile:

  1. In the Lens Corrections panel of the Develop module, click Profile and select Enable Profile Corrections.
  2. To change the profile, select a different Make, Model, or Profile.

There are additional steps to the process for more advanced tweaking, you can view them on the linked Lightroom help page.

Is the required correction the same for all RAW images of a camera + lens combo?

No, they required correction also depends on the used focal length, the aperture, focus distance and your personal taste.

Lightroom uses the correction profile to derive from the lens settings (aperture, focal length) what kind of correction it needs to apply. The correction is therefore not exactly the same for every RAW image, but is exactly the same for the same lens, aperture and focal length.

Of course, you have the (artistic) freedom to apply another amount of lens correction than LR suggest, depending on the scene or the look you're going for. However, I find the default setting great to apply on all the photos (per lens) as a starting point and then tweak it from there.

3
  • 4
    If in-camera lens correction is turned on, some (but not many) raw convertors will apply lens corrections when initially opening the raw file and creating a processed image to be displayed on your screen. You're never actually viewing "THE raw image" on your screen, you're viewing one processed interpretation among a near countless number of equally valid interpretations of the raw image data.
    – Michael C
    Jun 29 at 19:34
  • An update on this situation. I installed a newer version of LR . LR classic 10.1 . It has the exact lens in its list in the lens correction panel. But , it still does not give the same result as the JPG. I tried to manually use the distortion slider, and it gives the required result near 77. But manually figuring out the distortion required for each image is probably not worth it. I will just live with the slight difference it has with JPG Jun 30 at 20:31
7

Yes, this is normal. The raw file contains just the raw data from the sensor, with no processing of any sort done (plus metadata, previews, etc). The embedded previews and the JPG produced when you are recording raw+JPG will have had certain types of processing done, based on your camera settings, but the raw sensor data is just raw sensor data. To deal with it you typically use software (Lightroom, DarkTable, RawTherapee, .....) that either has profile information for your specific camera/sensor and lens, or that has free-form corrections that you can apply until it looks "right" to you. But that software is what you would use for all other post-processing, as well - lens correction is just one of the many things you can do.

Edit: regarding the last question.... If you are using a prime lens, then the different aberrations should be similar in each picture, but probably not identical, because the focus distance can affect some of them. If you are using a zoom lens, then the focal length also has a significant effect (e.g. there is much more perspective "distortion" with an 11-24mm lens at 11mm than there is at 24mm....).

4
  • Thanks for answering. Do you have an answer to the last part? will the amount of distortion be the exact same for EVERY raw image i will take with that camera, or does it depend on the scene, focal length used, exposure parameters etc ? As that would mean i just need to figure out how much / what kind of correction to use once and i can apply exact same to every image Jun 28 at 14:13
  • For a wide-angle lens like the 11-24, you're thinking of barrel distortion, not "perspective" distortion.
    – Nayuki
    Jun 29 at 16:16
  • You are correct about the raw data being unprocessed. But what one sees on one's screen when opening a raw file is not the raw data, it is one processed version of the raw data. It's either the JPEG preview generated by the camera applying the in-camera settings at the time the image was taken (so if lens correction was turned on it will be applied, if lens correction was turned off it will not be applied) or it's a preview generated by the raw conversion app using the current settings applied when the file is first opened. Again, whether lens correction is applied or not depends on...
    – Michael C
    Jun 29 at 19:10
  • 1
    ... whether lens correction is turned on or off in the default profile applied when the image is initially opened. There is no such thing as "THE raw file" when you view a raw image on your monitor. It's always one of a near countless number of possible interpretations of the raw data.
    – Michael C
    Jun 29 at 19:28
4

Is it normal for RAW files to have lens distortion?

No. It's normal for lenses to have lens distortion and the image they distort is what is recorded in the raw file.

How best to deal with it?

Use a raw convertor that allows you to apply lens correction for distortion. For best quality, apply the lens correction before exporting from raw to any other image format, such as TIFF or JPEG.

Does this happen just because RAW does not correct the image in any way while the JPEG does?

Nothing is corrected in the raw image data. What you see on your screen when you open a file is not "THE raw image", though. It's a processed interpretation of the raw image data. The information in a raw image file is monochromatic and linearly responsive to the amount of light that struck each photosite (a/k/a sensel or pixel well).

If the raw convertor is set to apply lens correction by default, you'll see a preview image on your screen that has lens correction applied, though you can then turn it off if you wish.

If the raw convertor is set to not apply lens correction by default, you'll see an image that has not had lens correction applied, though you can then turn it on if you wish.

A lot of folks have this misinformed assumption that the first thing they see when they open a raw image file is "THE straight-out-of-camera raw file." There's no such thing.¹ All one has to do is open the same raw file with several different raw convertors to see how different the initial interpretation of the data in a raw image file can be.

Note:¹ With some raw convertors that allow total control over the imaging pipeline you could open a raw image file with each of the monochromatic luminance values displayed with linear brightness "curves" (straight line slopes instead of a gamma curve) and no demosaicing to get color information. What you'd see is something like this.

enter image description here

Applying gamma curves results in this:

enter image description here

Here's an extreme closeup of a portion of the image above.

enter image description here

For a more in-depth look at what a truly "unprocessed" raw file looks like, you can see the full answer these samples came from at What does an unprocessed RAW file look like?

3

The D5600, and other Nikon bodies going back at least 7 years, has a feature called Auto Distortion Control. This can be found on page 232 & 287 in the D5600 Reference Manual that came with your camera. If you don't have the manual, download it from Nikon's website. If enabled, the image will be corrected for lens distortion for known lenses in the JPEG file, not the raw file. The raw file is unprocessed image information and it is up to you to supply distortion correction in post processing. Adobe LightRoom, et al, has lens distortion correction functionality and will correct for any lens in its catalog (in camera will only correct for certain Nikon lenses and manually for unknown lenses). LR also has manual lens distortion correction.

9
  • Thank you, i know about that setting in the camera for the JPG file. My issue is how best to correct distortion in raw file. My LR is older one, it does not have my lens in its catalog. I know there is the manual method in LR, but i was asking if there is any other way. Using manual correction for every image seems too daunting Jun 28 at 18:51
  • 1
    ViewNX, Nikon's image editor that comes with your camera or can be downloaded from Nikon's web site, will automatically apply distortion control to raw images if ADC was enabled for the image.
    – qrk
    Jun 28 at 19:21
  • True,, but View NX is extremely limited in image editing funcitonality which is why i use lightroom Jun 28 at 20:09
  • @silverrahul Question, in Lightroom, if you enable distortion correction, can you pull down a list and choose the older 18-55mm AF-S lens? Maybe that will be a close enough correction. Otherwise, output a 16-bit TIFF from ViewNX, then import to Lightroom. Distortion correction isn't necessary in many cases unless you need to straighten lines. If you have an image of a large group of people where you used a wide angle lens, correct the stretched people on the edges with Photoshop's Adaptive Wide Angle filter. Straight lines will bend, but people will look much better.
    – qrk
    Jun 28 at 22:56
  • 1
    " can you pull down a list and choose the older 18-55mm AF-S lens? " Yes, this is the workaround i am currently using, until i figure out something better. " Otherwise, output a 16-bit TIFF from ViewNX, then import to Lightroom. " I have tried this. But 16-bit TIFF does not conserve all the RAW information. I tried to do this with an image of a sky and TIFF was not able to recover clouds from the highlights , whereas DNG was able to. Jun 29 at 5:35
3

Is this normal for RAW images?

Yes.

A RAW image is just that: raw. It is as close to the exact output of the sensor as you can get out of a given body. Critically, in most cases it will not even have been debayered, which gives you the opportunity to perform this step yourself (which can sometimes result in better image recovery compared to the on-body algorithm, which is almost always going to make some quality-for-speed trade-off), and better post-processing applications will allow you to experiment with different algorithms.

Consequently, of course, this means that the pixels will start with a one-to-one correspondence to sensor elements, which means no distortion correction. (Note that this is technically more accurate to film, which also would not have distortion correction.) As you probably know, the camera body does considerable post-processing of this RAW image in order to produce a JPEG, which may include operations such as noise reduction, correction for chromatic aberration, and distortion correction.

What is the best way to deal with it? Do I just have to eyeball it to figure out how much lens correction I have to use in lightroom?

Like debayering, better software will have options for correcting (or applying!) distortion. As a firm believer in Free(dom) Software I'm most familiar with lensfun (which is incorporated into e.g. GIMP and darktable). Such tools typically operate using a database of known lenses (I believe the only relevant property of the body is the sensor size). Some may include mechanisms to calibrate an unknown lens, which typically requires "reference images" containing straight lines (e.g. photographing a test chart). Basically, if you're using a "known" lens, this should just work "automagically", but (at least if you use Free software) if you have an "unknown" lens, you still have options if you're willing to get your hands dirty.

Short version: I can't speak to Lightroom as I morally avoid proprietary software, but darktable+lensfun should apply distortion correction automatically for known lenses. (There might be a box you need to tick, but you shouldn't need to futz with the distortion parameters.)

If you have an unknown lens and you don't want to go to the effort of actually calibrating it, another option would be to take a photograph of a test chart using the same lens and focal length, and use that to "eyeball" the necessary correction. You can then apply the same correction to your "real" image.

Will the amount of distortion be exactly the same for every RAW image I will take with that camera + lens combo? Or does it depend on focal length, exposure parameters and other factors that might differ per image?

AFAIK, only focal length matters. (Focal distance and aperture might, but exposure certainly does not. At any rate, most correction algorithms only care about focal length. And of course what lens you are using, but you asked about "for a particular lens". In fact, using a different body shouldn't matter as long as it uses the same sensor and mount, but a full-frame vs. DX sensor will matter. Hopefully, any body will have the lens' principle point centered on the sensor and the sensor parallel to the lens' focal plane, i.e. the mount ought to be universal.)

Keep in mind, distortion is a property of the camera optics and how they affect the path that light takes between the scene and the sensor. The shape of the lens assembly will obviously affect this, which includes focal length for variable zoom lenses. How long you expose the sensor obviously won't affect this. Other factors, such as aperture, focal distance and the distance between the camera and the subject (i.e. what you're shooting) may have an impact, but I believe it is significantly less than the "general" distortion and is typically ignored.

(One other note: software almost always assumes that the principle point is the center of the image. This is partly because this is almost always a safe assumption, but keep in mind it means you have to apply distortion correction before cropping an image.)

11
  • 1
    " I can't speak to Lightroom as I morally avoid proprietary software " Upvoted just for this. : ) Even though , i DO use lightroom Jun 29 at 13:49
  • @silverrahul, yes, I noticed from a different comment 🙂. Might want to give darktable a spin if you've never tried it; it's free and you wouldn't be "stuck" on an old version...
    – Matthew
    Jun 29 at 13:52
  • Which RAW format is it compatible with ? Does it support NEF files ? Jun 29 at 14:36
  • @silverrahul, "darktable can import a variety of standard, raw and high dynamic range image formats (e.g. JPEG, CR2, NEF, HDR, PFM, RAF … )." I use it with my Nikon D300 which produces some version of NEF. (I don't know for certain that there aren't multiple versions, but probably it will work with your camera. But it's free in both senses, so why not give it a try?)
    – Matthew
    Jun 29 at 15:34
  • 2
    @J..., "There's nothing evil about buying software"; absolutely! Supporting people that create software you use is unquestionably a good thing. What I don't agree with is other people dictating how I use my hardware, or how I use particular software, or whether I can use particular software. Your roofing example is interesting; if I hire someone to roof my house, I expect to own that roof and to be able to inspect it and to change it if I want, not to have the contractor force me to pay a licensing fee or forbid me from inspecting or modifying it. (Con't...)
    – Matthew
    Jun 30 at 13:50
0

RAW Files are contain just the output from the sensor. They are produced the same way regardless of the lens. Lenses produce optical distortion (some more mild than others) but that is what you see in RAW files. So, yes, it is normal if you are using a lens which exhibits distortion.

The best way to deal with it is to disable distortion correction for JPEG and HEIF (if available) so that all your files match geometrically. Distortion correction affects composition, so you cannot properly compose for the uncorrected lens if the camera is showing the corrected JPEG/HEIF preview that is often missing corners (for barrel distortion correction) or edges (for pincushion distortion).

When you look at your images, the apparent distortion depends on the subjects and you will find that most natural subjects note make distortion very visible but architecture and things with perfectly straight lines will really show even if there is a very small amount of distortion. All software correction is diminishes (even only slightly image quality) so this way you can decide when distortion correction is needed.

If the number of photos requiring distortion compensation is low, it is best to do it visually until the output looks good. You may find some images where fully undistorting the image causes you to lose an important corner or cut off something in an awkward position. This way you can back off a little as necessary.

If you have many, then ideally you use profile-based distortion correction tools that characterize a typical copy of the lens you have. This is the amount and shape of distortion at various focal-length and aperture combination which software uses to interpolate correction for the combination of focal-length and aperture used for each particular image (note the camera rarely affects distortion but many profiles are made for a camera and lens combination to correct for other defects). This is the approach offered by most modern photography oriented software. Should you have a lens with high variation due to low quality-control, you will have to produce a profile yourself. They are tools for that but it is not something I have done.

Optical distortion is not affected by the exposure itself. It could be affected by focus-distance but whether a profile takes that into account, probably depends on software. The cameras does not affect optical distortion but is usually included in the profile to correct color issues.

2
  • "is not affected by exposure parameters": Does the aperture have no effect on the amount of vignetting (which is one of the lens corrections)? Jul 1 at 16:55
  • Yes, sorry for the confusion. I set aperture and focal length are the primary parameters, so shutter-speed, ISO, EC, metering, etc don't impact the profile.
    – Itai
    Jul 1 at 19:30

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.