Editing an ImageLesson 10 of 78

Contents

Editing an Image

Lesson 10 of 78. Sign in to keep your place.

Module 1 · What an image is made of

Straight lines that are not straight, and colour that is not there

9 min read

The image arrives already distorted

Before any editing decision, the optics have altered the picture in four measurable ways. All four are correctable, all four are best corrected first, and knowing which is which stops you fighting the wrong one.

Geometric distortion. Straight lines bow. Barrel distortion bulges outward, common at wide angles; pincushion pinches inward, common at telephoto. A phone’s ultrawide camera can have eight to ten per cent barrel distortion: enough that a doorframe at the edge of frame is visibly curved. Some phones already correct it in software before you see the JPEG; shoot DNG and you get the raw, bent version.

Vignetting. The corners are darker than the centre, because less light reaches the edge of the frame. Typically half a stop to two stops wide open, less when stopped down. Mild vignetting is often desirable and frequently added back deliberately; heavy vignetting on a product shot against white shows as grey corners on what should be a uniform background, which is a real nuisance.

Chromatic aberration. The lens focuses different wavelengths differently. Two kinds, and the difference matters:

  • Lateral (transverse) CA: the channels are magnified by slightly different amounts, so you get coloured fringes that grow towards the corners, usually cyan-red or blue-yellow, along high-contrast edges. This is fully correctable, because the fix is to rescale the red and blue channels by a fraction of a per cent.
  • Longitudinal CA: the channels focus at different distances, producing purple or green fringing on out-of-focus highlights, especially wide open. This is not geometrically correctable, because the channels are not displaced; they are differently blurred. The only treatments are desaturating the fringe colour locally or accepting it.

Diffraction. Stop a lens down past roughly f/11 on a full-frame camera, or f/8 on a crop sensor, and light bending round the aperture blades softens the whole frame. On a phone, with its tiny fixed aperture, this is already in play. Sharpening will not fix it, because it is a loss of resolution rather than a loss of contrast.

Profiles do the work for you

Every correction above is specific to a lens, and often to a focal length and aperture. Lens profiles are measured tables of those corrections.

Lensfun is the free, community-maintained profile database, and it is used by darktable, RawTherapee, digiKam and a GIMP plugin. It covers most common lenses and most phones. Adobe ships its own profiles in Camera Raw and Lightroom. In darktable the module is lens correction; in RawTherapee it is under Transform > Lens/Geometry.

When there is no profile for your lens, which happens often with phone cameras and new releases, every tool offers manual sliders. For distortion, find a straight line near the edge of the frame, turn on the grid overlay, and drag until it is straight. For lateral CA, most developers have an automatic option that works well without any profile, because the correction can be derived from the image itself by aligning the channels along edges.

Order matters, and the reason is arithmetic

Geometry corrections resample every pixel in the frame. They are the one class of edit that moves the coordinates of everything.

So do them first, before cropping, before retouching, before any local work. Three consequences follow:

  • Retouching done before a distortion correction gets stretched with everything else. A cloned patch that matched perfectly can end up smeared.
  • Distortion correction changes the frame shape, so the corners need trimming. You lose a few per cent of the image, and if you had already cropped tight, that loss comes out of your composition.
  • Because correction stretches the corners more than the centre, corner sharpness gets worse. You are interpolating existing pixels over a larger area. This is real and unavoidable, and it is why heavy distortion correction on an already-soft ultrawide corner produces mush.

Perspective is not distortion

A commonly confused pair. Point a camera up at a building and the verticals converge. That is not a lens fault; it is correct projective geometry, exactly what your eye does. The building does subtend a narrower angle at the top.

Correcting it (keystone correction, Upright in several tools, Perspective in GIMP’s Transform tools, Transform > Perspective Warp in Photoshop) is a deliberate choice to draw the building the way architectural drawings do. It works by stretching the top of the frame, which costs resolution at the top and crops the sides. Correct a 15-degree upward tilt and you can lose a fifth of the image. For serious architectural work the answer is a tilt-shift lens or shooting wide and straight and cropping, not a heavy warp.

Hugin, free and open source, does this and far more: it is a panorama tool whose lens and perspective correction engine handles cases no slider will.

What cannot be corrected

  • Flare and veiling haze from a light source in or near the frame. Contrast recovery helps; the scattered light landed on the sensor and is now part of the signal.
  • Longitudinal CA, as above.
  • Diffraction softness: you can add acutance with sharpening, and the resolution is gone.
  • Extreme fisheye stretch at the very corner, where the sampling density was so low that correction has almost nothing to work with.

And one more honest point: correcting distortion is not always right. A 24 mm portrait has enlarged the nose, and “fixing” the geometry does not fix that, because it is perspective from a close camera position rather than lens distortion. The answer there is to stand further back and use a longer lens. Optics problems are usually cheaper to solve at capture than in the editor, which is a theme you will meet again in this course.

Every lesson here is open. Your progress is recorded once you pass the Design, before Any Software exam.

Check your understanding

A photograph taken wide open shows purple fringing on the out-of-focus highlights behind the subject. Enabling the lens profile’s chromatic aberration correction removes the coloured edges at the frame corners but leaves the purple highlights untouched. Why?

Pick the one you would defend. Your answer stays private.

Next lesson · 9 minEvery edit should still be undoable next week

Stuck on something?Ask Neema, your AI tutor

How to cite: Addaly (2026) ‘Straight lines that are not straight, and colour that is not there’, in Editing an Image. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/image-editing/what-the-lens-did (Accessed: 13 October 2026).