IMG · Images tools

Perspective Correction

Shareable link

Settings are written to the URL as you change them. Nothing differs from the defaults yet.

Straighten a rectangle that was photographed at an angle. Place the four corners on its edges, choose whether the output is the rectangle alone or the whole photo, and download the result at full resolution.

Place the corners

The handles start inset from the frame. Drag each one onto a corner of the rectangle in the photo: the edge of a page, the frame of a whiteboard, the outline of a sign, the base and roofline of a façade. A grid is drawn inside the shape as you go. Its lines are the straight lines of the corrected result mapped back onto the photo, so a grid line that runs along a real edge means the corner is right and one that drifts off it means the corner needs moving.

Holding a corner opens a loupe, a circle that shows the photo at three times its displayed size around the handle. Use it to land the corner on the pixel where two edges meet. With a handle focused, the arrow keys move it by one pixel of the source image and Shift with an arrow key by ten.

The shape has to stay four-sided. A drag that would fold one corner across the opposite edge is refused.

Crop to corners

The default output makes the area inside the corners the whole picture. This is the document-scanner mode: a page on a desk, a slide on a projector screen, a notice on a wall, a whiteboard at the end of a meeting. Nothing outside the corners survives.

Example: a phone photo of an A4 page shot from a chair. Put the corners on the four corners of the paper and download. The output is the page alone, square to the frame, in A4 proportions, at a width equal to the longer of the page’s two horizontal edges in the original.

Keep everything

Keep everything applies the same correction to the entire photo, then trims it. This is the architecture mode: converging verticals on a building, a room shot from a corner, a storefront photographed from across the street. Place the corners on something in the scene that is really rectangular, such as a window, a door or the façade itself, and the whole picture is straightened around it.

Straightening stretches the parts of the picture that were farther from the camera, so the corrected photo is a trapezoid rather than a rectangle. The output is the largest rectangle that fits inside it with no empty corners, found by searching every pair of top and bottom edges. The Output readout shows the size that produces. When the perspective is so steep that nothing outside the corners can be framed, the mode falls back to the corners alone and says so.

Proportions

A rectangle seen at an angle does not keep its proportions in the photo, so the width and height of the output cannot be read from the drawn shape. They are estimated from the perspective instead. The two vanishing points of the quadrilateral, where its opposite edges would meet, fix the focal length of the lens if the optical centre sits at the middle of the frame, and the focal length fixes the real width over height. The method is the closed form from Zhang and He’s whiteboard scanning work at Microsoft Research, and on a photo straight out of a camera it recovers a page’s proportions to within a few percent.

It needs perspective to read. When opposite edges of the drawn shape are parallel, as in a photo taken square on, there is no vanishing point and the proportions of the drawn shape are used as they are. A cropped photo, or one with the optical centre moved by a shift lens, gives an estimate that is off by the same amount the centre is off.

Resampling

Every output pixel is traced back through the inverse of the mapping to a position in the source and sampled there with Catmull-Rom bicubic interpolation, which keeps text edges and fine lines sharper than the bilinear sampling most upload tools use. The width of the output is set by the longer of the two horizontal edges you drew, so the sharpest edge of the original is never scaled down. The preview resamples a reduced copy; the download works on the full file in a background thread with a progress readout.

Limits

Lens distortion is not perspective. A wide lens bows straight lines into curves, and a four-corner mapping moves lines without unbending them. Correct the curve first with the Lens Distortion Effect at a small negative Curvature, then straighten here.

The far side of a steep perspective is enlarged, so a page photographed at a grazing angle comes out soft along its far edge. There are fewer source pixels there than the output asks for, and no resampler can add detail that was never captured.

Keep everything removes real picture at the edges by design. If the trimmed frame loses something you need, move the corners onto a rectangle closer to the centre of the photo, which reduces the correction and the amount trimmed with it.

Frequently Asked Questions

It takes a JPEG, PNG or WebP photo of something rectangular that was shot at an angle, and remaps it so that rectangle comes out square to the frame. You place the four corners by hand; the download is in the same format as the file you loaded.

Crop to corners makes the area inside the four corners the whole output, which is what a scanned page, a whiteboard or a poster wants. Keep everything applies the same correction to the full photo, then trims it to the largest rectangle that has no empty corners, which is what a building or a room wants.

The width over height of the real rectangle is estimated from the four corners, assuming a normal lens with its optical centre at the middle of the frame. The two vanishing points of the quadrilateral fix the focal length, and the focal length fixes the proportions. When the corners are nearly a parallelogram there is no vanishing point to read, so the drawn proportions are used instead.

Straightening converging verticals stretches the top of the picture outwards, so the corrected frame is no longer a rectangle. The output is trimmed to the largest rectangle that fits inside it with no blank corners, which removes some of the sky and the foreground at the edges. Shoot with more room around the subject if you need those edges.

No. Perspective is a straight-line mapping; barrel distortion from a wide lens bows straight lines, and no four-corner correction can undo a curve. Fix the curve first with a small negative Curvature in the Lens Distortion Effect, then straighten the perspective here.

Put each corner on a sharp edge of the real rectangle rather than on a shadow or a rounded corner. While you hold a corner, a loupe shows the photo magnified three times around it. With a corner focused, the arrow keys move it one pixel and Shift with an arrow moves it ten.

The width is set by the longer of the two horizontal edges you drew, so the sharpest part of the original is not downsampled. The long side is capped at 1.5 times the long side of the source and at 8000 pixels, and very steep perspectives are scaled down to fit that cap.

Explore Our Tools

Browse all tools