Lens Distortion, Color Fringe & Vignetting Correction
Straighten barrel or pincushion distortion, shrink red/blue fringes and brighten dark corners.
How it works
Upload a photo and correct barrel or pincushion lens distortion with a two-term radial model, align the red and blue channels to reduce lateral color fringes, and brighten or darken the corners in linear light. Automatic scaling fills the frame without empty corners. Download a PNG plus the settings as JSON for the Lumina photo editor, where the same correction stays editable.
- Auto-oriented, display-referred 8-bit sRGB. The radius is measured from the image centre in half-diagonal units (1 in the corners). Sampling is bilinear on premultiplied alpha; the output keeps the input size.
- A manual, generic radial model: no lens database, camera profile or EXIF lens data is used, and fisheye projections are not supported.
- Each output pixel centre is divided by the zoom, then sampled at radius r × (1 + k1·r² + k2·r⁴) (Lensfun 5th-order polynomial model). Red and blue are sampled at that position scaled by 1 + 0.00002 × value (linear TCA model) and clamped to the photo edge.
- Corner brightness multiplies linear-light RGB by 2^(EV × r²) at the source radius, with EV = value / 100; results above white clip.
- Automatic scaling bisects the zoom (48 steps, 1028 border samples) for the widest view whose whole frame lies inside the photo. Past the radius where the polynomial stops increasing, and outside the photo with manual scale, pixels become transparent and are counted.
Sources
- Lensfun manual: distortion (poly5), transverse chromatic aberration (linear) and vignetting (pa) models (Lensfun project)
- darktable user manual: lens correction module (distortion, TCA red/blue, vignetting, image scale) (darktable)
- GIMP 3 manual: Lens Distortion filter (main, edge and zoom controls) (GIMP)
Part of Lumina
-
Lumina Photo editor & image toolkit
Bring out what you saw. A free photo studio, right in your browser.
How to use the Lens Distortion, Color Fringe & Vignetting Correction
Straighten lines bent by a wide-angle or zoom lens, reduce red and blue fringes, even out dark corners and download a corrected PNG plus reusable settings.
What it is for
Wide-angle lenses, action cameras and many phone ultra-wide modes bend straight lines: door frames and horizons bulge outwards near the edges (barrel distortion). Some telephoto zooms do the opposite and pinch the edges inwards (pincushion). Cheaper lenses also show coloured fringes along high-contrast edges near the corners and darker corners overall.
This tool corrects all three on one uploaded PNG, JPEG or WebP (up to 8 MB and 16 MP). Distortion and Edge distortion bend the picture back with a two-term radial model, Red fringe and Blue fringe scale those colour channels slightly so they line up with green again, and Corner brightness lightens or darkens the corners in linear light. By default the result is scaled so the whole frame stays filled.
It is a manual correction with a generic model. There is no lens database, it does not read the lens name from EXIF, and it cannot rectify fisheye images or a tilted camera (use perspective correction in Lumina for a photographed page).
Worked example
The built-in example is a 160 × 120 drawing of a grid with synthetic barrel distortion: the outer lines visibly bow outwards. With Distortion 60 and everything else at default the tool returned:
160 × 120 photo corrected at an automatic scale of 93.9 %.
The metrics show k1 = −0.15 and 0 transparent pixels. The reference table explains what happened: the top-left corner of the output samples the photo at (9.28, 6.96), 11.61 pixels further in, while the right edge centre moves 4.06 pixels and the image centre does not move at all. Pulling the corners in more than the edges undoes the bulge; the 93.9 % scale is the widest view that still fills the frame.
The second example shows the other direction. Distortion −30, Corner brightness 20, automatic scaling off and a scale of 100 % gave k1 = 0.075 and a corner gain of 0.2 EV, but also a warning: 1,664 pixels lie outside the photo and are transparent. Pincushion correction pushes the corners outwards, so at 100 % they have nothing to show. Switch automatic scaling back on and the frame is filled again.
How to read the result
- Download corrected PNG: same size as the upload, metadata removed, transparency kept.
- Scale: the zoom applied after the correction. Below 100 % the view widened (barrel), above 100 % it was cropped in (pincushion).
- Transparent pixels outside the photo: should be 0 with automatic scaling.
- k1, k2: the radial coefficients behind the sliders, so you can reproduce the result elsewhere.
- Corner exposure change: the brightness change in EV at the very corners.
- Reference points table: where each point of the frame samples the photo and how far it moved.
- Download lens settings: a JSON file you can open in Lumina to add the settings to your lens presets.
Tips and common mistakes
- Judge distortion on a straight line close to an edge, never in the middle: the centre does not change.
- Raise Distortion until the most-curved line is straight; use Edge distortion only when corners stay bent while the middle of the edges looks right.
- Fringes are tiny. Change Red fringe and Blue fringe in small steps while zooming in on a dark branch against the sky.
- Correct distortion before cropping. The tool works on the whole frame, and a cropped photo no longer has its optical centre in the middle.
- Corner brightness above about 60 also brightens corner noise.
- Photos from the same camera and focal length need the same settings, so save them once as a lens preset in Lumina.
FAQ
Which value fixes my lens?
There is no fixed table. Typical wide-angle lenses need 15–40, action cameras in linear mode 70–100. Start from a Lumina preset and adjust.
Why did my photo get slightly smaller or bigger?
Automatic scaling zooms so the corrected photo fills the whole frame. Turn it off and choose a scale yourself if you prefer to keep everything and accept transparent corners.
Is the correction the same as in the Lumina photo editor?
Yes. Lumina runs the same engine on your device, before crop, straighten and rotation, and keeps the settings editable in the project.
Can it correct fisheye photos?
No. Fisheye lenses use a different projection; this radial polynomial only handles ordinary barrel and pincushion distortion.
Guide last updated:
For scripts and AI agents
- JSON API:
POST https://luminalenscorrect.usefulweb.app/api/v1/calculate(same calculation as this page) - Interface description: OpenAPI 3.1 · AI guide: llms.txt
- MCP server (Streamable HTTP):
https://luminalenscorrect.usefulweb.app/mcp· tool namelumina_lens_correct
Example request
curl -s -X POST https://luminalenscorrect.usefulweb.app/api/v1/calculate \
-H 'content-type: application/json' \
-d '{…see OpenAPI examples…}'