Perspective Corrector
Turn a tilted, trapezoid scan of a photo or document back into a clean rectangle by dragging its four corners — then fine-tune the rotation.
把倾斜、梯形的照片或文档扫描件,通过拖动四个角点校正为规整矩形——再微调旋转。
Private by design — your photo is processed locally and never uploaded.Drop a photo here, or click to browse
Supported formats: JPG, PNG, WebP, GIF, BMP
Drag to compare
Tip: this is perfect for photos taken of a print from an angle, scans with keystone distortion, or documents shot on a phone.
提示:适合斜拍的冲印照片、带梯形畸变的扫描件,或手机拍摄的文档。
How It Works
When you photograph a print or scan from an angle, the rectangular picture projects as a trapezoid — one side looks longer, edges converge. The Perspective Corrector inverts that projection: you mark the four corners of the picture as it appears, and the tool remaps that quadrilateral onto a clean rectangle using inverse bilinear interpolation.
Four corner handles
Drop each handle onto a real corner of the content. The overlay shows the quad you are selecting.
Perspective unwarp
Every output pixel is sampled from inside your quad, so converging edges become parallel and the content reads straight.
Fine rotation
A small rotation slider (±30°) trims off the last crooked degree after the corners are set.
Fully local
Warping and rotation run in your browser on the Canvas API — no upload, no server, works offline.
An honest note: perspective correction can only flatten the trapezoid you trace. It does not fix motion blur, low resolution, or a picture that is partly out of frame, and extreme warping can soften fine detail. For best results, photograph or scan as squarely as you can first.
当你斜拍照片或斜扫文档时,矩形的画面会投影成梯形——一边更长、边缘会聚。透视校正器反演这一投影:你标出画面实际呈现的四个角,工具用逆双线性插值把该四边形重映射为规整矩形。
四个角点手柄
把每个手柄放到内容真实的角上,叠加层会显示你选中的四边形。
透视展开
每个输出像素都从四边形内采样,会聚的边缘变为平行,画面恢复端正。
微调旋转
四角定好后,用小范围旋转滑杆(±30°)修正最后那点歪斜。
完全本地
展开与旋转都在浏览器 Canvas API 上完成——不上传、无服务器、可离线。
诚实说明:透视校正只能拉平你圈出的梯形,无法解决运动模糊、低分辨率或画面被裁切的问题,过度展开还会让细节变软。最好先尽量正面拍摄或扫描。
How to Use
- Upload the skewed photoDrag it in or click to browse. A scan or phone photo of a print works equally well.
- Place the four cornersDrag each circular handle onto the four corners of the actual picture content (not the whole scan edge).
- Fine-tune rotationUse the Rotation slider by small steps until horizontal lines look level.
- Compare and downloadDrag the compare handle to check the straightened result, then export as PNG, JPG or WebP.
- 上传倾斜照片拖入或点击选择。扫描件与手机翻拍冲印件效果相同。
- 放置四个角点把每个圆形手柄拖到画面内容真实的四个角(而非整张扫描的边缘)。
- 微调旋转小步拖动旋转滑杆,直到水平线看起来端正。
- 对比并下载拖动对比滑块查看校正结果,然后导出为 PNG、JPG 或 WebP。
Who this is for — and what it will not do
For photographs taken at an angle: a print on a table, a framed picture on a wall, a document photographed by hand. It warps the quadrilateral back towards a rectangle so the content stops looking trapezoidal.
- Hand-held document photos. Certificates and letters shot quickly, now readable and printable.
- Framed pictures on a wall. Removing the keystone effect without a tripod or a copy stand.
- Album pages. Flattening a page photographed from above at a slight angle.
Mistakes that ruin the result, and the fix for each
- Correcting a curved page as if it were flat. Warping fixes perspective, not paper curl. A bent page needs a different workflow and will still look wrong.
- Cropping tight to the corners. Leave a little margin, because the warp resamples and slightly softens the outermost pixels.
- Correcting at preview size only. Check the export: a warp that looks fine small can show stair-stepping in fine print at full size.
这个工具适合谁——以及它做不到什么
用于斜着拍的照片:桌上的照片、墙上的画框、手持拍摄的文件。它把四边形反向校正回矩形,让内容不再呈现梯形变形。
- 手持拍摄的文件。快速拍下的证书与信件,校正后变得可读、可打印。
- 墙上的画框照片。不用三脚架或翻拍台也能去掉梯形失真。
- 相册内页。把稍带斜角俯拍的页面校正平整。
毁掉效果的常见错误,以及各自的解法
- 把弯曲的纸当平面来校正。形变校正解决的是透视,不是纸张翘曲。起皱的纸需要另一套流程,硬校正仍然会不对。
- 贴边裁到四个角。留一点余量,因为形变会重采样并让最外圈像素略微变软。
- 只在预览尺寸下校正。检查导出文件:小图看着正常的形变,在全尺寸的细小文字上可能出现阶梯状锯齿。
Field Notes: Settings That Actually Work
Concrete starting values taken from the tool's own parameters, plus what to change when the first result is not right.
The output size of this tool is not something you type — it is derived from the four corners you drag. Width becomes the average of the top and bottom edge lengths, height becomes the average of the left and right edge lengths, and the result is never smaller than 8 px. That makes resolution predictable: if the traced quad measures 1200 px across in the loaded photo, the corrected rectangle is 1200 px wide, no more. Both output numbers drop when the photo was imported small, because every image here is loaded with its long edge capped at 2000 px.
That cap interacts badly with scanning, and it is worth doing the arithmetic before you start. A 300 DPI scan of a 6×4 inch print is 1800×1200 px, but if the whole scan is 3000 px on the long edge it gets downscaled to 2000 px on load — a factor of about 0.67. The print inside it then measures roughly 1200 px wide instead of 1800, and the corrected result prints 6 inches at about 200 DPI, not 300. If the output is destined for print, scan a tight copy around the photo rather than the entire scanner bed.
| What you see | Start here | Why it works | If it is still wrong |
|---|---|---|---|
| A phone shot of a print lying on a table, edges converging | Four corners on the print's own corners, Rotation 0 | The quad is what gets flattened; corner accuracy is the whole correction, and the readout shows the resulting width | Corners keep the keystone: zoom the browser in and place each handle on the actual paper corner, not the table edge |
| A flatbed scan that is only slightly crooked | Keep the default corners (4% inset), set Rotation to 1.5 or −1.5 | With no keystone the quad stays nearly rectangular, so the small rotation does the work without resampling the edges | Horizontal lines still dive: nudge rotation in 0.5° steps — that is the slider's actual step |
| A document photographed hard from one side | Corners tight on the paper, then inspect the after pane at full zoom | Heavy flattening stretches one side the most, and that is exactly where bilinear sampling blur appears first | If letters look bent rather than just soft, reshoot flatter; no corner placement will straighten a bowed page |
| The print runs off the edge of the photo | Do not correct here — crop the usable area first | A quad needs four real corners inside the frame; a missing corner turns the whole shape into a guess | Use Photo Cropper on the partial area, or rescan with the whole print visible |
Rotation is applied after the warp, on the flattened rectangle, and the rotated image is re-fitted into a larger canvas with the empty triangles filled in flat white. That means any non-zero rotation adds white wedges at the edges — visually obvious on a dark photo. Crop them off afterwards in Photo Cropper, which does not resample and therefore will not cost you a second round of softness. If the corrected file is then too small for its intended print size, Photo Resizer can bring it to a target width, though it will interpolate rather than restore detail.
What this tool cannot do: the warp is a bilinear quad mapping, not a full projective transform, so a strongly keystoned shape can bow straight lines slightly instead of keeping them dead straight. It cannot recover a corner that is outside the frame, cannot undo motion blur or lens distortion, and cannot add detail — the output is sampled from the pixels you already have, and extreme stretching visibly softens them.
Sources & further reading
- Federal Agencies Digital Guidelines Initiative, on capture geometry and resolution for reproduction.
- Library of Congress — Care, Handling and Storage of Photographs, on why copying a print square-on beats correcting later.
- MDN Web Docs — Canvas API, for how per-pixel sampling is performed locally.
这个工具的输出尺寸不是填出来的,而是由你拖出的四个角算出来的。宽度取上边与下边长度的平均值,高度取左边与右边长度的平均值,且不小于 8 像素。因此分辨率是可预测的:如果导入照片上量出的四边形横跨 1200 像素,校正后的矩形就是 1200 像素宽,不会更多。两个输出数值都会随导入尺寸变小而变小,因为这里所有图片加载时都被限制在长边 2000 像素以内。
这个上限与扫描件之间有笔账要先算。4×6 英寸、300 DPI 的扫面是 1800×1200 像素,但若整张扫描件长边 3000 像素,加载时就会被缩到 2000,比例约 0.67。里面的照片于是只剩约 1200 像素宽而不是 1800,校正结果印 6 英寸时约 200 DPI,不是 300。如果成品是要拿去冲印的,请只扫描照片周围那一小块,而不是整块扫描台。
| 你看到的现象 | 先用这组值 | 为什么有效 | 还是不对怎么办 |
|---|---|---|---|
| 手机斜拍桌上的一张冲印照片,边缘会聚 | 四个角点落在照片自己的四个角上,旋转 0 | 被拉平的就是这个四边形;角点准不准决定一切,读数会告诉你结果宽度 | 仍然带梯形:把浏览器放大,把手柄放到真正的纸角,而不是桌沿 |
| 平板扫描件只是轻微歪了一点 | 保留默认角点(内缩 4%),旋转设为 1.5 或 −1.5 | 没有梯形畸变时四边形几乎就是矩形,小角度旋转就够了,不必对边缘重采样 | 水平线仍在倾斜:按 0.5° 一档微调,这就是滑杆的真实步进 |
| 从一侧强力斜拍的文档 | 角点贴紧纸张边缘,然后把右侧结果放大检查 | 强力拉平时某一侧被拉伸最多,双线性采样的模糊也最先出现在那里 | 若文字是「弯」而不是「虚」,重拍得更正一些;再准的角点也拉不平翘曲的纸 |
| 照片本身跑出了画面边缘 | 不要在这里修——先裁出可用区域 | 四边形需要画面内的四个真实角;缺一角,整个形状就变成了猜 | 用「照片裁切」处理局部,或把整张照片都拍进来重扫 |
旋转是在拉平之后、作用在矩形结果上的,旋转后的图像会重新放进更大的画布,空出来的三角区域填成纯白。也就是说任何非零旋转都会在边缘留下白色楔形,在深色照片上非常显眼。事后到照片裁切把它们裁掉——裁切不重采样,不会再损失一轮锐度。如果校正后的文件对于目标冲印尺寸太小,照片缩放可以拉到指定宽度,但那只是插值,不会恢复细节。
这个工具做不到什么:这里的变形是双线性四边形映射,不是完整的投影变换,所以梯形越强,本该笔直的线越可能轻微弯曲。它无法找回跑到画面外的角,无法消除运动模糊或镜头畸变,也无法增加细节——输出完全来自你已有的像素,拉伸越猛,发虚越明显。
参考来源与延伸阅读
- 美国联邦机构数字化指南(FADGI):复现用途的拍摄几何与分辨率。
- 美国国会图书馆 — 照片的护理、取用与保存:为什么正对着复制比事后校正更划算。
- MDN Web Docs — Canvas API:浏览器本地逐像素采样的机制。
FAQ
What is perspective correction used for?
Will it make my photo perfectly straight?
Why does the corrected result look softer?
Is my photo uploaded?
Can I rotate a full 90°?
透视校正用来做什么?
它能让照片完全端正吗?
为什么校正后看起来更软?
我的照片会被上传吗?
能旋转 90° 吗?
Related Tools
Photo Cropper
Trim the borders after you straighten the scan.
校正扫描件后裁掉多余边缘。
Photo Resizer
Set the corrected photo to exact pixels.
把校正后的照片设为精确像素尺寸。
Vintage Frame
Put your straightened photo in a polaroid frame.
把端正后的照片放进拍立得相框。
Vignette Effect
Add a soft vignette after correcting the geometry.
校正几何后再加柔和暗角。
Old Movie Effect
Give the corrected scan a nostalgic film look.
给校正后的扫描件加上怀旧电影感。
Photo Sharpener
Recover crisp edges after the warp softens detail.
展开导致细节变软后恢复清晰边缘。
Related Guides
Scanning Old Photos: Best Settings
Scan square to minimize the perspective you need to fix.
尽量扫正,减少需要校正的透视。
Creative Vintage Effects
Styling ideas after you correct the geometry.
校正几何之后的风格化思路。
Film Scan Restoration
Handle keystone and color shifts from film scans.
处理胶片扫描中的梯形畸变与偏色。
Restoring ID & Passport Photos
Straighten and crop old ID photos at home.
在家把旧证件照校正并裁切端正。