Skew straightens a photo taken at an angle. Drag the photo's four corners to where the sheet's corners should be, and the whole picture is re-projected, as if the camera had been square on. Unskew makes it rectangular again.
What it does
Press the Skew tile (“Drag each corner”; its tooltip reads “Drag the photo’s corners to put a photo taken at an angle into shape”). The pill at the top of the canvas says “Drag the corners into place”.
- Drag a corner and the photo is redrawn so that its corner lands there, with the picture between the corners carried along in perspective, not just stretched.
- Drag inside the photo to move the whole thing.
- A corner stops short rather than go anywhere that would fold the photo over itself: the four corners must always make a convex shape, turning the same way at each corner.
- While you drag, the photo is drawn roughly (640 pixels on its long side) so it keeps up with your hand; when you let go, it is drawn properly (1,600).
Done or Enter keeps the skew. Cancel or Escape puts the photo back exactly as it lay before you pressed Skew. Once the photo is skewed, the pill also offers Unskew.
The Unskew tile (“Back to rectangular”) appears only while the photo is skewed. It makes the photo rectangular again, with its own proportions, as large as fits in the box the skewed photo covered and centered in it.
While the photo is skewed:
- Crop is off, and Move photo can only move it; Fit and Fill clear the skew.
- Everything else sees the straightened photo: the previews, Trace, Build flips and the color pipette, which finds its pixel by running your tap back through the skew.
- Around the photo there is nothing. That empty area counts as back and is left out of the histogram, so it neither traces nor sways Auto.
A skew is not in Undo, since the photo never is. Cancel, and Unskew, are the ways back. Find sheet, for a photo of a paper notan, makes a skew for you.
Why it works this way
Photograph a square sheet from anywhere but straight above and it comes out as a four-sided shape with no right angles: the near edge long, the far edge short. No combination of moving, scaling and turning puts that right. It needs a perspective map, and a perspective map of a flat surface is fixed exactly by four points. Four corners in, four corners out, and every point between is decided.
The map is a small grid of nine numbers called a homography. The app solves for it from your four corners, then works backwards: for each pixel of the straightened picture it asks where that point came from in the photo, and blends the four photo pixels around it. Points that would come from beyond the horizon are left empty.
The corners must stay convex for a reason in the geometry. Four points can be mapped to any four others, but if the result folds over itself, part of the picture would have to pass through the horizon to get there. No photograph of a flat sheet can look like that, so the corner stops.
Two limits are worth knowing. A skew straightens one plane, the plane of the paper; anything standing off it, a curled flap or a cast shadow, stays slanted. And it corrects perspective, not lens distortion: if the sheet's straight edges bow in the photo, they will still bow. Finally, a steep photo spends few pixels on its far end, and stretching those out makes that end softer. A photo taken from nearly above always beats a heroic correction.
The metaphor
Skew borrows the view camera and the tilting enlarger. A photographer with a large-format camera could shift and tilt the lens and film to keep a building's walls upright; a darkroom worker could tilt the easel under the enlarger to straighten a picture already taken. In 1901 Jules Carpentier patented an enlarger built to correct perspective, and in 1904 Theodor Scheimpflug patented apparatus for correcting perspective in photographs, work he applied to aerial photographs for mapping. His name survives in the principle that tells you how to tilt the planes and keep the picture sharp.
The metaphor holds for what is moved: a whole plane, re-projected. It breaks over focus. On the easel, a tilted print went soft at one end unless the lens was tilted too. Here nothing ever goes out of focus; instead, pixels are stretched, and a stretched pixel is its own kind of blur.
A history
In art
In On Painting (1435), Leon Battista Alberti described the picture as a window, and gave painters a tool to match: a veil of thin threads divided into squares, stretched on a frame between the eye and the subject. What was seen through each square was drawn in the matching square on the panel. It is a skew in reverse: the world's perspective pinned down on a grid.
Albrecht Dürer's treatise on measurement, Underweysung der Messung, appeared in 1525. Its posthumous edition of 1538 added woodcuts of drawing machines, among them a draftsman looking through a gridded frame at a reclining woman and copying her square by square onto gridded paper. Both images are about the same thing as this tile: fixing how a flat picture relates to what it shows.
Hans Holbein turned the idea into a trick in The Ambassadors (1533), in the National Gallery in London. A long gray smear across the floor becomes a skull only when you stand well to one side of the picture and look along it. It is a deliberately extreme projection, and the viewer's eye has to do the unskewing.
In printing
This is a thinner strand, but a real one. The printer's process camera photographed artwork to make plates, and its copy board had to sit exactly parallel to the film, or square artwork came out as a trapezoid, the fault called keystoning. Mapmakers had the harder version of the problem: an aerial photograph taken from a tilting aircraft had to be rectified, re-projected onto a level plane, before it could be printed as a map. Scheimpflug's apparatus was built for that job.
In technology
The mathematics came long before the machines. Girard Desargues founded the geometry of projection in the seventeenth century, and Jean-Victor Poncelet revived it in his Traité des propriétés projectives des figures (1822), developed from notebooks he wrote as a prisoner of war at Saratov after Napoleon's Russian campaign of 1812. Projective geometry studies what stays true when a figure is projected: straight lines stay straight, and that is all a homography promises.
In 1971 Y. I. Abdel-Aziz and H. M. Karara published the direct linear transformation, a way of solving such maps from matched points with plain linear algebra; it became a standard of photogrammetry and computer vision. This app solves the same kind of equations: eight unknowns, two from each of four corners. Photoshop brought perspective editing to everyone with Vanishing Point (CS2) and the Perspective Crop tool (CS6), and phone apps that flatten a photographed document do it with a homography.
In professional software
Straightening a photo of something flat is called perspective correction, keystone correction or, in mapping, rectification. Everywhere it rests on the same fact as here: four points fix a flat plane.
- Adobe Photoshop. The Perspective Crop tool shares a slot with the Crop tool (
C). Mark the four corners of something that ought to be rectangular and press Enter, and it crops and straightens in one step. For a layer, ‘Edit › Transform › Distort’ lets you drag each corner freely, which is the Skew tile’s way around: you move the picture’s corners to where they belong. - Adobe Lightroom. ‘Upright’, in the ‘Geometry’ panel (the ‘Transform’ panel in Lightroom Classic), straightens a photo automatically with Auto, Level, Vertical or Full. ‘Guided’ lets you draw two to four lines along edges that should be straight, and the photo is corrected to match them.
- Adobe Scan. The phone app finds a page’s four corners by itself and flattens the page. If it guesses wrong, you drag the corners, much as you would with Skew here.
- Autodesk AutoCAD. The Raster Design toolset can rubbersheet a scanned image: you pick points on the image and the points in the drawing where they belong, and the image is warped to fit. It needs at least three pairs of points.
What carries over. Put the corners on something you know is rectangular, and shoot as square on as you can, since no correction restores detail the camera never caught. Notice which way around a tool works. Photoshop’s Perspective Crop marks the slanted shape and pulls it square; Distort, like Skew here, drags the picture’s corners into place. And perspective is not lens distortion: Lightroom and Photoshop correct bowed edges with separate lens corrections, which a four-corner tool cannot do.
Try this
- Photograph a book cover at an angle. Press Skew and drag each corner of the photo onto the matching corner of the cover's true shape, then Done.
- Try dragging one corner across the photo toward the opposite one, and feel where it stops.
- Skew a photo, then press Unskew, and notice it comes back with its own proportions, not the skewed ones.
Going further
See A photo of a paper notan and Adjusting the photo on the canvas. Martin Kemp, The Science of Art. Erwin Panofsky, Perspective as Symbolic Form. Richard Hartley and Andrew Zisserman, Multiple View Geometry in Computer Vision.